On Fri, 9 Mar 2001, Richard Chen wrote:

> This is pretty weird situation. I have installed a signal
> handler in startup.pl which showed that the signal is
> delivered to a different process!
>
> Here are the demo files:
>
> $ cat conf/startup.pl
> #!/usr/local/bin/perl
> use lib '/usr/local/apache/modules';
> $SIG{USR2}=sub {
>         print STDERR "Received USR2 signal:\n";
>         print STDERR "In SIG, pid=$$, ppid=".getppid()."\n";
> };
>
> # cat /usr/local/apache/modules/Apache/ChildInit.pm
> package Apache::ChildInit;
> sub handler {
>         print STDERR "In ChildInit, pid=$$, ppid=".getppid()."\n";
>         return;
> }
> 1;
>
> In httpd.conf I have these 2 lines added:
>       PerlRequire conf/startup.pl
>       PerlChildInitHandler Apache::ChildInit
>
> After launching the modperl process we have:
>
> $ ps -ef|grep http|grep root
> root      5964     1  0 16:17 ?        00:00:00 /usr/local/apache/bin/httpd
>
> $ tail -1 error_log
> In ChildInit, pid=5965, ppid=5964
>
> So the modperl parent process has pid 5964.
> After sending USR2 signal to the modperl parent process,
> these lines appear in the error_log file:
>       Received USR2 signal:
>       In SIG, pid=5963, ppid=1
>
> So the signal is delivered to the process 5963 instead of the correct 5964.
>
> Has anyone seen this before?
> Is this a bug in modperl or if the procedure for installing the handler
> is incorrect?

I think that it has nothing to with mod_perl, it's the OS that handles
pizza^H^H^H^H^Hsignal deliveries.

BTW, what kind of process 5963 was? How come that if it wasn't the httpd
process you have installed the signal handler in, it knew to print the
stuff to the error_log which it has never opened? looks like you are not
getting the parent process pid correctly.

You also didn't tell, how did you send the signal.


>
> I used
>       Apache/1.3.17 (Unix) mod_perl/1.25 mod_ssl/2.8.0 OpenSSL/0.9.6
> on a linux 6.1 box.
>
> Thanks for any info.
>
> Richard
>



_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Reply via email to