You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Sang Han <sa...@virtualgiveaway.com> on 2000/06/03 08:24:40 UTC

IPC::Cache and how to clear the cache

Hi all,

I'm not sure if this is an appropriate place to ask.  I've looked over the
"Guide" and couldn't really determine for sure how to do this. I am using
the IPC::Cache module to store some configuration information in shared
memory for mod_perl modules that I've written.  The problem I'm facing is
that I want to be able to clear the cache on stops and restarts, but in
order to do this correctly and to ease my paranoia, the clean up method
should only be called by the parent process and only once when the parent
process exits.

So I was thinking of creating a handler for the PerlRestartHandler phase.
However I had some questions about how this phase gets called and if it gets
called at all when stopping the apache server (i.e., apachectl stop).  I'm
assuming that the child apache processes are not involved at this point in
the phase so any methods called at this point are executed only once by the
parent process as it exits. Yes/No?

Can someone confirm my thinking here and let me know if there is a better
way to perform one time cleanup/execution of code during server exit--kind
of analogous to the startup.pl file and it's function during startup.  BTW,
I've also thought about using a DESTROY or END method to the start.pl file,
but wasn't sure that they are called at server exit by only the parent
process. Furthermore, I thought about taking an "if defined then reset"
approach in the startup.pl, but I wanted see if there was a cleaner way of
doing this.

thank you in advance,
sang