Return-Path: Delivered-To: apmail-perl-embperl-archive@www.apache.org Received: (qmail 98918 invoked from network); 25 Jul 2008 00:57:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jul 2008 00:57:06 -0000 Received: (qmail 30161 invoked by uid 500); 25 Jul 2008 00:57:05 -0000 Delivered-To: apmail-perl-embperl-archive@perl.apache.org Received: (qmail 30146 invoked by uid 500); 25 Jul 2008 00:57:05 -0000 Mailing-List: contact embperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list embperl@perl.apache.org Received: (qmail 30135 invoked by uid 99); 25 Jul 2008 00:57:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Jul 2008 17:57:05 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [202.168.39.43] (HELO smtp.oriel.com.au) (202.168.39.43) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jul 2008 00:56:11 +0000 Received: from thenewsman@oriel.com.au [192.168.12.54] by smtp.oriel.com.au - SurfControl E-mail Filter (6.0.1); Fri, 25 Jul 2008 10:56:23 +1000 Received: from waldorf.oriel.com.au ([192.168.12.41]) by TheNewsman.oriel.com.au with Microsoft SMTPSVC(6.0.3790.3959); Fri, 25 Jul 2008 10:56:31 +1000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Question re preloading embperl and apache shutdown Date: Fri, 25 Jul 2008 10:58:49 +1000 Message-ID: In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Question re preloading embperl and apache shutdown Thread-Index: AcjtzjoDwx3h61wqS12m+buxQaIZrgAIRiYw References: <4887FF54.3040607@nilspace.com> From: "Andrew O'Brien" To: "Ed Grimm" , X-OriginalArrivalTime: 25 Jul 2008 00:56:31.0110 (UTC) FILETIME=[46D19260:01C8EDF1] X-SEF-7853D99-ADF1-478E-8894-213D316B8FFA: 1 X-SEF-ZeroHour-RefID: fgs=617664328 X-SEF-Processed: 6_0_1_111__2008_07_25_10_56_23 X-Virus-Checked: Checked by ClamAV on apache.org Hi Ed, > > Are any of the following useful to you (even if you set a variable > > using the shutdown callback to forcibly stop the preload?) in > > Apache2::ServerUtil? > > > > # register server shutdown callback > > Apache2::ServerUtil::server_shutdown_register_cleanup(sub { > > Apache2::Const::OK }); > > > > # do something only when the server restarts > > my $cnt =3D Apache2::ServerUtil::restart_count(); > > do_something_once() if $cnt > 1; >=20 > I suspect you probably mean >=20 > > do_something_once() if $cnt =3D=3D 1; >=20 > Otherwise, you're depending upon the double start behavior,=20 > which could > cause problems when someone decides to fix that bug. Sorry, not a bug: That's taken directly from perldoc Apache2::ServerUtil. See the full doco and use cases at http://perl.apache.org/docs/2.0/api/Apache2/ServerUtil.html#C_restart_co unt_ Documentation on the deliberate restart: http://perl.apache.org/docs/2.0/user/handlers/server.html#Server_Life_Cy cle "Apache 2.0 starts by parsing the configuration file. After the configuration file is parsed, the PerlOpenLogsHandler handlers are executed if any. After that it's a turn of PerlPostConfigHandler handlers to be run. When the post_config phase is finished the server immediately restarts, to make sure that it can survive graceful restarts after starting to serve the clients." For further info see the above documentation sections and the 1.0 to 2.0 porting guide: http://perl.apache.org/docs/2.0/user/porting/compat.html Cheers, Andrew --------------------------------------------------------------------- To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org For additional commands, e-mail: embperl-help@perl.apache.org