>>>>> "Stas" == Stas Bekman <[EMAIL PROTECTED]> writes:

Stas> On Wed, 10 Jan 2001, Perrin Harkins wrote:
>> On Wed, 10 Jan 2001, Dave Rolsky wrote:
>> > Is there any way to distinguish between a child being shutdown (say
>> > maxrequests has been exceeded) versus all of Apache going down (kill
>> > signal sent to the original process or something).
>> 
>> Register an END block in your startup.pl, and have it check it's PID to
>> see if it's the parent.

Stas> It doesn't work. I've tested:

Here's an idea... in the startup code, create a pipe and fork.
block the kid on a read.  ni-night, kid.

when the parent quits, the kid will get EOF, and can go off and clean
things up.

in fact, it won't get the EOF until *all* the processes sharing the
write-end have quit, so it would seem to be exactly what is needed.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Reply via email to