Roxen.git / server / start

version» Context lines:

Roxen.git/server/start:1:   #!/bin/sh   # - # $Id: start,v 1.73 1999/09/02 18:30:52 per Exp $ + # $Id: start,v 1.74 1999/09/05 01:34:43 per Exp $    -  + pre="`echo \" $$ \" | sed -e 's/\(.........\)\(.*\)/\1/g'` : " +    cd `dirname $0`      # Can be set with '--config-dir=DIR'   DIR=../configurations/   LOGDIR=../logs/   FILES="default"   program=base_server/roxenloader.pike   extra_args=""      # Default verbosity level.
Roxen.git/server/start:37:   ####### BEGIN ARGUMENT PARSING         DEFINES="$DEFINES -DKEEP_ALIVE"      # 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 [ $verbose -gt 0 ] ; then -  echo 'Solaris 2.5 or later detected. Enabling threads (if available).' +  echo "$pre Solaris 2.5 or later detected. Enabling threads (if available)."    fi    DEFINES="$DEFINES -DENABLE_THREADS -DTHREADS"    if $pike --version 2>&1|head -1|grep 0.5 ; then    if [ $verbose -gt 0 ] ; then -  echo Pike 0.5 detected. Threads disabled +  echo "$pre Pike 0.5 detected. Exiting." +  exit 1    fi    DEFINES="`echo $DEFINES | sed -e 's/-DENABLE_THREADS//'`"    fi    fi   fi      gdb=no      ## Parse all arguments.   ## GNU-style, long options only, except for -D, simply passed on.
Roxen.git/server/start:85:    ;;    '--debug'|'--with-debug'|'--enable-debug')    debug=1    ;;    '--without-debug')    debug=-1    ;;    '--fd-debug'|'--with-fd-debug'|'--enable-fd-debug')    DEFINES="-DFD_DEBUG $DEFINES"    ;; +  '--dump-debug'|'--with-dump-debug'|'--enable-dump-debug') +  DEFINES="-DDUMP_DEBUG $DEFINES" +  ;;    '--threads'|'--with-threads'|'--enable-threads')    DEFINES="-DENABLE_THREADS $DEFINES"    ;;    '--no-threads'|'--without-threads'|'--disable-threads')    DEFINES="`echo $DEFINES | sed -e 's/-DENABLE_THREADS//'`"    ;;    '--no-keep-alive'|'--without-keep-alive'|'--disable-keep-alive')    DEFINES="`echo $DEFINES | sed -e 's/-DKEEP_ALIVE//'`"    ;;    '--with-profile'|'--profile')
Roxen.git/server/start:212:    .B./start --program bin/install.pikeB. will    start the installation program normally    started with .B./installB.       .B--with-debugB.: Enable debug       .B--without-debugB.: Disable all debug       .B--with-fd-debugB.: Enable FD debug.    +  .B--with-dump-debugB.: Enable dump debug. +     .B--trussB.: (Solaris only). Run the server under    truss, shows .BallB. system calls. This is    extremely noisy, and is not intented for    anything but debug.    -  +  .B--truss-cB.: (Solaris only). Run the server under +  truss -c, shows times for all system calls +  on exit. This is not intented for anything +  but debug. Slows the server down. +     .B--pid-file=<file>B.: Store the roxen and startscript pids in this    file. Defaults to .B/tmp/roxen_$UIDB.       .BArguments passed to pike:B.       .B-DDEFINEB.: Define the symbol .BDEFINEB..       .B-d<level>B.: Set the runtime Pike debug to level.    This only works if Pike is compiled    with debug.
Roxen.git/server/start:269:    ;;    esac    shift    done   }      parse_args $@      if [ ! "X$ROXEN_ARGS" = "X" ]; then    if [ $verbose -gt 0 ]; then -  echo $$: Using $ROXEN_ARGS from ROXEN_ARGS. +  echo "$pre Using $ROXEN_ARGS from ROXEN_ARGS."    else :; fi    parse_args $ROXEN_ARGS   fi      if [ ! "X$pass" = "X" ] ; then set -- $pass ;fi         ####### END ARGUMENT PARSING      
Roxen.git/server/start:350:    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)' +  echo "$pre WARNING: Applying kludge for HPUX. (see base_server/privs.pike)"    else :; fi    DEFINES="$DEFINES -DHPUX_KLUDGE"   fi      ####### END PIKE OPTIONS         #   # 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" != "x../configurations/" ] ; then -  args="-DROXEN $DEBUG $DEFINES $program --config-dir=$DIR $pass" +  args="$DEBUG $DEFINES $program --config-dir=$DIR $pass"    else -  args="-DROXEN $DEBUG $DEFINES $program $pass" +  args="$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 $@ +  echo "$pre Executing $pike $args $@"|sed -e "s!`pwd`!.!g"    else :; fi    $pike $args $@    else -  echo Executing gdb $pike $args $@ +  echo $pre 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   }      #
Roxen.git/server/start:409:   else    DEBUG="-DDEBUG -DMODULE_DEBUG"   fi      if [ "x$debug" = "x-1" ] ; then    DEBUG="";   else :; fi      if [ -z "$once" ] ; then    if [ $verbose -gt 0 ]; then -  echo $$: Starting the Roxen Challenger World Wide Web server. +  echo $pre Starting the Roxen Challenger World Wide Web server.    else :; fi    ./mkdir -p $LOGDIR/debug/       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`" -  echo $$: "Debug log in $LOGDIR/debug/$FILES.1" +  echo $pre "Server restart at `date`" +  echo $pre "Debug log in $LOGDIR/debug/$FILES.1"    rotate $LOGDIR/debug/$FILES       start_roxen $extra_args 2>>$LOGDIR/debug/$FILES.1 1>&2       exitcode="$?"       if [ "$exitcode" -eq "0" ] ; then    # Clean shutdown. -  echo $$: "Roxen shutdown." +  echo $pre "Roxen shutdown."    exit 0    fi    if [ "$exitcode" -lt "0" ] ; then    # Signal death. -  echo $$: "Roxen died of signal $exitcode. Restarting..." +  echo $pre "Roxen died of signal $exitcode. Restarting..."    else -  echo $$: Roxen down. Restarting. +  echo $pre Roxen down. Restarting.    fi    done) < /dev/null > $LOGDIR/debug/start_$FILES.output 2>&1 &   else    if [ $verbose -gt 0 ]; then -  echo $$: "Start at `date`" +  echo "$pre Start at `date`"    else :; fi    start_roxen $extra_args   fi