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.

It doesn't work. I've tested:

startup.pl:
-----------
package Cleanup;

$Cleanup::parent_pid = $$;

END{

    eval q{
           if ($$ == $Cleanup::parent_pid) {
               `echo $Cleanup::parent_pid $$ >> /tmp/parent`;
           } else {
               `echo $Cleanup::parent_pid $$ >> /tmp/children`;
           }
          };
}

the parent process doesn't run the END block.

_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Reply via email to