Branch: Tag:

2001-11-21

2001-11-21 22:26:21 by Martin Stjernholm <mast@lysator.liu.se>

Fix for the problem with wrong ROXEN_PID in combination with
backgrounded eval. (It's actually kinda fun puzzling out these
horrible sh script kludges. ;)

Rev: server/start:1.190

1:   #!/bin/sh   # - # $Id: start,v 1.189 2001/11/21 10:06:57 mast Exp $ + # $Id: start,v 1.190 2001/11/21 22:26:21 mast Exp $      ### If --silent-start is given as the first argument,   ### nothing will be printed to stdout by the script.
655:    exitcode=1   }    + # This is a trick to get $ROXEN_PID and arguments containing spaces + # correct at the same time. + fork_roxen() { +  "$@" & +  ROXEN_PID=$! + } +    start_roxen() {    check_owner    raise_limit
680:    fi       if [ "x$once" = "x" ]; then -  eval "\"$pike\" $args" 2>>"${DEBUGLOG}.1" 1>&2 & -  ROXEN_PID=$! +  eval "fork_roxen \"$pike\" $args 2>>\"${DEBUGLOG}.1\" 1>&2"    dp "Roxen WebServer server pid $ROXEN_PID."    wait $ROXEN_PID 2>/dev/null 1>&2    exitcode="$?"
689:    else    if [ "x$do_pipe" = "x" ] ; then    if [ "x$once" = "x1" ]; then -  eval "\"$pike\" $args" 2>&1 & -  ROXEN_PID=$! +  eval "fork_roxen \"$pike\" $args 2>&1"    wait $ROXEN_PID 2>/dev/null 1>&2    exitcode="$?"    ROXEN_PID=""