1、示例:

def main(argv):
    ......................
    for sig in (signal.SIGTERM, signal.SIGINT):
        signal.signal(sig, shutdown_signal)
def shutdown_signal(signum, frame):
    """
    关闭掉整个进程
    :param signum:
    :param frame:
    :return:
    """
    LOG.warning("shutting down, got signal %d", signum)

  

2、信号

SIGINT

SIGTERM

SIGKILL

SIGALRM

 

posted on 2015-04-16 14:37  充实自己  阅读(254)  评论(0编辑  收藏  举报