Signal.py
540 Bytes
import signal
def initSignals(dispatcher):
def signalHandler(num, frame):
#signal.signal(num, signal.SIG_IGN)
dispatcher.shutdown()
signal.signal(signal.SIGTERM, signalHandler)
signal.signal(signal.SIGINT, signalHandler)
signal.signal(signal.SIGQUIT, signalHandler)
signal.signal(signal.SIGABRT, signalHandler)
signal.signal(signal.SIGHUP, signal.SIG_IGN)
signal.signal(signal.SIGALRM, signal.SIG_IGN)
signal.signal(signal.SIGURG, signal.SIG_IGN)
# vim: set ft=python et ts=8 sw=4 sts=4: