【发布时间】:2021-06-16 08:15:33
【问题描述】:
我想注册一个自定义信号处理程序,它会做一些事情,然后继续正常的信号处理,特别是针对 SIGTERM 信号。
Python 没有注册 SIGTERM 处理程序 (Python: What is the default handling of SIGTERM?),那么在我进行自己的自定义处理后,如何继续操作系统的正常 SIGTERM 处理?
def my_handler(self, signum, frame):
do_something()
# What do I do here to raise to the OS?
signal.signal(signal.SIGTERM, my_handler)
【问题讨论】: