SIGCHLD signal handling

Donn Cave donn at
Mon Sep 4 18:07:02 CEST 2000

Quoth Olaf Meyer <olaf.meyer at>:
| I'm having some problems with the SIGCHLD signal on HP-UX 11.
| When I start a child process from a python program via fork and execvp
| the child process does not terminate when I sind a KILL signal to it.
| It turns into a zombie and only dies after the parent process
| (the python program) terminates.
| The problem is related to the signal handler (sysV signal style). I've
| had the same problems in perl but was able to resolve it by installing
| a POSIX style (aka recursive) signal handler for the SIGCHLD signal.
| Unfortuntely this does not work with python.

As already mentioned in another followup, you need to call the
posix waitpid() function to reap the child process.  Perhaps you
can do that right after kill(), and dispense with the SIGCHLD
handling altogether.

	Donn Cave, donn at
| I've tried the following, but it does not work :-(
|   import signal
|   global SigHandler
|   def SigHandler(signo, stackFrame):
|       signal.signal(signo, SigHandler)
|   signal.signal(signal.SIGCHLD, SigHandler)
| Are there any solutions to this problem? I'm thankful for any hints :-)

More information about the Python-list mailing list