Roxen.git / server / start

version» Context lines:

Roxen.git/server/start:1:   #!/bin/sh   # - # $Id: start,v 1.60 1998/11/28 21:13:53 grubba Exp $ + # $Id: start,v 1.61 1998/11/28 21:27:37 grubba 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=""    -  + # Default verbosity level. + verbose=1 +    # Default to using a relative path.   roxendir="."      ####### BEGIN ARGUMENT PARSING      ## Parse all arguments.   ## GNU-style, long options only, except for -D, simply passed on.   parse_args() {    while [ ! c"$1" = "c" ] ; do    case $1 in
Roxen.git/server/start:57:    ;;    '--with-profile'|'--profile')    DEFINES="-DPROFILE $DEFINES"    ;;    '--with-file-profile'|'--file-profile')    DEFINES="-DPROFILE -DFILE_PROFILE $DEFINES"    ;;    '--keep-alive'|'--with-keep-alive'|'--enable-keep-alive')    DEFINES="-DKEEP_ALIVE $DEFINES"    ;; +  '--quiet'|'-q') +  verbose=0 +  ;; +  '--verbose'|'-v') +  verbose=2 +  debug=1 +  ;;    '--once')    once=1    ;;   # Misspelling --once might give undesirable results, so let's accept   # some "creative" spellings... :-)    '--onve'|'--onec'|'--onev')    once=1    ;;    '--gdb')    gdb=gdb
Roxen.git/server/start:194:    pass="$pass $1"    ;;    esac    shift    done   }      parse_args $@      if [ ! "X$ROXEN_ARGS" = "X" ]; then +  if [ $verbose -gt 0 ]; then    echo $$: Using $ROXEN_ARGS from ROXEN_ARGS. -  +  else :; fi    parse_args $ROXEN_ARGS   fi      if [ ! "X$pass" = "X" ] ; then set -- $pass ;fi         ####### END ARGUMENT PARSING         ####### BEGIN PIKE OPTIONS      # Enable threads (if available) on Solaris.   # Most other OS's have thread bugs that cause them or Roxen to crash.   if uname | grep 'SunOS' >/dev/null 2>&1; then    if uname -r | grep '5\.[5-9]' >/dev/null 2>&1; then -  if [ x"$1" != "x--help" ] ; then +  if [ $verbose -gt 0 ] ; then    echo 'Solaris 2.5 or later detected. Enabling threads (if available).'    fi    DEFINES="$DEFINES -DENABLE_THREADS"    fi   fi      # Roxen will create files as the initial user,   # which it expects to be able to read as the run-time user.   umask 022   
Roxen.git/server/start:282:    DEFINES="$DEFINES -I$roxendir/../local/etc/include"    fi       # Extra program-path    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 +  if [ $verbose -gt 0 ]; then    echo 'WARNING: Applying kludge for HPUX. (see base_server/privs.pike)' -  +  else :; fi    DEFINES="$DEFINES -DHPUX_KLUDGE"   fi      pike=pike   if [ -x bin/pike ] ; then pike=$roxendir/bin/pike; fi   if [ -x bin/roxen ] ; then pike=$roxendir/bin/roxen; fi   if [ "x$PIKE" = "x" ]; then :; else    if [ -x "$PIKE" ]; then pike="$PIKE"; fi   fi   
Roxen.git/server/start:317:   start_roxen() {    if [ "x$DIR" != "x../configurations/" ] ; then    args="-DROXEN $DEBUG $DEFINES $program --config-dir=$DIR $pass"    else    args="-DROXEN $DEBUG $DEFINES $program $pass"    fi    if [ x$cd_to != x ] ; then    cd $cd_to    fi    if [ "x$gdb" = "xno" ]; then +  if [ $verbose -gt 0 ]; then    echo "PIKE_MODULE_PATH=$PIKE_MODULE_PATH"    echo Executing $pike $args $@ -  +  else :; fi    $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 $@    gdb $pike    rm .gdbinit    fi   }      #   # Now do the stuff   #      if [ -z "$once" ] ; then -  +  if [ $verbose -gt 0 ]; then    echo $$: Starting the Roxen Challenger World Wide Web server. -  +  else :; fi    ./mkdir -p $LOGDIR/debug/       if [ -z "$debug" ] ; then    DEBUG="-DMODULE_DEBUG";    else    DEBUG="-DDEBUG -DMODULE_DEBUG"    fi       if [ "x$debug" = "x-1" ] ; then    DEBUG="";    else :; fi    -  +  if [ $verbose -gt 0 ]; then    cat << oo   Using configuration from $DIR, storing the debug log in $LOGDIR/debug/$FILES.1   You can use the configuration interface in the server to get debug info.   oo -  +  else :; fi       # Try to get rid of some fd's.    # Some /bin/sh's have problems detaching otherwise.       exec >/dev/null    exec 2>/dev/null    exec </dev/null       (while : ; do    echo $$: "Server restart at `date`"
Roxen.git/server/start:383:    exit 0    fi    if [ "$exitcode" -lt "0" ] ; then    # Signal death.    echo $$: "Roxen died of signal $exitcode. Restarting..."    else    echo $$: Roxen down. Restarting.    fi    done) < /dev/null > $LOGDIR/debug/start_$FILES.output 2>&1 &   else +  if [ $verbose -gt 0 ]; then    echo $$: "Start at `date`" -  +  else :; fi    start_roxen $extra_args   fi