mod_perl2 $Apache::Server::Starting - modperl

This is a discussion on mod_perl2 $Apache::Server::Starting - modperl ; What are the mod_perl 2 equivalents of $Apache::Server::Starting and $Apache::Server::ReStarting? Or is there another way to determine if code is being run in the parent or child process? Thanks....

+ Reply to Thread
Results 1 to 4 of 4

Thread: mod_perl2 $Apache::Server::Starting

  1. mod_perl2 $Apache::Server::Starting

    What are the mod_perl 2 equivalents of $Apache::Server::Starting and
    $Apache::Server::ReStarting? Or is there another way to determine if code is
    being run in the parent or child process?

    Thanks.


  2. Re: mod_perl2 $Apache::Server::Starting

    On Sat, Aug 9, 2008 at 5:19 PM, Dondi M. Stroma wrote:
    > What are the mod_perl 2 equivalents of $Apache::Server::Starting and
    > $Apache::Server::ReStarting?


    http://perl.apache.org/docs/2.0/user...r__ReStarting_

    - Perrin


  3. Re: mod_perl2 $Apache::Server::Starting

    > Perrin Harkins wrote:
    > On Sat, Aug 9, 2008 at 5:19 PM, Dondi M. Stroma
    > wrote:
    >> What are the mod_perl 2 equivalents of $Apache::Server::Starting and
    >> $Apache::Server::ReStarting?

    >
    > http://perl.apache.org/docs/2.0/user...r__ReStarting_


    Thanks, but I do not see how Apache2::ServerUtil::restarting() does the same
    thing. The $Apache::Server::Starting and $Apache::Server::ReStarting are,
    respectively, 1 and 0 during start, 0 and 1 during restart, and 0 and 0 when
    neither starting nor restarting. The restarting() function returns 1 during
    start, 2 during (first) restart, but then still returns 2 when neither
    starting nor restarting. So how can I tell if its neither starting nor
    restarting?


  4. Re: mod_perl2 $Apache::Server::Starting

    On Sat, Aug 9, 2008 at 8:20 PM, Dondi M. Stroma wrote:
    > Thanks, but I do not see how Apache2::ServerUtil::restarting() does the same
    > thing. The $Apache::Server::Starting and $Apache::Server::ReStarting are,
    > respectively, 1 and 0 during start, 0 and 1 during restart, and 0 and 0 when
    > neither starting nor restarting. The restarting() function returns 1 during
    > start, 2 during (first) restart, but then still returns 2 when neither
    > starting nor restarting. So how can I tell if its neither starting nor
    > restarting?


    I haven't used this. I see that Apache::compat does the following:

    ($Apache::Server::Starting, $Apache::Server::ReStarting) =
    Apache2::ServerUtil::restart_count() == 1 ? (1, 0) : (0, 1);

    If the count stays at 2, then that probably says it is restarting indefinitely.

    If you just want to know when you are no longer in the parent process,
    you could use a PerlChildInitHandler to set a flag indicating this.

    - Perrin


+ Reply to Thread