def is_running(self, keyword=None): """ Check to see if this managed daemon is running or not. """ pid = self.get_pid() if pid: # Do an advanced check on pid. return ProcessCheck.is_running(pid, keyword) else: # No PID at all. Not running. return False
def is_running(self): """ Check to see if the supervisor is still running. """ pidfile = self._get_pid_path() if os.path.exists(pidfile): fp = open(pidfile, 'r') pid = int(fp.read()) fp.close() return ProcessCheck.is_running(pid, 'pm-supervisor') else: return False