Roxen.git / server / start

version» Context lines:

Roxen.git/server/start:1:   #!/bin/sh   # - # $Id: start,v 1.53 1998/11/06 02:57:53 marcus Exp $ + # $Id: start,v 1.54 1998/11/18 04:53:30 per Exp $    -  + cd `dirname $0` +    VERSION=202; BETA=.b;      # Can be set with '--config-dir=DIR'   DIR=../configurations/   LOGDIR=../logs/   FILES="default"   program=base_server/roxenloader.pike   extra_args=""      # Enable threads (if available) on Solaris.
Roxen.git/server/start:23:   fi      # Roxen will create files as the initial user,   # which it expects to be able to read as the run-time user.   umask 022      # Pike default Master-program   if [ "x$PIKE_MASTER" = "x" ]; then    if [ -d share/pike ]; then    # This is used with localinstall -  DEFINES="$DEFINES -Ishare/pike/include" -  PIKE_MODULE_PATH="$PIKE_MODULE_PATH:share/pike/modules" +  DEFINES="$DEFINES -I$roxendir/share/pike/include" +  PIKE_MODULE_PATH="$PIKE_MODULE_PATH:$roxendir/share/pike/modules"    fi    if [ -f lib/master.pike ]; then -  DEFINES="$DEFINES -mlib/master.pike -Ilib/include" -  PIKE_MODULE_PATH="$PIKE_MODULE_PATH:lib/modules" +  DEFINES="$DEFINES -m$roxendir/lib/master.pike -I$roxendir/lib/include" +  PIKE_MODULE_PATH="$PIKE_MODULE_PATH:$roxendir/lib/modules"    elif [ -f lib/pike/master.pike ]; then -  DEFINES="$DEFINES -mlib/pike/master.pike -Ilib/pike/include" -  PIKE_MODULE_PATH="$PIKE_MODULE_PATH:lib/pike/modules" +  DEFINES="$DEFINES -m$roxendir/lib/pike/master.pike -I$roxendir/lib/pike/include" +  PIKE_MODULE_PATH="$PIKE_MODULE_PATH:$roxendir/lib/pike/modules"    fi    export PIKE_MODULE_PATH   else    # This is usefull when using several different Pikes.    # Specify include and module paths with    # PIKE_INCLUDE_PATH and PIKE_MODULE_PATH    # they are handled automatically by the master,    # so no need to do it here.    DEFINES="$DEFINES -m$PIKE_MASTER"   fi
Roxen.git/server/start:65:    DEFINES="$DEFINES -Ibase_server"   fi      # Extra program-path   DEFINES="$DEFINES -P`pwd`"      # Support for adding local pike-modules   if [ -d ../local/etc/. ]; then    # Extra module-path    if [ -d ../local/etc/modules/. ]; then -  DEFINES="$DEFINES -M../local/etc/modules" +  DEFINES="$DEFINES -M$roxendir/../local/etc/modules"    fi       # Extra include-path    if [ -d ../local/etc/include ]; then -  DEFINES="$DEFINES -I../local/etc/include" +  DEFINES="$DEFINES -I$roxendir/../local/etc/include"    fi       # Extra program-path -  DEFINES="$DEFINES -P../local/etc" +  DEFINES="$DEFINES -P$roxendir/../local/etc"   fi      # Extra kludge for HPUX   # HPUX doesn't like group 60001(nobody)   if uname | grep 'HP-UX' >/dev/null 2>&1; then    echo 'WARNING: Applying kludge for HPUX. (see base_server/privs.pike)'    DEFINES="$DEFINES -DHPUX_KLUDGE"   fi      pike=pike
Roxen.git/server/start:157:    once=1    ;;    '--gdb')    gdb=gdb    once=1    ;;    '--program')    program="$2"    shift    ;; +  '--cd') +  cd_to="$2" +  shift +  ;;    '--version')    echo Roxen Challenger 1.`expr $VERSION / 100`$BETA`expr $VERSION % 100`    exit 0    ;;    '--help'|'-?')    sed -e "s/\\.B/`tput 'bold' 2>/dev/null`/g" -e "s/B\\./`tput 'rmso' 2>/dev/null`/g" << EOF   .BThis command will start the Roxen serverB..      The environment variable .BROXEN_ARGSB. can be used to specify   the default arguments.
Roxen.git/server/start:301:   #   # Some useful functions   #      rotate () {    b=5;    for a in 4 3 2 1 ; do mv -f $1.$a $1.$b 2> /dev/null; b=$a; done   }      start_roxen() { +  if [ x$DIR != xconfigurations ] ; then    args="-DROXEN $DEBUG $DEFINES $pass $program --config-dir=$DIR" -  +  else +  args="-DROXEN $DEBUG $DEFINES $pass $program" +  fi +  if [ x$cd_to != x ] ; then +  cd $cd_to +  fi    if [ "x$gdb" = "xno" ]; then    echo "PIKE_MODULE_PATH=$PIKE_MODULE_PATH"    echo Executing $pike $args $@    $pike $args $@    else    echo Executing gdb $pike $args $@    echo >.gdbinit handle SIGPIPE nostop noprint pass    echo >>.gdbinit handle SIGUSR1 nostop noprint pass    echo >>.gdbinit handle SIGUSR2 nostop noprint pass    echo >>.gdbinit run $args $@
Roxen.git/server/start:352:       if [ "$exitcode" -eq "0" ] ; then    # Clean shutdown.    echo $$: "Roxen shutdown."    exit 0    fi    if [ "$exitcode" -lt "0" ] ; then    # Signal death.    echo $$: "Roxen died of signal $exitcode. Restarting..."    else -  # Restart. Sleep a few seconds before restarting. -  echo $$: Roxen died. Restarting in 5 seconds... -  sleep 5 +  # Restart. Do not sleep a few seconds before restarting. +  echo $$: Roxen died. Restarting... +  # sleep 1    fi    done       echo $$: Not Reached "famous last words"       ) < /dev/null > $LOGDIR/debug/start_$FILES.output 2>&1 &      else    echo $$: "Server restart at `date`"    start_roxen $extra_args   fi