This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.
To: Stas Bekman <stas@stason.org> From: merlyn@stonehenge.com (Randal L. Schwartz) Subject: Re: How to recognize server shutdown? Date: 10 Jan 2001 17:23:37 -0800 >>>>> "Stas" == Stas Bekman <stas@stason.org> 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. ===