hot-restarter.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:ambassador 作者: datawire 项目源码 文件源码
def force_kill_all_children():
  """ Iterate through all known child processes and force kill them. In the future we might consider
      possibly giving the child processes time to exit but this is fine for now. If someone force kills
      us and does not clean the process tree this will leave child processes around unless they choose
      to end themselves if their parent process dies. """

  # First uninstall the SIGCHLD handler so that we don't get called again.
  signal.signal(signal.SIGCHLD, signal.SIG_DFL)

  global pid_list
  for pid in pid_list:
    print ("force killing PID={}".format(pid))
    try:
      os.kill(pid, signal.SIGKILL)
    except:
      print ("error force killing PID={} continuing".format(pid))

  pid_list = []
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号