httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bh...@gensym.com (Ben Hyde)
Subject [PATCH] avoid ps -p on SunOS
Date Thu, 04 Jun 1998 21:51:38 GMT

This works on all my machines and since uname is
used in GuessOS it seems dependable.  - ben

> cvs diff -u apachectl
Index: apachectl
===================================================================
RCS file: /cvs/apache-1.3/src/support/apachectl,v
retrieving revision 1.6
diff -u -r1.6 apachectl
--- apachectl	1998/03/31 12:53:46	1.6
+++ apachectl	1998/06/04 21:41:46
@@ -44,12 +44,16 @@
     ARGS="help"
 fi
 
+OSKIND=`uname`
+PSFLAG='-p'
+if [ "x$OSKIND" = "xSunOS" ] ; then PSFLAG=' ' ;fi
+
 for ARG in $@ $ARGS
 do
     # check for pidfile
     if [ -f $PIDFILE ] ; then
 	PID=`cat $PIDFILE`
-	PS=`ps -p $PID 2>/dev/null | tail -1 | grep $PID`
+	PS=`ps $PSFLAG $PID 2>/dev/null | tail -1 | grep $PID`
 	if [ "x$PS" = "x" ]; then
 	    STATUS="httpd (pid $PID?) not running"
 	    RUNNING=0

Mime
View raw message