Re: PerlChildInitHandler doesn't work inside VirtualHost?
On Thu, 8 Aug 2002, Rick Myers wrote: > On Aug 09, 2002 at 12:16:45 +1000, Cees Hek wrote: >> Quoting Jason W May <[EMAIL PROTECTED]>: >>> Running mod_perl 1.26 on Apache 1.3.24. >>> >>> I've found that if I place my PerlChildInitHandler inside a VirtualHost >>> block, it is never called. >> >> It doesn't really make sense to put a PerlChildInitHandler >> inside a VirtualHost directive. > > Why? The Eagle book says this is a perfectly valid concept. Well, for one thing, it would only call the handler if a request to that virtual host was the first request for that child. Assuming it works; I'd think this would be a good canidate for a case that's never been tested before, due to the fact that it would not call the handler if the request that initiated the child was not to that virtual host... It would fail to work in all cases if Apache does not recognize what triggered the child until after child init. Looking over pages 59 through 61, 72 and 73, this appears to me to be the case. Yes, it does explicitly say that it's ok in virtual host blocks, but it doesn't say it works. Ed
Re: PerlChildInitHandler doesn't work inside VirtualHost?
(I found a better way to do what I wanted, avoiding PerlChildInitHandler completely, but still...) My reason for wanting PerlChildInitHandler (and PerlChildExitHandler) inside VirtualHost is to be able to keep these declarations close to the PerlHandlers that rely on them. I like to put my VirtualHost conf sections inside separate Include config files so that I can leave the main httpd.conf fairly static. If ChildInitHandler is not allowed inside VirtualHost, it should generate an exception when the config file is parsed. Instead, it silently ignores the declaration. -Jason Cees Hek wrote: >Quoting Jason W May <[EMAIL PROTECTED]>: > > > >>Running mod_perl 1.26 on Apache 1.3.24. >> >>I've found that if I place my PerlChildInitHandler inside a VirtualHost >>block, it is never called. >> >> > >It doesn't really make sense to put a PerlChildInitHandler inside a VirtualHost >directive. It is only called when the Apache Child process is created, not when >a new request comes in. > >If you explain what you are trying to accomplish, maybe we can recommend a >better Handler to tie into. > >Cees > >
Re: PerlChildInitHandler doesn't work inside VirtualHost?
On Aug 09, 2002 at 12:16:45 +1000, Cees Hek wrote: > Quoting Jason W May <[EMAIL PROTECTED]>: > > Running mod_perl 1.26 on Apache 1.3.24. > > > > I've found that if I place my PerlChildInitHandler inside a VirtualHost > > block, it is never called. > > It doesn't really make sense to put a PerlChildInitHandler > inside a VirtualHost directive. Why? The Eagle book says this is a perfectly valid concept. --rick
Re: PerlChildInitHandler doesn't work inside VirtualHost?
Quoting Jason W May <[EMAIL PROTECTED]>: > > Running mod_perl 1.26 on Apache 1.3.24. > > I've found that if I place my PerlChildInitHandler inside a VirtualHost > block, it is never called. It doesn't really make sense to put a PerlChildInitHandler inside a VirtualHost directive. It is only called when the Apache Child process is created, not when a new request comes in. If you explain what you are trying to accomplish, maybe we can recommend a better Handler to tie into. Cees
PerlChildInitHandler doesn't work inside VirtualHost?
Running mod_perl 1.26 on Apache 1.3.24. I've found that if I place my PerlChildInitHandler inside a VirtualHost block, it is never called. This works: ... PerlModule Foo PerlChildInitHandlerFoo::handler ... PerlHandler MyModule ... but this doesn't: PerlModule Foo PerlChildInitHandlerFoo::handler ... PerlHandler MyModule I don't see why VirtualHost would make a difference for child-init handlers. What else could I be doing wrong? Thanks, -Jason
Re: PerlChildInitHandler not being called
On Thu, 11 Jan 2001, Doug MacEachern wrote: > On Tue, 2 Jan 2001, Paul J. Lucas wrote: > > > I looked in the archives for this problem and, while mentioned, > > not definitive solution was apparantly found. I did notice the > > handler get called once, but only once: total server shutowns > > and restarts don't make it get called. > > > > I'm using Apache 1.3.12, mod_perl 1.24_01, Perl 5.6 under Linux. [ snip ] > looks like it works fine. Actually, I played with it some more and it turns out that that a PerlChildInitHandler directive doesn't work inside a VirtualHost block. - Paul
Re: PerlChildInitHandler not being called
On Tue, 2 Jan 2001, Paul J. Lucas wrote: > I looked in the archives for this problem and, while mentioned, > not definitive solution was apparantly found. I did notice the > handler get called once, but only once: total server shutowns > and restarts don't make it get called. > > I'm using Apache 1.3.12, mod_perl 1.24_01, Perl 5.6 under Linux. the distribution test suite has a ChildInitHandler that does this: $s->warn("[notice] child_init for process $$, report any problems to $sa\n"); % make start_httpd_fork % grep 'child_init for process' t/logs/error_log | wc -l 5 % echo > t/logs/error_log % kill -HUP `cat t/logs/httpd.pid ` % grep 'child_init for process' t/logs/error_log | wc -l 5 % echo > t/logs/error_log % kill -USR1 `cat t/logs/httpd.pid ` % grep 'child_init for process' t/logs/error_log | wc -l 5 % make kill_httpd looks like it works fine. also using 5.6.0, linux, apache 1.3.15-dev, mod_perl-1.24_02-dev. if you could try the above and/or provide a small test case that breaks, i'll have a look.
PerlChildInitHandler not being called
I looked in the archives for this problem and, while mentioned, not definitive solution was apparantly found. I did notice the handler get called once, but only once: total server shutowns and restarts don't make it get called. I'm using Apache 1.3.12, mod_perl 1.24_01, Perl 5.6 under Linux. - Paul
PerlChildInitHandler not being called
I looked int he archives for this problem and, while mentioned, not definitive solution was apparantly found. I did notice the handler get called once, but only once: total server shutowns and restarts don't make it get called. I'm using Apache 1.3.12, mod_perl 1.24_01, Perl 5.6 under Linux. - Paul
Re: PerlChildInitHandler
> Hi! > > > > Is it possible to pass variables defined with PerlSetVar to a > > > PerlChildInitHandler ? > > > If not, is there any other way to define variables in such a handler than > > > hardcoding values into the .pm? > > > > You can use Apache->server->dir_config() to access per-server config > > variables. > This doesn't work: > Can't locate object method "dir_config" via package "Apache::Server" > > I have tried > Apache->server->dir_config() > and > $s=Apache->server; > $s->dir_config; > > Am I using an old version of mod_perl? > Perl version 5.00404 for Apache/1.3.9 (Unix) mod_perl/1.21 Yes, this feature was added in mod_perl 1.21_01 -- Eric
Re: PerlChildInitHandler
> Hi! > > Is it possible to pass variables defined with PerlSetVar to a > PerlChildInitHandler ? > If not, is there any other way to define variables in such a handler than > hardcoding values into the .pm? You can use Apache->server->dir_config() to access per-server config variables. -- Eric
PerlChildInitHandler
Hi! Is it possible to pass variables defined with PerlSetVar to a PerlChildInitHandler ? If not, is there any other way to define variables in such a handler than hardcoding values into the .pm? domm htpp://domm.zsi.at
Re: PerlChildInitHandler
> "Sean" == Sean Chittenden <[EMAIL PROTECTED]> writes: Sean> Lol! I ripped that right out of Apache::Status. Any ideas as to Sean> whether or not its faster with map or push? I may, desire dependent, Sean> benchmark the two formats and report the results. Sean> It looks to me like the reason Doug did the code the way he did Sean> was because he returns an array ref to the calling sub. --SC It's probably more of a style thing. I like "map" because I had a lot of practice with Lispy-stuff in my history. Maybe doug prefers the the other. TIMTWOTDI. As for the array ref, this is easy: return ["", (map ...), ""]; :-) -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
Re: PerlChildInitHandler
Nope. I'm not seeing it initialised. nothing in my logs... I _COULD_ do it in startup but it would defeat purpose. I'm building persistant database connections with mySQL and Apache::DBI from everything I've read and deduced, optimally EACH CHILD should be opening a localised persistant database connection (and leaving any scripts run under the child to have access to $dbh database handler) To do this I need the $DBH to be opened, or at the least, initialised, when the Child starts up. Consequently, I really need to get the ChildInitHandlers working =) -brendan - Brendan W. McAdams| email: [EMAIL PROTECTED] Programmer/Systems Administrator | office: (305)377-2880 Plexus InterActive| pager: (305)277-4879 http://www.plexmedia.com | cell phone: (305)401-7313 "Always listen to the experts - they'll tell you what can't be done and why. Then do it." -Robert A. Heinlein - Original Message - From: "Sean Chittenden" <[EMAIL PROTECTED]> To: "Brendan W. McAdams" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, February 14, 2000 12:33 PM Subject: Re: PerlChildInitHandler It's a bit harsh, but I'd try something like this just for kicks to make sure I can get access to the requested Handler. # In httpd.conf PerlModule DieOnInit # In DieOnInit package package DieOnInit; sub handler { warn "Child $$ is going to die in 20 seconds"; sleep(20); # Prevents children from constantly dying and filling up the # error logs die "Child dead: $$"; } 1; #-- End package I have a variation of this module lying around someplace that provides me with a sanity check with regards to programming. If the child dies, then the code is executed and I can plop in my ___ number of lines of code that weren't being executed earlier. This kind of approach is pretty top-down, but works when setting apache up... I've had a few instances where the child _wasn't_ dying because of a config problem farther up in the conf file. At any rate, let me know if the handler isn't being executed... and what you're trying to execute for that matter. Could you use a PerlRequire directive and place your init stuff in there? --SC On Mon, 14 Feb 2000, Brendan W. McAdams wrote: > Date: Mon, 14 Feb 2000 12:25:30 -0500 > From: Brendan W. McAdams <[EMAIL PROTECTED]> > To: Sean Chittenden <[EMAIL PROTECTED]> > Cc: [EMAIL PROTECTED] > Subject: Re: PerlChildInitHandler > > Yup. > (I knew i did since i compiled with EVERYTHING=1). > > > All handlers lists as Enabled when this script is run. > > So ... whats the next step in debugging here? > > -brendan > - > Brendan W. McAdams| email: [EMAIL PROTECTED] > Programmer/Systems Administrator | office: (305)377-2880 > Plexus InterActive| pager: (305)277-4879 > http://www.plexmedia.com | cell phone: (305)401-7313 > > > "Always listen to the experts - they'll tell you what can't be done and why. > Then do it." > -Robert A. Heinlein > - Original Message - > From: "Sean Chittenden" <[EMAIL PROTECTED]> > To: "Brendan W. McAdams" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Monday, February 14, 2000 12:17 PM > Subject: Re: PerlChildInitHandler > > > Check to make sure that you compiled in the Init and Exit handlers > into mod_perl. > > If you include the following code in a script, you should be able > to figure this out really quick: > > require mod_perl; > require mod_perl_hooks; > my @retval = qw(); > my @list = mod_perl::hooks(); > for my $hook (sort @list) { > my $on_off = > mod_perl::hook($hook) ? "Enabled" : "Disabled"; > push @retval, "$hook$on_off\n"; > } > push @retval, qw(); > > print @retval; > > > Credit goes to Doug MacEachern on the code. Stick that chunket of > code in a script and it should let you know what you have available and > what you don't. ;) --SC > > > On Mon, 14 Feb 2000, Brendan W. McAdams wrote: > > > Date: Mon, 14 Feb 2000 12:02:45 -0500 > > From: Brendan W. McAdams <[EMAIL PROTECTED]> > > To: [EMAIL PROTECTED] > > Subject: PerlChildInitHandler > > > > I'm having trouble getting apache to even recognise the existance of > > PerlChildInitHandler ( and childexithandler it seems as well) . > > > > I've tried declaring my PerlChildInitHandler inside a VirtualHost, in the > > main body of the config, and as a push_handler in my startup file [whi
Re: PerlChildInitHandler
Lol! I ripped that right out of Apache::Status. Any ideas as to whether or not its faster with map or push? I may, desire dependent, benchmark the two formats and report the results. It looks to me like the reason Doug did the code the way he did was because he returns an array ref to the calling sub. --SC PS CGI.pm does not reside on my system because of it's HTML generation capabilities (and the consiquent memory bloat). ;) On 14 Feb 2000, Randal L. Schwartz wrote: > Date: 14 Feb 2000 09:35:06 -0800 > From: Randal L. Schwartz <[EMAIL PROTECTED]> > To: Sean Chittenden <[EMAIL PROTECTED]> > Cc: Brendan W. McAdams <[EMAIL PROTECTED]>, [EMAIL PROTECTED] > Subject: Re: PerlChildInitHandler > > >>>>> "Sean" == Sean Chittenden <[EMAIL PROTECTED]> writes: > > Sean> Check to make sure that you compiled in the Init and Exit handlers > Sean> into mod_perl. > > Sean> If you include the following code in a script, you should be able > Sean> to figure this out really quick: > > Sean> require mod_perl; > Sean> require mod_perl_hooks; > Sean> my @retval = qw(); > Sean> my @list = mod_perl::hooks(); > Sean> for my $hook (sort @list) { > Sean> my $on_off = > Sean> mod_perl::hook($hook) ? "Enabled" : "Disabled"; > Sean> push @retval, "$hook$on_off\n"; > Sean> } > Sean> push @retval, qw(); > > Sean> print @retval; > > Ewww... Too many pushes. :) > > require mod_perl; > require mod_perl_hooks; > print "", > (map { > "", $_, "", > (mod_perl::hook($_) ? "Enabled" : "Disabled"), > "\n" } mod_perl::hooks()), > ""; > > map is your friend. Of course, this would have been even simpler with > CGI.pm HTML generators. :) > > -- Sean Chittenden [EMAIL PROTECTED] (408)530-0001
Re: PerlChildInitHandler
> "Sean" == Sean Chittenden <[EMAIL PROTECTED]> writes: Sean> Check to make sure that you compiled in the Init and Exit handlers Sean> into mod_perl. Sean> If you include the following code in a script, you should be able Sean> to figure this out really quick: Sean> require mod_perl; Sean> require mod_perl_hooks; Sean> my @retval = qw(); Sean> my @list = mod_perl::hooks(); Sean> for my $hook (sort @list) { Sean> my $on_off = Sean> mod_perl::hook($hook) ? "Enabled" : "Disabled"; Sean> push @retval, "$hook$on_off\n"; Sean> } Sean> push @retval, qw(); Sean> print @retval; Ewww... Too many pushes. :) require mod_perl; require mod_perl_hooks; print "", (map { "", $_, "", (mod_perl::hook($_) ? "Enabled" : "Disabled"), "\n" } mod_perl::hooks()), ""; map is your friend. Of course, this would have been even simpler with CGI.pm HTML generators. :) -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
Re: PerlChildInitHandler
It's a bit harsh, but I'd try something like this just for kicks to make sure I can get access to the requested Handler. # In httpd.conf PerlModule DieOnInit # In DieOnInit package package DieOnInit; sub handler { warn "Child $$ is going to die in 20 seconds"; sleep(20); # Prevents children from constantly dying and filling up the # error logs die "Child dead: $$"; } 1; #-- End package I have a variation of this module lying around someplace that provides me with a sanity check with regards to programming. If the child dies, then the code is executed and I can plop in my ___ number of lines of code that weren't being executed earlier. This kind of approach is pretty top-down, but works when setting apache up... I've had a few instances where the child _wasn't_ dying because of a config problem farther up in the conf file. At any rate, let me know if the handler isn't being executed... and what you're trying to execute for that matter. Could you use a PerlRequire directive and place your init stuff in there? --SC On Mon, 14 Feb 2000, Brendan W. McAdams wrote: > Date: Mon, 14 Feb 2000 12:25:30 -0500 > From: Brendan W. McAdams <[EMAIL PROTECTED]> > To: Sean Chittenden <[EMAIL PROTECTED]> > Cc: [EMAIL PROTECTED] > Subject: Re: PerlChildInitHandler > > Yup. > (I knew i did since i compiled with EVERYTHING=1). > > > All handlers lists as Enabled when this script is run. > > So ... whats the next step in debugging here? > > -brendan > - > Brendan W. McAdams| email: [EMAIL PROTECTED] > Programmer/Systems Administrator | office: (305)377-2880 > Plexus InterActive| pager: (305)277-4879 > http://www.plexmedia.com | cell phone: (305)401-7313 > > > "Always listen to the experts - they'll tell you what can't be done and why. > Then do it." > -Robert A. Heinlein > - Original Message - > From: "Sean Chittenden" <[EMAIL PROTECTED]> > To: "Brendan W. McAdams" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Monday, February 14, 2000 12:17 PM > Subject: Re: PerlChildInitHandler > > > Check to make sure that you compiled in the Init and Exit handlers > into mod_perl. > > If you include the following code in a script, you should be able > to figure this out really quick: > > require mod_perl; > require mod_perl_hooks; > my @retval = qw(); > my @list = mod_perl::hooks(); > for my $hook (sort @list) { > my $on_off = > mod_perl::hook($hook) ? "Enabled" : "Disabled"; > push @retval, "$hook$on_off\n"; > } > push @retval, qw(); > > print @retval; > > > Credit goes to Doug MacEachern on the code. Stick that chunket of > code in a script and it should let you know what you have available and > what you don't. ;) --SC > > > On Mon, 14 Feb 2000, Brendan W. McAdams wrote: > > > Date: Mon, 14 Feb 2000 12:02:45 -0500 > > From: Brendan W. McAdams <[EMAIL PROTECTED]> > > To: [EMAIL PROTECTED] > > Subject: PerlChildInitHandler > > > > I'm having trouble getting apache to even recognise the existance of > > PerlChildInitHandler ( and childexithandler it seems as well) . > > > > I've tried declaring my PerlChildInitHandler inside a VirtualHost, in the > > main body of the config, and as a push_handler in my startup file [which > is, > > i know for a fact, being execed]. > > > > no matter what I try, apache is compeltely ignoring this directive. > > I've put write to log when initialised traps in the modules that are being > > handled on init and they never trip. > > > > I've tried this with both Apache 1.39/modperl1.19 and Apache > > 1.311/modperl1.21 and no luck > > Any assistance would be greatly appreciated. > > > > Brendan > > - > > Brendan W. McAdams| email: [EMAIL PROTECTED] > > Programmer/Systems Administrator | office: (305)377-2880 > > Plexus InterActive| pager: (305)277-4879 > > http://www.plexmedia.com | cell phone: (305)401-7313 > > > > > > "Always listen to the experts - they'll tell you what can't be done and > why. > > Then do it." > > -Robert A. Heinlein > > > > > > -- > Sean Chittenden > [EMAIL PROTECTED] > (408)530-0001 > > > -- Sean Chittenden [EMAIL PROTECTED] (408)530-0001
Re: PerlChildInitHandler
Yup. (I knew i did since i compiled with EVERYTHING=1). All handlers lists as Enabled when this script is run. So ... whats the next step in debugging here? -brendan - Brendan W. McAdams| email: [EMAIL PROTECTED] Programmer/Systems Administrator | office: (305)377-2880 Plexus InterActive| pager: (305)277-4879 http://www.plexmedia.com | cell phone: (305)401-7313 "Always listen to the experts - they'll tell you what can't be done and why. Then do it." -Robert A. Heinlein - Original Message - From: "Sean Chittenden" <[EMAIL PROTECTED]> To: "Brendan W. McAdams" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, February 14, 2000 12:17 PM Subject: Re: PerlChildInitHandler Check to make sure that you compiled in the Init and Exit handlers into mod_perl. If you include the following code in a script, you should be able to figure this out really quick: require mod_perl; require mod_perl_hooks; my @retval = qw(); my @list = mod_perl::hooks(); for my $hook (sort @list) { my $on_off = mod_perl::hook($hook) ? "Enabled" : "Disabled"; push @retval, "$hook$on_off\n"; } push @retval, qw(); print @retval; Credit goes to Doug MacEachern on the code. Stick that chunket of code in a script and it should let you know what you have available and what you don't. ;) --SC On Mon, 14 Feb 2000, Brendan W. McAdams wrote: > Date: Mon, 14 Feb 2000 12:02:45 -0500 > From: Brendan W. McAdams <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: PerlChildInitHandler > > I'm having trouble getting apache to even recognise the existance of > PerlChildInitHandler ( and childexithandler it seems as well) . > > I've tried declaring my PerlChildInitHandler inside a VirtualHost, in the > main body of the config, and as a push_handler in my startup file [which is, > i know for a fact, being execed]. > > no matter what I try, apache is compeltely ignoring this directive. > I've put write to log when initialised traps in the modules that are being > handled on init and they never trip. > > I've tried this with both Apache 1.39/modperl1.19 and Apache > 1.311/modperl1.21 and no luck > Any assistance would be greatly appreciated. > > Brendan > - > Brendan W. McAdams| email: [EMAIL PROTECTED] > Programmer/Systems Administrator | office: (305)377-2880 > Plexus InterActive| pager: (305)277-4879 > http://www.plexmedia.com | cell phone: (305)401-7313 > > > "Always listen to the experts - they'll tell you what can't be done and why. > Then do it." > -Robert A. Heinlein > > -- Sean Chittenden [EMAIL PROTECTED] (408)530-0001
Re: PerlChildInitHandler
Check to make sure that you compiled in the Init and Exit handlers into mod_perl. If you include the following code in a script, you should be able to figure this out really quick: require mod_perl; require mod_perl_hooks; my @retval = qw(); my @list = mod_perl::hooks(); for my $hook (sort @list) { my $on_off = mod_perl::hook($hook) ? "Enabled" : "Disabled"; push @retval, "$hook$on_off\n"; } push @retval, qw(); print @retval; Credit goes to Doug MacEachern on the code. Stick that chunket of code in a script and it should let you know what you have available and what you don't. ;) --SC On Mon, 14 Feb 2000, Brendan W. McAdams wrote: > Date: Mon, 14 Feb 2000 12:02:45 -0500 > From: Brendan W. McAdams <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: PerlChildInitHandler > > I'm having trouble getting apache to even recognise the existance of > PerlChildInitHandler ( and childexithandler it seems as well) . > > I've tried declaring my PerlChildInitHandler inside a VirtualHost, in the > main body of the config, and as a push_handler in my startup file [which is, > i know for a fact, being execed]. > > no matter what I try, apache is compeltely ignoring this directive. > I've put write to log when initialised traps in the modules that are being > handled on init and they never trip. > > I've tried this with both Apache 1.39/modperl1.19 and Apache > 1.311/modperl1.21 and no luck > Any assistance would be greatly appreciated. > > Brendan > - > Brendan W. McAdams| email: [EMAIL PROTECTED] > Programmer/Systems Administrator | office: (305)377-2880 > Plexus InterActive| pager: (305)277-4879 > http://www.plexmedia.com | cell phone: (305)401-7313 > > > "Always listen to the experts - they'll tell you what can't be done and why. > Then do it." > -Robert A. Heinlein > > -- Sean Chittenden [EMAIL PROTECTED] (408)530-0001
PerlChildInitHandler
I'm having trouble getting apache to even recognise the existance of PerlChildInitHandler ( and childexithandler it seems as well) . I've tried declaring my PerlChildInitHandler inside a VirtualHost, in the main body of the config, and as a push_handler in my startup file [which is, i know for a fact, being execed]. no matter what I try, apache is compeltely ignoring this directive. I've put write to log when initialised traps in the modules that are being handled on init and they never trip. I've tried this with both Apache 1.39/modperl1.19 and Apache 1.311/modperl1.21 and no luck Any assistance would be greatly appreciated. Brendan - Brendan W. McAdams| email: [EMAIL PROTECTED] Programmer/Systems Administrator | office: (305)377-2880 Plexus InterActive| pager: (305)277-4879 http://www.plexmedia.com | cell phone: (305)401-7313 "Always listen to the experts - they'll tell you what can't be done and why. Then do it." -Robert A. Heinlein
question about PerlChildInitHandler & PerlChildExitHandler
Hello, Are there some similar directives for the threads on NT ? The problem I run into is on UNIX, I open sockets during PerlChildInitHandler and close the sockets during PerlChildInitHandler phase, but when I try to port my code to NT platform, I don't know how to do it. Does anyone know any documents or web sites I can refer to regarding NT mod_perl environment ? Thanks, Huan
PerlChildInitHandler called twice on startup?
How many times is PerlChildInitHandler suposed to be called on child startup? On my server startup (under httpd -X as well) I see two calls to it. I have wrapped my code so it does not do the initailization twice now but this kind of caught me by suprise. With a carp in my anonymous handler I see the following. PerlChildInitHandler called. at /dev/null line 0 First connect site eSite=HASH(0x81f73c4). PerlChildInitHandler called. DynaLoader::__ANON__('Apache=SCALAR(0x8507740)') called at /dev/null line 0 eval {...} called at /dev/null line 0 First connect site eSite=HASH(0x8546018). -- Owen
Re: PerlChildInitHandler called twice for a child?
> "G" == G W Haywood <[EMAIL PROTECTED]> writes: G> Hi there, G> On Fri, 17 Dec 1999 08:43:43 -0700 Owen Stenseth mentioned: >> On my server startup (under httpd -X as well) I see two calls to >> it. I have wrapped my code so it does not do the initailization >> twice now but this kind of caught me by suprise. G> Now it's funny you should say that. G> What version of Perl are you using? Everything is done twice during server startup. This ensures very early that the server will *restart* when SIGHUP'ed. I believe there's a callback to Apache->something to see which state it really is in. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
Re: PerlChildInitHandler called twice for a child?
Hi there, On Fri, 17 Dec 1999 08:43:43 -0700 Owen Stenseth mentioned: > On my server startup (under httpd -X as well) I see two calls to > it. I have wrapped my code so it does not do the initailization > twice now but this kind of caught me by suprise. Now it's funny you should say that. What version of Perl are you using? 73 Ged.
PerlChildInitHandler called twice for a child?
How many times is PerlChildInitHandler suposed to be called on child startup? On my server startup (under httpd -X as well) I see two calls to it. I have wrapped my code so it does not do the initailization twice now but this kind of caught me by suprise. With a carp in my anonymous handler I see the following. PerlChildInitHandler called. at /dev/null line 0 First connect site eSite=HASH(0x81f73c4). PerlChildInitHandler called. DynaLoader::__ANON__('Apache=SCALAR(0x8507740)') called at /dev/null line 0 eval {...} called at /dev/null line 0 First connect site eSite=HASH(0x8546018). -- Owen