problem using signal module

Ken Guest kwg at renre-europe.com
Fri Aug 24 05:17:00 EDT 2001


Using Python 1.52 for hysterical raisens, I'm trying to 
set up a handler to intercept the KILL signal on a RedHat Linux
box.

In the code I have:

import signal 

def handler(signo, frame):
        print signo

if __name__ == '__main__':
        port = 8000
	#straight from the Python Standard Library book...
        signal.signal(signal.SIGKILL, handler)

But this raises the following exception:

  File "./compassxmlrpcserver.py", line 128, in ?
    signal.signal(signal.SIGKILL, handler)
RuntimeError: (22, 'Invalid argument')


Anyone know what I'm doing wrong?

k.





More information about the Python-list mailing list