Roxen.git / server / start

version» Context lines:

Roxen.git/server/start:1:   #!/bin/sh   # - # $Id: start,v 1.211 2003/12/03 10:57:04 grubba Exp $ + # $Id: start,v 1.212 2003/12/03 12:16:31 grubba 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:645:         #   # Some useful functions   #      cleanup_pid_file() {    [ -z "$pidfile" ] || rm $pidfile   }    + # NOTE: The following function needs to be reentrant.   signal_exit() {    dp "Start script terminating."    trap "" 2 15 -  if [ "x$ROXEN_PID" != "x" ]; then +  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`"    dp_no_nl "Shutting down MySQL." -  mysql_pid=`cat $DIR/_mysql/mysql_pid` +     kill "$mysql_pid" 2>/dev/null    # Give mysql 5 minutes to shut down.    timer=""    while [ -f "$DIR/_mysql/mysql_pid" -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.
Roxen.git/server/start:677:   ' >&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" -a \ -  "$mysql_pid" = "`cat $DIR/_mysql/mysql_pid`" ]; then +  if [ -f "$DIR/_mysql/mysql_pid" ] && \ +  [ "$mysql_pid" = "`cat $DIR/_mysql/mysql_pid`" ]; then    rm -f "$DIR/_mysql/mysql_pid" 2>/dev/null    fi    fi    fi    dp "Start script terminated."    exit 0   }      exit_fail() {    exitcode=1