Entry
How can I create a 'catch all' way to catch all possible signals?
Aug 29th, 2002 00:14
Peter Funk, Joćo Prado Maia,
On unixoid operating systems (AIX, Linux, SunOS, ...) there is
a special signal called SIGKILL, which can't be catched at all.
With the exception of this you can try the following:
import signal, os
def mysignal_handler(signum, frame):
print 'Signal handler called with signal', signum
for signum in range(signal.SIGHUP, signal.NSIG-1):
if signum != signal.SIGKILL:
signal.signal(signum, mysignal_handler)