def stop(args): pid = helpers.get_pid(args.pid_file) if pid: os.kill(pid, signal.SIGTERM) helpers.wait_for_shutdown_or_kill(pid) else: print(f'{NAME}: NOT running')
def reload(args): ''' Daemon interface - send SIGUSR1 to the dameon ''' pid = helpers.get_pid(args.pid_file) if pid: os.kill(pid, signal.SIGUSR1) else: print(f'{NAME}: NOT running')
def status(args): ''' Daemon interface - check if the dameon is running ''' pid = helpers.get_pid(args.pid_file) if pid: print(f'{NAME}: running as pid {pid}') else: print(f'{NAME}: NOT running')
def stop(args): ''' Daemon interface - stop the dameon ''' pid = helpers.get_pid(args.pid_file) if pid: os.kill(pid, signal.SIGTERM) helpers.wait_for_shutdown_or_kill(pid) else: print(f'{NAME}: NOT running')
def reload(args): pid = helpers.get_pid(args.pid_file) if pid: os.kill(pid, signal.SIGUSR1) else: print(f'{NAME}: NOT running')
def status(args): pid = helpers.get_pid(args.pid_file) if pid: print(f'{NAME}: running as pid {pid}') else: print(f'{NAME}: NOT running')