process.py 文件源码

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

项目:clusterfuzz-tools 作者: google 项目源码 文件源码
def kill_last_pid():
  """Kill the last pid. See:
    https://github.com/google/clusterfuzz-tools/issues/299"""
  # We have found that, when invoking `sv stop python-daemon`, the process
  # in call() isn't killed. Therefore, we need to explicitly kill it and
  # all of its children.
  #
  # We hope that pid recycling is not that fast.
  try:
    with open(LAST_PID_FILE, 'r') as f:
      pid = int(f.read().strip())
      os.killpg(pid, signal.SIGKILL)
  except:  # pylint: disable=bare-except
    pass
  finally:
    try:
      os.remove(LAST_PID_FILE)
    except:  # pylint: disable=bare-except
      pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号