示例#1
0
def update_daemon(command):
    daemon = CouchUpdateDaemon(get_pid_file())
    avail_commands = { 'start'  : daemon.start,
                       'stop'   : daemon.stop, 
                       'forcestop'   : daemon.force_stop, 
                       'restart': daemon.restart, 
                       'check'  : daemon.check, 
                       'wake'  : daemon.wake_up, 
                     }
    if command not in avail_commands.keys():
       output_string = "Usage: script.py "
       for akey in avail_commands.keys():
           output_string += akey + "|"
       output_string = output_string[:-1]
       print output_string
       sys.exit(1)
    
    avail_commands[command]()
示例#2
0
def wake_up():
    daemon = CouchUpdateDaemon(get_pid_file())
    daemon.wake_up()