예제 #1
0
def watch_pid(config, key, pid):
    lock = config['daemon']['lock']
    if not is_daemon_running(lock):
        sys.exit("ERROR: Daemon not running")
    if not DaemonIPC.is_pid_alive(pid):
        sys.exit("ERROR: pid [%i] does not exist" % pid)
    client = get_daemon_connection(config)
    client.post_watch_pid(key, pid)
    client.close()
예제 #2
0
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
예제 #3
0
def watch_pid(config, key, pid):
    lock = config['daemon']['lock']
    if not is_daemon_running(lock):
        sys.exit("ERROR: Daemon not running")
    if not DaemonIPC.is_pid_alive(pid):
        sys.exit("ERROR: pid [%i] does not exist" % pid)
    client = get_daemon_connection(config)
    client.post_watch_pid(key, pid)
    client.close()
예제 #4
0
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
예제 #5
0
def is_daemon_running(lock):
    return DaemonIPC.is_pid_alive(DaemonIPC.get_pid_from_lock(lock))
예제 #6
0
def is_daemon_running(lock):
    return DaemonIPC.is_pid_alive(DaemonIPC.get_pid_from_lock(lock))