Roxen.git / server / start

version» Context lines:

Roxen.git/server/start: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:46:21 marty Exp $      ### If --silent-start is given as the first argument,   ### nothing will be printed to stdout by the script.      if [ "x$1" = "x--silent-start" ] ; then    SILENT_START="y"    shift   fi      check_owner() {
Roxen.git/server/start:719:   signal_exit() {    dp "Start script terminating."    trap "" 2 15    if [ "x$ROXEN_PID" != "x" ] && \    kill -0 $ROXEN_PID 2>/dev/null; then    kill $ROXEN_PID 2>/dev/null && wait $ROXEN_PID 2>/dev/null    dp "Roxen WebServer shutdown."    # 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    timer=`echo "x$timer" | sed -e 's/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/m/'`    if [ "x$SILENT_START" != "xy" ]; then    # Progress indicator.    echo "." | tr -d '   ' >&2    fi    done    if [ "x$SILENT_START" != "xy" ]; then    echo >&2    fi    if kill -0 "$mysql_pid" 2>/dev/null; then    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    dp "Start script terminated."    exit 0   }      exit_fail() {    exitcode=1   }