def stop_daemon(lock, sock): if is_daemon_running(lock): client = Daemon.attach_to_daemon(pid=lock, sock=sock) client.post_stop_daemon() client.close() try: os.waitpid(DaemonIPC.get_pid_from_lock(lock), 0) except: pass
def is_daemon_running(lock): return DaemonIPC.is_pid_alive(DaemonIPC.get_pid_from_lock(lock))