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?
On 2/12/06, Frank Wiles <[EMAIL PROTECTED]> wrote: > On Sun, 12 Feb 2006 15:02:38 +0800 > Ken Perl <[EMAIL PROTECTED]> wrote: > > > >From the Apache2::ServerUtil API doc, to do something only when > > >server > > restarts (httpd -k start or httpd -k graceful), check whether > > restart_count() is bigger than 1: > > > > my $cnt = Apache2::ServerUtil::restart_count(); > > do_something() if $cnt > 1; > > > > However, the API doesn't work as above. > > > > [...snip...] > > > > But, I can't detecting start, stop, graceful in startup.pl coding just > > like in the API doc, Could you give me some comments? thanks. > > I think you are misreading what the docs are saying. > Apache2::ServerUtil::restart_count() is just that a count of the > number of times the server was restarted. So a start will show a > count of two and gracefuls would be greater than two. > > The server restarts itself at least once during start up and you > typically do not want to do anything during that initial restart. > > --------------------------------- > Frank Wiles <[EMAIL PROTECTED]> > http://www.wiles.org > --------------------------------- > > -- perl -e 'print unpack(u,"62V5N\"FME;G\!E<FQ`9VUA:6PN8V]M\"[EMAIL PROTECTED] ")'