Re: CORE::exit and Apache:Registry
On Wed, 24 May 2000, Mark Hewis wrote: > As far as I have tested under Apache::Registry the following commands have > the following effect > > 1) CORE::exit -> restart all child processes for that server ( a little too > drastic for me) that shouldn't happen. it should only kill the kid it was called from. > 2) exit -> exit code but leave state of all modules the same > > What am am really after is an exit which just restarts the child process (it > is called in) resetting all module globals any suggestions? exit(-2) will do a graceful exit of the child (unlike CORE::exit), after logging the transaction is done and connection is closed. > On a related topic in a given module > > BEGIN{} seems to be called only on child initialisation while > END{} is called at the end of each processed request > > This seems a little inconsistant why is this? Can this behaviour be changed? > > Because of this > > close_everything() in END{} in BerkeleyDB.pm is called after each request > destroying any ties or environments open which for me is not good. see mod_perl.pod and chapter 9 of the eagle book for BEGIN/END details. the solution for you would be to load BerkeleyDB at startup, in which case, END is not called until the child exits.
Re: CORE::exit and Apache:Registry
Hi there, On Wed, 24 May 2000, Mark Hewis wrote: > What am am really after is an exit which just restarts the child process (it > is called in) resetting all module globals any suggestions? die() ? > END{} is called at the end of each processed request They are only processed for each request under Apache::Registry, PerlRun and friends. Otherwise they are not processed until the Apache parent exits. See perl.apache.org/guide - "Controlling and Monitoring the Server". 73, Ged.
CORE::exit and Apache:Registry
As far as I have tested under Apache::Registry the following commands have the following effect 1) CORE::exit -> restart all child processes for that server ( a little too drastic for me) 2) exit -> exit code but leave state of all modules the same What am am really after is an exit which just restarts the child process (it is called in) resetting all module globals any suggestions? On a related topic in a given module BEGIN{} seems to be called only on child initialisation while END{} is called at the end of each processed request This seems a little inconsistant why is this? Can this behaviour be changed? Because of this close_everything() in END{} in BerkeleyDB.pm is called after each request destroying any ties or environments open which for me is not good. Thanks for any help Mark Hewis Versions/Settings # Apache:1.3.12 Mod_perl:1.21 perl:5.00503 Makefile command for modperl: perl Makefile.PL \ APACHE_SRC=../apache_1.3.12/src \ DO_HTTPD=1 \ USE_APACI=1 \ PERL_MARK_WHERE=1 \ PERL_STACKED_HANDLERS=1 \ PERL_CHILD_INIT=1 \ ALL_HOOKS=1 \ APACI_ARGS=--enable-module=rewrite,--enable-module=proxy Platform:SunOS ops-dev6 5.6 Generic_105181-19 sun4u sparc SUNW,UltraSPARC-IIi-cEngine Passed all tests This e-mail, and any attachment, is confidential. If you have received it in error, please delete it from your system, do not use or disclose the information in any way, and notify me immediately. The contents of this message may contain personal views which are not the views of the BBC, unless specifically stated.