Waldek Grudzien wrote:
> Hello,
> 
> I was wondering if there is a possibility to reload PERL module compiled
> into Apache
> with Apache::Registry
> (and I want to reload this  module in all Apache children processes) by
> running reload-program once.
> 
> For example Apache::Reload must be set as PerlInitHandler, so it's handler
> method is run every time request comes to Apache. What I'd like to do is to
> reload specified (or all) module by running the program ONCE.
> 
> I tried using something like perl-status:
> 
> <Location /mod-perl-reload>
>  SetHandler perl-script
>  PerlHandler Apache::MyReloadModule
> </Location>
> 
> where MyReloadModule's handler was deleting specified module from %INC and
> reloading it by require, but it didn't satisfy me becouse changes weren't
> seen in apache children processess (at least I think so),
> 
> so I wrote something like this in MyReloadModule:
> 
> sub handler {
>     my $r = shift;
>     Apache->request($r);
> 
>     .
>     .    sending HTML
>     .
> 
>     foreach my $k (keys %INC) {
>         $r->print("$k<BR>");
>     }
>     $r->print("PID $$");
> 
>     $r->print("</BODY></HTML>");
> 
> }
> 
> and I realised that changes I have made to %INC in one child process aren't
> seen in another one.
> 
> So my problem can be set in another way:
> Do apache children communicate between themselves?

no

> Is it possible to write such a "reloader" script as I wanted to write?

no

> Maybe somebody already done this?

see above
The processes are forked and don't share the perl iterpreter, that's why 
it's impossible to do what you are trying to do.

If you try to reload data it's doable by many ways (IPC, dbm, etc), not 
the code.

Currently Apache::Reload or its equivalent your only solution. With 
mod_perl 2.0 it'll be doable, if you run a single threaded server.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Reply via email to