You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brian Behlendorf <br...@hyperreal.org> on 1998/06/02 09:01:41 UTC

possible bug in apachectl

Not acked - could someone?

>Delivered-To: brian@hyperreal.org
>Delivered-To: apache-bugs@apache.org
>Date: Mon, 1 Jun 1998 05:30:24 -0400 (EDT)
>X-Envelope-To: apache-bugs@apache.org
>From: Nick Kew <ni...@webthing.com>
>Organization: WebThing
>Subject: apachectl - very serious bug
>To: apache-bugs@apache.org
>X-Status: 
>
>I'm mailing this rather than using your form, because the form
>doesn't permit attachments and I've hacked a quick fix.
>
>Version:
>1.3b6.  A search for "apachectl" in your changes file, and in the
>bugs database, doesn't find it.
>
>Problem:
>Apachectl checks the existence of a pid-file and of the PID it
>references, but fails to check whether the PID is really the httpd.
>
>Symptoms:
>Apachectl may simply fail.  In the worst case, it could kill an
>unrelated process - very naughty indeed.
>
>(I got the problem booting my laptop: the message from apachectl start
>was that httpd (pid 128) was already running; in fact PID 128 was an
unrelated process)
>
>Fix:
>I hacked together a fix you may wish to adopt.  I took the view that
>looking for httpd in the output of ps would be inadequate for those
>of us who may be running more than one httpd, and added locking
>to the pidfile.  I'm not sufficiently familiar with Apache to say
>whether this makes sense, but it's a working fix for systems
>supporting BSD flock() (fcntl() locking fails on forking).
>
>Patch attached.  The diffs are my mods vs the 1.3b6 distribution.
>
>-- 
>Nick Kew
> 
>
>