httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Kraemer <Martin.Krae...@mch.sni.de>
Subject Re: rewritten apachectl
Date Mon, 25 Aug 1997 12:04:13 GMT
Marc wrote,...
> 
> Feedback appreciated.  
> 

I have two problems here on SVR4:

1)  > /var/tmp/apachectl
    /var/tmp/apachectl: test: Argument erwartet
    Exit 1

    > sh -x !$
    sh -x /var/tmp/apachectl
    PIDFILE=/usr/local/etc/httpd/logs/httpd.pid
    HTTPD=/home/marcs/archive/apache/apachen/src/httpd
    LYNX=lynx -dump
    STATUSURL=http://localhost/server-status
    ERROR=0
    + [ ! ]
    /var/tmp/apachectl: test: Argument erwartet
    Exit 1

    [ ! "$@"] doesn't work when no args are given (because "$@" --when
    no arguments are there-- is not "", but really -nothing-. Here,
    it might be preferable to use "$*" (and -z instead of !):
    Could you change the test to something like
	if [ -z "$*" ]; then
    or
	if [ $# -eq 0 ]; then
    This change should make it run on all "standard unixes".

2)  > !$ status
    /var/tmp/apachectl status
    Gebrauch: ps [ -edalfcj ] [ -r sysname ] [ -t termlist ]
	    [ -u uidlist ] [ -p proclist ] [ -g grplist ] [ -s sidlist ]
	   ...

    On SVR4, we have a SYSV'ish /usr/bin/ps program (and a Berkeley'ish
    /usr/ucb/ps). The (standard) ps program needs a "-p" in front of
    the PID. I wonder how this could be made tranparent for all *nixes.


--- /var/tmp/apachectl.bak	Mon Aug 25 13:46:31 1997
+++ /var/tmp/apachectl	Mon Aug 25 14:01:51 1997
@@ -40,7 +40,7 @@
 
 ERROR=0
 
-if [ ! "$@" ]; then 
+if [ -z "$*" ]; then
     ARGS="help"
 else
     ARGS="$@"
@@ -51,7 +51,7 @@
     # check for pidfile
     if [ -f $PIDFILE ] ; then
 	PID=`cat $PIDFILE`
-	PS=`ps $PID | tail -1 | grep $PID`
+	PS=`/usr/bin/ps -p $PID | tail -1 | grep $PID`
 	if [ "x$PS" = "x" ]; then
 	    STATUS="httpd (pid $PID?) not running"
 	    RUNNING=0


    Martin
-- 
| S I E M E N S |  <Martin.Kraemer@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

Mime
View raw message