You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Doug MacEachern <do...@covalent.net> on 2000/12/22 05:55:38 UTC

Re: END block aborted during httpd shutdown

On Wed, 18 Oct 2000, Ernest Lergon wrote:

> Dear list members, dear Doug,
> 
> it seems to me, that my initial mail of this thread was to long to read
> and to be answered  - especially because the questions are in the last
> paragraph far down below and need scrolling of the message text ;-))
> 
> Ok, I'll try to split it up in bite-sized pieces:
> 
> 1) Our apache is running 20 childs. A perl module is loaded via
> startup.pl. On shutdown of apache the END block of this module is called
> 20 times and not only 1 time as I expected. Why?

because perl_destruct() runs the END blocks, and each child calls
perl_destruct() at exit.

if you only want something to run once in the parent on shutdown or
restart, use a registered cleanup:

#PerlRequire startup.pl
warn "parent pid is $$\n";
Apache->server->register_cleanup(sub { warn "server cleanup in $$\n"});