perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Perl <kenp...@gmail.com>
Subject Re: detecting server start, stop, graceful in startup.pl
Date Mon, 13 Feb 2006 03:02:12 GMT
I add your code to my startup.pl, but it doesn't work.

# apache2ctl -k start
Program is starting
Stopping...

#apache2ctl -k graceful
<no output here>

# apache2ctl -k stop
<no output here>

On 2/13/06, Frank Wiles <frank@wiles.org> wrote:
> On Mon, 13 Feb 2006 09:17:57 +0800
> Ken Perl <kenperl@gmail.com> wrote:
>
> > No, I want to do something in the startup.pl script.
> > When apache start, I also want to say my modperl program is starting
> > and started, when stop, I want to say my modperl program is stopping
> > and stopped. When graceful, I want to say reloading and reloaded.
> > But I didn't find a API could help, any ideas?
>
>  Hi Ken,
>
>  I haven't tested this, but it should work. In your startup.pl do
>  something like this:
>
>  my $started = 0;
>  my $cnt = Apache2::ServerUtil::restart_count();
>
>  if( !$started and $cnt == 1 ) {
>       $started = 1;
>       print "Program is starting\n";
>  }
>
>  if( $cnt > 2 ) {
>       print "Restarting";
>  }
>
>  if( $started and $cnt == 1 ) {
>       print "Stopping...";
>  }
>
>  ---------------------------------
>   Frank Wiles <frank@wiles.org>
>   http://www.wiles.org
>  ---------------------------------
>
>


--
perl -e 'print unpack(u,"62V5N\"FME;G\!E<FQ`9VUA:6PN8V]M\"\@``
")'

Mime
View raw message