www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve VanDevender <ste...@darkwing.uoregon.edu>
Subject config/2612: apachectl does not check if `cat httpd.pid` is an httpd process
Date Tue, 14 Jul 1998 18:31:07 GMT

>Number:         2612
>Category:       config
>Synopsis:       apachectl does not check if `cat httpd.pid` is an httpd process
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Tue Jul 14 11:40:00 PDT 1998
>Last-Modified:
>Originator:     stevev@darkwing.uoregon.edu
>Organization:
apache
>Release:        
>Environment:
Solaris 2.6 with recommended patches current to July 1998
SunOS darkwing 5.6 Generic_105181-06 sun4d sparc
>Description:
We discovered during our most recent reboot that Apache 1.3.0 did not start
at boot because a process existed that was not the master HTTPD process but
which had the same PID as in the existing httpd.pid file.
>How-To-Repeat:
Boot without auto-starting Apache.  Somehow create a process with the same PID
as the Apache HTTPD that was running before the reboot.  Run "apachectl start".
>Fix:
The patch appended below modifies the 'grep' in the apachectl script so that it
matches "$PID.*httpd" instead of just "$PID"; this prevents apachectl from
falsely recognizing a different process as the master httpd.  (Line numbers
differ from the distributed apachectl because of further local customizations
to our installed apachectl script.)

@@ -49,7 +53,7 @@
     # check for pidfile
     if [ -f $PIDFILE ] ; then
        PID=`cat $PIDFILE`
-       PS=`ps -p $PID 2>/dev/null | tail -1 | grep $PID`
+       PS=`ps -p $PID 2>/dev/null | tail -1 | grep "$PID.*httpd"`
        if [ "x$PS" = "x" ]; then
            STATUS="httpd (pid $PID?) not running"
            RUNNING=0
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <apbugs@Apache.Org> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]




Mime
View raw message