Roxen.git / server / start

version» Context lines:

Roxen.git/server/start:1:   #!/bin/sh   # - # $Id: start,v 1.155 2001/03/20 15:18:55 noring Exp $ + # $Id: start,v 1.156 2001/03/23 03:39:52 per 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:149:    ;;    --truss)    pike="truss $pike"    ;;    --truss-c)    pike="truss -c $pike"    ;;    --log-dir=*)    LOGDIR=`echo $1 | sed -e 's/--log-dir=//'`    ;; +  --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=//'`    ;;    '--with-security'|'--enable-security')    DEFINES="$DEFINES -DSECURITY"    ;;
Roxen.git/server/start:287:       .B--verbose -vB.: Enable more verbose messages.       .B--quiet -qB.: Disable most of the messages.       .B--log-dir=DIRB.: Set the log directory. Defaults to .B../logsB..       .B--config-dir=DIRB.: Use an alternate configuration directory.    Defaults to .B../configurationsB..    +  .B--debug-log=FILEB.: Use an alternate debuglog file. +  Defaults to .B../logs/debug/B.configdirname.B.1B.. +     .B--pid-file=FILEB.: Store the roxen and startscript pids in this    file. Defaults to .B../configurations/_roxen_pidB..       .B--silent-startB.: Inhibits output to stdout. If used,    this argument must be the first one.       .B--without-ram-cacheB.: Do not use an in-RAM cache to speed    things up. Saves RAM at the cost of speed.       .B--without-ram-cache-statB.: Disable the stat that is usualy done
Roxen.git/server/start:589:    if [ "x$gdb" = "xno" ]; then    if [ $verbose -gt 0 ]; then    if [ $verbose -gt 1 -o -z "$once" ] ; then    dp Executing $pike $args|sed -e "s!`pwd`!.!g"    else    dp "Using the '$pike' pike binary"|sed -e "s!`pwd`!.!g"    fi    fi       if [ "x$once" = "x" ]; then -  $pike $args 2>>$LOGDIR/debug/$FILES.1 1>&2 & +  $pike $args 2>>"${DEBUGLOG}.1" 1>&2 &    ROXEN_PID=$!    dp "Roxen WebServer server pid $ROXEN_PID."    wait $! 2>/dev/null 1>&2    exitcode="$?"    ROXEN_PID=""    else    if [ "x$do_pipe" = "x" ] ; then    $pike $args 2>&1    exitcode="$?"    else
Roxen.git/server/start:683:    if [ "`cat $old_roxen_defines 2>/dev/null`" != "$VERSION_DATA" ] ; then    remove_old_dot_o_files "defines or pike version changed"    fi    echo "$VERSION_DATA" > $old_roxen_defines   fi      if [ -z "$once" ] ; then    if [ $verbose -gt 0 ]; then    dp "Starting the Roxen WebServer."    else :; fi -  ./mkdir -p $LOGDIR/debug/ -  +  if [ "x$DEBUGLOG" = "x" ] ; then +  DEBUGDIR="$LOGDIR/debug" +  DEBUGLOG="$DEBUGDIR/$FILES" +  else +  DEBUGDIR="`dirname "$DEBUGLOG"`" +  fi    if [ $verbose -gt 0 ]; then    dp "Using configuration from $DIR" -  dp "Storing the debug log in $LOGDIR/debug/$FILES.1" +  dp "Storing the debug log in ${DEBUGLOG}.1"    dp "You can use the administration interface in the server to see debug info."    else :; fi       if (    (    # Minor race here wrt pid file cleanup.    exec 3>&-    trap signal_exit 2 15    trap "" 1    trap cleanup_pid_file 0       while : ; do -  if test -d "$LOGDIR/debug/."; then :; else +  if test -d "$DEBUGDIR/."; then :; else    # Avoid infinite loop if the debug directory is deleted.    # Thanks to Emils Klotins <emils@dot.lv> for reporting it. -  if ./mkdir -p "$LOGDIR/debug/"; then :; else -  dp "Failed to create log directory $LOGDIR/debug/." +  if ./mkdir -p "$DEBUGDIR"; then :; else +  dp "Failed to create log directory $DEBUGDIR."    exit 1    fi    fi       dp "Server start at `date`" -  dp "Debug log in $LOGDIR/debug/$FILES.1" -  rotate $LOGDIR/debug/$FILES +  dp "Debug log in ${DEBUGLOG}.1" +  rotate $DEBUGLOG    start_roxen       if [ "$exitcode" -eq "0" ] ; then    # Clean shutdown.    dp "Roxen WebServer shutdown."    exit 0    fi    if [ "$exitcode" -lt "0" ] ; then    # Signal death.    dp "Roxen WebServer died of signal $exitcode. Restarting..."
Roxen.git/server/start:743:    esac    fi    done    ) &    # Minor race here wrt pid file contents.    pid=$!    trap "" 0    [ -z "$pidfile" ] || { echo "x" && echo $pid; } > $pidfile    dp "Forked start script, pid $pid." 2>&3    dp "Start script pid $pid." -  ) 3>&2 </dev/null >"$LOGDIR/debug/start_$FILES.output" 2>&1; then +  ) 3>&2 </dev/null >"$DEBUGDIR/start_$FILES.output" 2>&1; then    trap "" 0    :    else    dp 'Failed to spawn subshell. -- Permission problem?'    exit 1    fi       # Try to get rid of some fd's.    # Some /bin/sh's have problems detaching otherwise.       exec >/dev/null    exec </dev/null   else    start_roxen   fi