In python 2.6 under Linux, I can use the following to handle a TERM signal:
import signal
def handleSigTERM():
shutdown()
signal.signal(signal.SIGTERM, handleSigTERM)
Is there any way to setup a handler for all signals received by the process, other than just setting them up one-at-a-time?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…