HighBit has asked for the wisdom of the Perl Monks concerning the following question:
Is there any way to run Perl code in the Apache (1.3/prefork MPM) parent process *after* the whole initialization process? For example, is there a way to run Perl code in the Apache parent *just before* it forks off a new child?
To be clear, I know it's quite easy to run whatever Perl code you want during mod_perl initialization (while Apache is starting up, and before Apache begins serving requests). What I'm curious about is, is there any way to run Perl code in the parent *after* Apache has started up and has been serving requests?
I know this is a horrible idea, for several reasons, not least of which being that it would be quite easy to hang or crash Apache by doing this, but I'm curious to see if any Monks have explored this idea.
mod_perl has PerlChildInitHandler, which runs in the child just after it has been forked. This is probably the best place to do any of the crazy things I'm thinking of doing; but, I can think of some good reasons to also have a PerlParentJustBeforeForkHandler. Comments?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: running mod_perl code before the fork
by CountZero (Bishop) on Jun 01, 2009 at 13:13 UTC | |
|
Re: running mod_perl code before the fork
by perrin (Chancellor) on Jun 01, 2009 at 13:39 UTC |