httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manoj Kasichainula <man...@io.com>
Subject Re: sun4 and apachectl
Date Wed, 03 Jun 1998 23:01:40 GMT
On Wed, Jun 03, 1998 at 03:49:52PM -0700, Dean Gaudet wrote:
> bind's ndc uses "ps -p $pid"... which I think is why Marc implemented
> apachectl that way.
> 
> Yet another option is "kill -0 $pid".

Here's a simple patch that uses it. The kill -0 concept seems to work
under Red Hat Linux and AIX 4.2; it's untested on the rest (notably
sun4).

*** apachectl.orig	Wed Jun  3 18:52:09 1998
--- apachectl	Wed Jun  3 18:54:55 1998
***************
*** 49,56 ****
      # check for pidfile
      if [ -f $PIDFILE ] ; then
  	PID=`cat $PIDFILE`
! 	PS=`ps -p $PID 2>/dev/null | tail -1 | grep $PID`
! 	if [ "x$PS" = "x" ]; then
  	    STATUS="httpd (pid $PID?) not running"
  	    RUNNING=0
  	else
--- 49,55 ----
      # check for pidfile
      if [ -f $PIDFILE ] ; then
  	PID=`cat $PIDFILE`
! 	if kill -0 $PID 2> /dev/null; then
  	    STATUS="httpd (pid $PID?) not running"
  	    RUNNING=0
  	else

Users of the Apache webserver are hereby granted a non-exclusive,
irrevocable, world-wide, royalty-free, non-transferable license to use,
execute, prepare derivative works of, and distribute (internally and
externally, and including derivative works) the code accompanying this
license as part of, and integrated into the Apache webserver.  This code is
provided "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTY OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK ARISING OUT OF THE USE
OR PERFORMANCE OF THIS CODE REMAINS WITH USERS OF THE APACHE WEBSERVER.  I
represent and warrant that I am legally entitled to grant the above
license.

-- 
Manoj Kasichainula - manojk at io dot com - http://www.io.com/~manojk/
"We can't protect the idiot." - David Vance of Glaxo Wellcome

Mime
View raw message