[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: works in bash, but not in postinst script



On Fri, Feb 16, 2001 at 02:10:29PM -0500, Jesse Stockall wrote:
> The following commands work fine in a bash script, but in a rpm postinst
> script it always returns "MySQL not installed" no mater if it is installed
> or not.
> 
> rpm -q MySQL &> /dev/null && MYSQL=YES
> if [ "$MYSQL" = "YES" ]; then
>         echo "MYSQL installed"
>         if test -z $DISPLAY; then
>                 echo "You appear to be running in a non-graphical
> environment"
>         else
>                 echo "Gui environment."
>         fi
> else
>         echo "MySQL not installed"
> fi
> 
> Any ideas?
> 

You can't run rpm in a %post scriptlet, as the database is exclusively
locked, causing rpm to fail, causing the misleading "MySQL not installed"
message.

Don't use rpm to do the test, do it some other way.

73 de Jeff

-- 
Jeff Johnson	ARS N3NPQ
jbj@jbj.org	(jbj@redhat.com)
Chapel Hill, NC





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []