You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Mike Blazer <bl...@peterlink.ru> on 2002/07/13 01:30:37 UTC

$Apache::ServerStarting

Hello, guys,
I'm facing rather unpleasant thing in <Perl> sections. This all happens
on Win32, I'm using 0.7 distribution from theoryx5.uwinnipeg.ca by Randy
Kobes (thanks Randy!)

So, here, what happens when apache starts?
1. It passes the conf file once (starting)
2. passes it for the 2nd time (testing that restart works)
3. forks a child (the only one on Win32) - child passes the conf-file
4. Apache passes the config file again when it stops (dunno what for)

So, when I put print to file into my <Perl> section and used a variable
filename with $$."-".time() suffix - I got 3 files (two with the same
pid-part, as expected). And the 4th - for stop.

Now, I'd like to know what phase I'm on and most of all I'd like to
limit some part of my <Perl> section to the phase#1 and avoid it at
phases#2-4 - for not to execute it in each child. I tried to print
$Apache::Server::Starting and $Apache::Server::ReStarting to that files
and got 1,0 in all 4 files.
Then I used $Apache::ServerStarting and $Apache::ServerReStarting (they
are not documented anywhere in my files but are used in Apache::DBI) -
and got the same results. So, these vars give no ability to detect the
phase.

Well, I developed some hack with Win32::Process to detect - am I in the
parent process or child or stoping process. But Starting and ReStaring
phases are still indistinguishable.

Any ideas?

Thanks in advance
-- 
==================================
Mike Blazer
blazer@peterlink.ru
==================================

Re: $Apache::ServerStarting

Posted by Mike Blazer <bl...@peterlink.ru>.
> Then I used $Apache::ServerStarting and $Apache::ServerReStarting
...

That was all about on Win32 Apache/1.3.20 (Win32) mod_perl/1.25_01-dev

But on my Solaris 2.8
Server: Apache/1.3.22 (Unix) mod_perl/1.26 mod_ssl/2.8.5 OpenSSL/0.9.6b

$Apache::Server::Starting reports 1/0 during start/restart, which is
much better. $Apache::Server::ReStarting is always 0.

So, probably the part of the problem was fixed somewhere between
mod_perl 1.25 and 1.26

Thanks
-- 
==================================
Mike Blazer
blazer@peterlink.ru
==================================