At 7:04 PM +0800 3/23/02, Stas Bekman wrote:
>If all you want to do is to be able to load the module only during 
>the restart use in startup.pl:
>
>   if ($Apache::Server::ReStarting) {
>       require "My::Sensitive::Module";
>   }

No, the module has to be loaded during both phases, other wise the 
configuration file syntax extensions it adds won't be loaded.  The 
sequence is:

1. Module loads
2. On load, module registers as an Apache module
3. On the second parse of the config file, apache asks module to unload
4. Perl module unregisters itself
5. Module isn't reloaded (because perl modules get loaded only once)
6. Apache module doesn't get reloaded
7. Config file parse fails with syntax errors

You would think that I could just skip step #4, but as far as I can 
tell that leaves stale pointers around, at least on some 
platforms/configurations.  It also doesn't seem proper in general.

The only work-around I have is to add an <perl> section that calls 
the initialization manually.  That works, but one would hope that 
Perl modules could be treated as first-class Apache modules with 
extra magic in the config file.

BTW.  I thought that startup.pl was only called once, so your 
suggestion would only work inside a <perl> directive anyway?
-- 

Kee Hinckley - Somewhere.Com, LLC
http://consulting.somewhere.com/
[EMAIL PROTECTED]

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

Reply via email to