Branch: Tag:

2003-05-29

2003-05-29 22:36:56 by Andreas Sigfridsson <sigge@lysator.liu.se>

Added restart and kill options for start script.

Rev: aido-server.in:1.8

21:    '--once')    once=1    ;; +  '--kill'|'--stop') +  if [ -f $HOME/.aido/pid ]; then +  PID=`cat $HOME/.aido/pid` +  kill $PID 2>/dev/null && wait $PID 2>/dev/null +  fi +  exit 0 +  ;; +  '--restart') +  if [ -f $HOME/.aido/pid ]; then +  PID=`cat $HOME/.aido/pid` +  kill -HUP $PID 2>/dev/null +  fi +  exit 0 +  ;;    '--nossl'|'--no-sll')    DEFINES="-DNOSSL $DEFINES"    ;;
52:    .B--onceB.: Run the server only once, in the foreground.    The default behaviour is to run it in a loop in the    background. +  .B--kill|--stop Kill the running server, without restarting it +  .B--restart Kill the running server, restarting it afterwards    .B--log=fileB.: Use the specified file as the debug log.    default is $LOG   
81:    echo "Pike version: $pikeversion."    echo exec $PIKE "$ARGS"    fi -  $PIKE $ARGS +  $PIKE $ARGS & +  AIDO_PID=$! +  wait $AIDO_PID +  AIDO_PID=""   }    -  + signal_exit() { +  trap "" 2 15 +  if [ "x$AIDO_PID" != "x" ]; then +  kill $AIDO_PID 2>/dev/null && wait $AIDO_PID 2>/dev/null +  fi +  exit + } +  + signal_hup() { +  if [ "x$AIDO_PID" != "x" ]; then +  kill $AIDO_PID 2>/dev/null +  fi + } +  + AIDO_PID=""   if [ x$once = 'x0' ] ; then    echo Starting server in the background.    ( -  +  trap signal_exit 2 15 +  trap signal_hup 1 +     while : ; do    rotate_log ;    start_server > $LOG 2>&1 < /dev/null    done    ) & -  +  echo $! >$HOME/.aido/pid   else -  +  trap signal_exit 2 15 +  echo $$ >$HOME/.aido/pid    start_server   fi