httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Kraemer <Martin.Krae...@Fujitsu-Siemens.com>
Subject Re: Parent death should force children suttee
Date Thu, 31 Jan 2002 22:49:36 GMT
On Thu, Jan 31, 2002 at 05:42:33PM -0500, Jim Jagielski wrote:
> 
> But the parent dying doesn't imply the child processes also kicking
> the bucket (as we've seen).

And that's rather easy to do, and IMHO it should be added to the children.
(that was what I said about kill(getppid(),0) or getppid() being 1).

> So that means the cronjob needs to check
> for the valid parent, and if not, selectively kill the child processes
> and then restart apache. That selective kill isn't trivial (we
> *still* don't do apachectl right) due to the various 'ps' versions
> and executable names.

Exactly. That's another reason why I am against it.

> It's "easier" (as far as having access to the
> information) if we have an in-process daemon with access to the child
> PIDs.

No. The child processes do their request loop. Why shouldn't they
check for the existence of the parent once per loop?

With that assumption, a cron job doing:
>   kill -0 `cat httpd-2.0/logs/httpd.pid` || httpd-2.0/sbin/apachectl start

is enough.

> Assuming that the kids die when the parent does, the above makes sense
> but I thought the main issue was whether they should or should not.

IMO they definitely should (someone was against it, I am totally FOR it).

> If they do, it's trivial, if not, it's not.

Exactly.

   Martin
-- 
<Martin.Kraemer@Fujitsu-Siemens.com>         |     Fujitsu Siemens
Fon: +49-89-636-46021, FAX: +49-89-636-47655 | 81730  Munich,  Germany

Mime
View raw message