Roxen.git / server / start

version» Context lines:

Roxen.git/server/start:1:   #!/bin/sh   # - # $Id: start,v 1.223 2005/11/18 16:44:03 grubba Exp $ + # $Id: start,v 1.224 2005/12/21 14:03:33 noring 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:61:    cd "$dn"    echo " : Got new directory as `pwd`" >&2    fi    ;;   esac      . bin/functions      # Can be set with '--config-dir=DIR'   DIR=../configurations + if [ ! "x$ROXEN_CONFIGDIR" = "x" ] + then +  DIR="$ROXEN_CONFIGDIR" + fi   LOGDIR=../logs -  + if [ ! "x$ROXEN_LOGDIR" = "x" ] + then +  LOGDIR="$ROXEN_LOGDIR" + fi   FILES="default"   program=base_server/roxenloader.pike   VARDIR=../var   LOCALDIR=../local -  + if [ ! "x$ROXEN_DATADIR" = "x" ] + then +  VARDIR="$ROXEN_DATADIR"/var +  LOCALDIR="$ROXEN_DATADIR"/local +  +  if [ -d "$ROXEN_DATADIR"/license ] +  then +  ROXEN_LICENSEDIR="$ROXEN_DATADIR"/license +  else +  ROXEN_LICENSEDIR="$DIR"/_license +  fi +  export ROXEN_DATADIR ROXEN_LICENSEDIR + fi + export LOCALDIR LOGDIR VARDIR   SELF_TEST_DIR=etc/test      # Make LOCALDIR an absolute path   if test -d $LOCALDIR/.; then    LOCALDIR="`cd $LOCALDIR; pwd`"   else :; fi      if test -d $VARDIR/.; then :; else    dp "Creating directory $VARDIR"    ./mkdir -p $VARDIR/ || exit 1
Roxen.git/server/start:188:    truss="truss"    ;;    --truss-c)    truss="truss -c"    ;;    --strace)    truss="strace"    ;;    --log-dir=*)    LOGDIR=`echo $1 | sed -e 's/--log-dir=//'` +  export LOGDIR    ;;    --debug-log=*)    DEBUGLOG=`echo $1 | sed -e's/--debug-log=//'`    ;;    --config-dir=*)    DIR=`echo $1 | sed -e 's/--config-dir=//'`    FILES=`echo $1 | sed -e's/--config-dir=//' -e's/\.//g' -e's./..g' -e 's.-..g'`    ;;    --pid-file=*)    pidfile=`echo $1 | sed -e 's/--pid-file=//'`
Roxen.git/server/start:255:    '--quiet'|'-q')    verbose=0    ;;    '--verbose'|'-v')    verbose=2    debug=1    ;;    '--remove-dumped')    remove_dumped=1;    ;; +  '--stop') +  stop=1; +  ;;       '--once')    once=${once:-1}    debug=0    ;;   # Misspelling --once might give undesirable results, so let's accept   # some "creative" spellings... :-)    '--onve'|'--onec'|'--onev'|'--ocne')    once=${once:-1}    debug=0
Roxen.git/server/start:409:    .B--self-testB.: Runs a testsuite.    .B--self-test-verboseB.: Runs a testsuite, report all tests.    .B--self-test-quietB.: Runs a testsuite, only report errors.    .B--self-test-dir=DIRB.: Use this self test directory instead of    the default .Betc/testB. directory.       .B--onceB.: Run the server only once, in the foreground.    This is very useful when debugging. Implies    --module-debug.    +  .B--stopB.: Stop the server. +     .B--keep-mysqlB.: Do not shut down MySQL process when exiting    the start script. Useful during development    or any other scenario where the start script    is frequently terminated.       .B--gdbB.: Run the server in gdb. Implies .B--onceB..       .B--programB.: Start a different program with the Roxen    Pike. As an example,    .B./start --program bin/install.pikeB. will
Roxen.git/server/start:805:   # Now do the stuff   #      trap signal_exit 2 15   trap "" 1      if [ "$program" = "base_server/roxenloader.pike" ] ; then    # Starting a Roxen server. Fix the pid file.    [ -z "$pidfile" ] && pidfile="${ROXEN_PID_FILE:-$DIR/_roxen_pid}"    pass="$pass --pid-file='`echo \"$pidfile\" | sed -e \"s/'/'\\\"'\\\"'/g\"`'" +  # Check for stop. +  if [ "$stop"x != x ] && [ -f "$pidfile" ] +  then +  pids=`cat "$pidfile"` +  echo "$pids" | xargs kill +  while kill -0 $pids 2>/dev/null +  do +  sleep 1 +  done +  exit +  fi    # Avoid duplicate start scripts if we got a pid file.    mypid=$$    test -f "$pidfile" && {    if read roxenpid && read scriptpid; then    if kill -0 $scriptpid 2>/dev/null; then    dp "According to the pid file $pidfile,"    dp "there is already a start script running with pid $scriptpid. Specify "    dp "another pid file with --pid-file if this is a different server."    dp "Server not started."    :