perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Foertsch <torsten.foert...@gmx.net>
Subject Re: run once at apache stop
Date Mon, 05 Mar 2007 12:21:20 GMT
On Monday 05 March 2007 12:42, Sergey Borodich wrote:
> I need some technique what work as
> PerlRequire (or PerlPostConfigHandler)
> at apache start (it run only once)
>
> but I need similar technique for stop apache
> it must run if "apache stop" only once
>
> it need for cleanup shared memory before stop, etc
>
> and also desirably for mp1/mp2 both
>
> prompt something please...

1) Create an object and store it in a global variable. Then use the DESTROY 
method to do what you want. That is what Perl::AtEndOfScope does.

2) Another way for mp2: create a cleanup handler APR::Pool::cleanup_register 
for one of the global pools. Apache2::ServerRec::pool or 
Apache2::Process::pool come to mind.

3) And what about a simple END{} block?

Torsten

Mime
View raw message