Bug #17558 Updated: pcntl_signal() does not call user-defined function handler

From: Date: Mon, 08 Jul 2002 01:00:30 +0000
Subject: Bug #17558 Updated: pcntl_signal() does not call user-defined function handler
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-13444@lists.php.net to get a copy of this message
ID: 17558 Updated by: sniper@php.net Reported By: clay@killersoft.com -Status: Open +Status: Feedback -Bug Type: Unknown/Other Function +Bug Type: *Extensibility Functions Operating System: Mac OS X PHP Version: 4.2.1 New Comment: Does this happen with the latest snapshot: http://snaps.php.net/php4-latest.tar.gz Previous Comments: ------------------------------------------------------------------------ [2002-06-01 23:27:52] clay@killersoft.com function: pcntl_signal() problem: If "handler" argument is set to a user-defined function, that function is never called. script: (taken from www.php.net/pcntl_signal) <?php // signal handler function function sig_handler($signo) { echo "We hit the sig_handler!\n"; switch($signo) { case SIGTERM: // handle shutdown tasks exit; break; case SIGHUP: // handle restart tasks break; case 1: print "Caught sig 1 ...\n"; break; case SIGUSR1: print "Caught SIGUSR1...\n"; break; default: // handle all other signals } } print "Installing signal handler...\n"; // setup signal handlers pcntl_signal(SIGTERM, "sig_handler"); pcntl_signal(SIGHUP, "sig_handler"); pcntl_signal(SIGUSR1, "sig_handler"); print "Generating signal SIGTERM to self...\n"; // send SIGUSR1 to current process id posix_kill(posix_getpid(), SIGUSR1); print "Done\n" ?> The "we hit the sig handler!" echo never appears ... thus I suspect it's never being called. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=17558&edit=1

« previous php.bugs (#13444) next »