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 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