I have a DSO module which establishes a custom handler. The handle fires up
external process which perform the work for certain requests. Those processes
contain a lot of state information for user application sessions. We want to
have some cleanup code that will shutdown those processes cleanly if the Apache
server is stopped.
I thought I had solved this problem by registering my cleanup handler on the
pool which is passed to my register_hooks function. This does get called when
the server is stopped. The problem is, it also gets called when the server is
reconfigured (i.e. with apachectl graceful). Our system administrators want to
use graceful to update minor configuration directives or rotate log files from
time to time and feel strongly that they should be able to do so without
disrupting our user sessions.
So after a few hours of reviewing the source code, I am throwing in the towel.
I am going to ask the geniuses:
Is there a way to run some cleanup code in a module when the server is being
stopped, but not being restarted? Or, can a cleanup handler in a loaded module
determine whether the server is being shut down or restarted?
Thanks very much