Dave Rolsky wrote:
>
> On Wed, 10 Jan 2001, G.W. Haywood wrote:
>
> > Don't you get a message in error_log to the effect that a signal has
> > been received?
>
> Sure, but I don't think that would help me do what I want.
>
> Let me illustrate:
>
> 1. server is started
> 2. config is read, modules are loaded, BEGIN blocks are run in this
> process (just once)
> 3. X children are created
> 4. children are born, they die, yadda yadda. The END block is run
> whenever a child dies.
> 5. the server is told to shut down
> 6. the first server to start (the one running as root or whatever) sends
> signals to the children telling them to shutdown. END blocks run in all
> children.
> 7. the first server shuts down - I'd like to run something here because
> it should only be happening to during a 'final' shutdown and only after
> the children have finished serving their last requests.
>
Perhaps you could send a USR1 prior to your TERM signal and have your
END blocks perform your shutdown tasks if they see the USR1 signal.
But then you have the problem of new children being started due to the
USR1
not to mention it would preclude using USR1 for doing normal graceful
restarts, 8^)
Hrm, would be nice if $r->server had a method to tell you if apache is
in the process of shutting down or not.
--
struct Programmer/Analyst 'Danny Rathjens' {this.place =
"MyCity.com";}
I know you believe you understood what you think I said, but I
am not sure you realize that what you heard is not what I meant.