Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 92201 invoked from network); 5 Mar 2007 12:22:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Mar 2007 12:22:03 -0000 Received: (qmail 19884 invoked by uid 500); 5 Mar 2007 12:22:06 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 19864 invoked by uid 500); 5 Mar 2007 12:22:06 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 19853 invoked by uid 99); 5 Mar 2007 12:22:06 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Mar 2007 04:22:06 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of torsten.foertsch@gmx.net designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 05 Mar 2007 04:21:57 -0800 Received: (qmail invoked by alias); 05 Mar 2007 12:21:35 -0000 X-Provags-ID: V01U2FsdGVkX1/J4NlwuirJdODBsHp6oTzsvIvvzqkM/fT1oa6mC5 Er0DtZoa0rgW3d Received: by opi.home (Postfix, from userid 1000) id 901D3C3117; Mon, 5 Mar 2007 13:21:32 +0100 (CET) From: Torsten Foertsch To: modperl@perl.apache.org Subject: Re: run once at apache stop Date: Mon, 5 Mar 2007 13:21:20 +0100 User-Agent: KMail/1.9.5 References: <45EC0217.5080305@univ.kiev.ua> In-Reply-To: <45EC0217.5080305@univ.kiev.ua> Cc: Sergey Borodich MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3738122.8QLZNJnryC"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200703051321.32046.torsten.foertsch@gmx.net> X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked by ClamAV on apache.org --nextPart3738122.8QLZNJnryC Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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= =20 method to do what you want. That is what Perl::AtEndOfScope does. 2) Another way for mp2: create a cleanup handler APR::Pool::cleanup_registe= r=20 for one of the global pools. Apache2::ServerRec::pool or=20 Apache2::Process::pool come to mind. 3) And what about a simple END{} block? Torsten --nextPart3738122.8QLZNJnryC Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQBF7AtMwicyCTir8T4RAmdQAJ97ELcpKJjlcSzIBfk13mlMAZXu5QCfWKFW IGIaM1vfzjIGEnXLgVaBcR8= =ewso -----END PGP SIGNATURE----- --nextPart3738122.8QLZNJnryC--