perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew O'Brien" <andr...@oriel.com.au>
Subject RE: Question re preloading embperl and apache shutdown
Date Fri, 25 Jul 2008 00:58:49 GMT

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 = Apache2::ServerUtil::restart_count();
> >    do_something_once() if $cnt > 1;
> 
> I suspect you probably mean
> 
> >    do_something_once() if $cnt == 1;
> 
> Otherwise, you're depending upon the double start behavior, 
> 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


Mime
View raw message