Branch: Tag:

2007-05-28

2007-05-28 08:45:52 by Martin Jonsson <marty@roxen.com>

Use the correct path for the MySQL pidfile when the ROXEN_DATADIR environment variable is used.

Rev: server/start:1.228

1:   #!/bin/sh   # - # $Id: start,v 1.227 2006/11/15 16:33:10 anders Exp $ + # $Id: start,v 1.228 2007/05/28 08:45:52 marty Exp $      ### If --silent-start is given as the first argument,   ### nothing will be printed to stdout by the script.
726:    # FIXME: Consider exiting here.    fi    if [ "x$keep_mysql" = "x" ] ; then -  if [ -f $DIR/_mysql/mysql_pid ] ; then -  mysql_pid="`cat $DIR/_mysql/mysql_pid 2>/dev/null`" +  if [ -f "$DIR/_mysql/mysql_pid" ] ; then +  mysql_pidfile="$DIR/_mysql/mysql_pid" +  elif [ -f "$ROXEN_DATADIR/mysql/mysql_pid" ] ; then +  mysql_pidfile="$ROXEN_DATADIR/mysql/mysql_pid" +  fi +  if [ "x$mysql_pidfile" != "x" ] ; then +  mysql_pid="`cat $mysql_pidfile 2>/dev/null`"    dp_no_nl "Shutting down MySQL."    kill "$mysql_pid" 2>/dev/null    # Give mysql 5 minutes to shut down.    timer="" -  while [ -f "$DIR/_mysql/mysql_pid" -a \ +  while [ -f "$mysql_pidfile" -a \    "$timer" != "mmmmm" ] && \    kill -0 "$mysql_pid" 2>/dev/null; do    sleep 2
750:    dp "Shutting down MySQL the hard way."    kill -9 "$mysql_pid" 2>/dev/null    fi -  if [ -f "$DIR/_mysql/mysql_pid" ] && \ -  [ "$mysql_pid" = "`cat $DIR/_mysql/mysql_pid`" ]; then -  rm -f "$DIR/_mysql/mysql_pid" 2>/dev/null +  if [ -f "$mysql_pidfile" ] && \ +  [ "$mysql_pid" = "`cat $mysql_pidfile`" ]; then +  rm -f "$mysql_pidfile" 2>/dev/null    fi    fi    fi