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(<table>);
>     my @list = mod_perl::hooks();
>     for my $hook (sort @list) {
>         my $on_off =
>           mod_perl::hook($hook) ? "<b>Enabled</b>" : "<i>Disabled</i>";
>         push @retval, "<tr><td>$hook</td><td>$on_off</td></tr>\n";
>     }
>     push @retval, qw(</table>);
> 
>     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

Reply via email to