Beispiel #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))
Beispiel #2
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))
Beispiel #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)
Beispiel #4
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)
Beispiel #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)
Beispiel #6
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)