Signal Uncaught
Jie PAN <jpan-/[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi all.
I tried to write some scirpts in php, and met a problem while using lighttpd with mod_fastcgi. Here's the code below:
---------------------------------------------------
<?php
declare(ticks = 1);
function sig_handler($signo)
{
echo "Caught signal...\n";
}
echo "Installing signal handler...\n";
pcntl_signal(SIGUSR1, "sig_handler", FALSE);
echo"Generating signal SIGTERM to self...\n";
echo posix_getpid();
posix_kill(posix_getpid(), SIGUSR1);
echo "Done\n"
?>
---------------------------------------------------
The issue is, the signal could only be caught for the first time, and then always failed until lighttpd was restarted. If I switched mod_fastcgi to mod_cgi in lighttpd.conf, the signal could be caught everytime without problem. I'm using lighttpd 1.4.20 & php 5.2.6 with default configuration.
Thanks in advance.