def _get_current_pid(self):
    """Get the process ID of any currently running daemon process.  Returns
    None if no process is running.
    """
    current_pid = None
    if self.lockfile.is_locked():
      current_pid = self.lockfile.read_pid()
      if current_pid is not None:
        try:
          # A 0 signal will do nothing if the process exists.
          os.kill(current_pid, 0)
        except __HOLE__, exc:
          if exc.errno == errno.ESRCH:
            # PID file was stale, delete it.
            current_pid = None
            self.lockfile.break_lock()

    return current_pid
dataset/ETHPy150Open viewfinderco/viewfinder/backend/base/daemon.py/DaemonManager._get_current_pid