示例#1
0
def stop():
    """Stop all services."""
    for service in manager.get_all():
        try:
            service.stop()
        except Exception, exc:
            log.exception('Exception %s while %s stop' % (exc, service))
示例#2
0
文件: daemon.py 项目: agwells/PyWO-1
def stop():
    """Stop all services."""
    for service in manager.get_all():
        try:
            service.stop()
        except Exception, exc:
            log.exception("Exception %s while %s stop" % (exc, service))
示例#3
0
def start():
    """Start all services."""
    failed = []
    for service in manager.get_all():
        try:
            service.start()
        except Exception, exc:
            log.exception('Exception %s while %s start' % (exc, service))
            failed.append(service)
示例#4
0
文件: daemon.py 项目: agwells/PyWO-1
def start():
    """Start all services."""
    failed = []
    for service in manager.get_all():
        try:
            service.start()
        except Exception, exc:
            log.exception("Exception %s while %s start" % (exc, service))
            failed.append(service)
示例#5
0
def setup(config):
    """Import and setup all services."""
    global __CONFIG
    if not __CONFIG:
        # First time start, we are im main-thread - register signal handlers
        signal.signal(signal.SIGINT, interrupt_handler)
        signal.signal(signal.SIGTERM, interrupt_handler)
        # and required actions
        actions.register(name='exit')(exit_pywo)
        actions.register(name='reload')(reload_pywo)
    __CONFIG = config
    WM.update_type()
    manager.load(__CONFIG)
    failed = []
    for service in manager.get_all():
        try:
            service.setup(config)
        except Exception, exc:
            log.exception('Exception %s while %s setup' % (exc, service))
            failed.append(service)
示例#6
0
文件: daemon.py 项目: agwells/PyWO-1
def setup(config):
    """Import and setup all services."""
    global __CONFIG
    if not __CONFIG:
        # First time start, we are im main-thread - register signal handlers
        signal.signal(signal.SIGINT, interrupt_handler)
        signal.signal(signal.SIGTERM, interrupt_handler)
        # and required actions
        actions.register(name="exit")(exit_pywo)
        actions.register(name="reload")(reload_pywo)
    __CONFIG = config
    WM.update_type()
    manager.load(__CONFIG)
    failed = []
    for service in manager.get_all():
        try:
            service.setup(config)
        except Exception, exc:
            log.exception("Exception %s while %s setup" % (exc, service))
            failed.append(service)