def watchdog(self): # Watchdog wait for event core_start_ready before starting Events.core_start_ready.wait() log.debug('Core: watchdog will now start') while True: # TODO Use ping to core_client # TODO Try to use self.process to check if running if not test_already_running(CORE_PID_PATH, CORE_BINARY_FILENAME): self.start() gevent.sleep(CORE_WATCHDOG_PERIOD)
def stop_by_pid(self): pid = test_already_running(CORE_PID_PATH, CORE_BINARY_FILENAME) if pid: os.kill(pid, signal.SIGTERM) log.debug('Core: Killed core running with pid {0}'.format(pid))
def _core_already_running(self): return test_already_running(CORE_PID_PATH, CORE_BINARY_FILENAME)
def _daemon_already_running(self): return test_already_running(DAEMON_PID_PATH, DAEMON_BINARY_FILENAME)