Andrew O'Brien wrote:
Hi Neil,
use Apache2::ServerUtil;
# We want to do this only when the sever restarts. (The start process
# includes a restart). The below variable has a value of 1 during
# server start/stop and a value greater than one during the second
# phase of server starting and any graceful restart.
if ( Apache2::ServerUtil::restart_count() > 1 ) {
# force load/initialise perl stuff
}
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;
Apparently Embperl isn't simply calling the preload routine again at
shutdown... for some reason, the httpd daemon is just sitting there
hanging for 30 seconds or so at shutdown. I tried tracing to a log file,
and the PreLoadFiles routine in Embperl wasn't being executed again at
shutdown. So I don't know why the server hangs like that rather than
just shutting down. It's got something to do with Embperl, though,
because when I switch preloading off, it shuts down very quickly with no
hang on that last process. A mystery.
Neil
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]