Python signal delivery under BSD 4.4

Elf M. Sternberg elf at drizzle.com
Tue Aug 12 17:57:51 EDT 2003


I'm having a devil of a time with signal handling under BSD 4.4 with
Python and I was hoping that this might ring a bell with someone.  Using
the Webware Application Server (a multi-threaded Python application), I
fork off a process to run independently and do some heavy-duty multi-
threaded I/O churning.  The process is launched with os.spawnvp().

        The user may, at any time, elect to terminate this process
before it reaches its end.  I do that by having the Application Server
send a SIGUSR1 signal to the process ID returned by os.spawnvp(), which
so far has been reliably returned and stored in the appserver's session
mananger.  So far, so good.

        This worked well under Python 2.1, where I used os.fork() instead
of os.spawnvp().

        We have upgraded to Python 2.2.3 and it has mysteriously stopped
working.  Processes launched off the appserver, whether using os.fork()
or os.spawnvp(), are now completely deaf to signals.  Nothing gets its
attention except, of course, SIGKILL.  Not when sent from the appserver,
and not when sent from the shell, not even by root.

        If the process is launched from the command line, however, it
is well-behaved and responds to signal reliably. 

        What gives?




More information about the Python-list mailing list