示例#1
0
def main():
    conf = service.prepare_service()
    sm = cotyledon.ServiceManager()
    sm.add(collector.CollectorService, workers=conf.collector.workers,
           args=(conf,))
    oslo_config_glue.setup(sm, conf)
    sm.run()
示例#2
0
def main():
    conf = service.prepare_service()

    sm = cotyledon.ServiceManager()
    sm.add(notification.NotificationService,
           workers=conf.notification.workers, args=(conf,))
    oslo_config_glue.setup(sm, conf)
    sm.run()
示例#3
0
def main():
    conf = cfg.ConfigOpts()
    conf.register_cli_opts(CLI_OPTS)
    service.prepare_service(conf=conf)
    sm = cotyledon.ServiceManager()
    sm.add(create_polling_service, args=(conf,))
    oslo_config_glue.setup(sm, conf)
    sm.run()
示例#4
0
def main():
    conf = cfg.ConfigOpts()
    conf.register_cli_opts(CLI_OPTS)
    service.prepare_service(conf=conf)
    sm = cotyledon.ServiceManager()
    sm.add(create_polling_service, args=(conf, ))
    oslo_config_glue.setup(sm, conf)
    sm.run()
示例#5
0
def main():
    conf = cfg.ConfigOpts()
    conf.register_cli_opts(CLI_OPTS)
    service.prepare_service(conf=conf)
    priv_context.init(root_helper=shlex.split(utils._get_root_helper()))
    sm = cotyledon.ServiceManager()
    sm.add(create_polling_service, args=(conf, ))
    oslo_config_glue.setup(sm, conf)
    sm.run()
示例#6
0
def main():
    conf = cfg.ConfigOpts()
    conf.register_cli_opts(CLI_OPTS)
    service.prepare_service(conf=conf)
    priv_context.init(root_helper=shlex.split(utils._get_root_helper()))
    sm = cotyledon.ServiceManager()
    sm.add(create_polling_service, args=(conf,))
    oslo_config_glue.setup(sm, conf)
    sm.run()
def main():
    conf = service.prepare_service()

    sm = cotyledon.ServiceManager()
    sm.add(notification.NotificationService,
           workers=conf.notification.workers,
           args=(conf, ))
    oslo_config_glue.setup(sm, conf)
    sm.run()
示例#8
0
def oslo_app():
    conf = cfg.ConfigOpts()
    conf([], project='openstack-app', validate_default_values=True,
         version="0.1")

    p = cotyledon.ServiceManager()
    oslo_config_glue.setup(p, conf)
    p.add(OsloService)
    p.run()
def main():
    octavia_service.prepare_service(sys.argv)
    gmr.TextGuruMeditation.setup_autorun(version)
    sm = cotyledon.ServiceManager()
    sm.add(consumer.ConsumerService,
           workers=CONF.a10_controller_worker.workers,
           args=(CONF, ))
    oslo_config_glue.setup(sm, CONF, reload_method="mutate")
    sm.run()
示例#10
0
def main():
    service.prepare_service()

    sm = cotyledon.ServiceManager()
    sm.add(manager.BackupManager, workers=CONF.conductor.backup_workers, args=(CONF,))
    sm.add(
        manager.RotationManager, workers=CONF.conductor.rotation_workers, args=(CONF,)
    )
    oslo_config_glue.setup(sm, CONF)
    sm.run()
示例#11
0
def main():
    octavia_service.prepare_service(sys.argv)

    gmr.TextGuruMeditation.setup_autorun(version)

    sm = cotyledon.ServiceManager()
    sm.add(consumer.ConsumerService, workers=CONF.controller_worker.workers,
           args=(CONF,))
    oslo_config_glue.setup(sm, CONF, reload_method="mutate")
    sm.run()
示例#12
0
def oslo_app():
    conf = cfg.ConfigOpts()
    conf([],
         project='openstack-app',
         validate_default_values=True,
         version="0.1")

    p = cotyledon.ServiceManager()
    oslo_config_glue.setup(p, conf)
    p.add(OsloService)
    p.run()
示例#13
0
def main():
    conf = cfg.ConfigOpts()
    conf.register_cli_opts(pipeline.OPTS)
    service.prepare_service(conf=conf)

    sm = cotyledon.ServiceManager()
    sm.add(notification.NotificationService,
           workers=conf.notification.workers,
           args=(conf, ))
    oslo_config_glue.setup(sm, conf)
    sm.run()
示例#14
0
def main():
    sm = cotyledon.ServiceManager()
    # On Windows, we can only initialize conf objects in the subprocess.
    # As a consequence, we can't use oslo_config_glue.setup() on Windows,
    # because cotyledon.ServiceManager objects are not picklable.
    if os.name == 'nt':
        sm.add(create_polling_service)
    else:
        conf = _prepare_config()
        oslo_config_glue.setup(sm, conf)
        sm.add(create_polling_service, args=(conf,))
    sm.run()
示例#15
0
文件: metricd.py 项目: rabi/gnocchi
    def __init__(self, conf):
        super(MetricdServiceManager, self).__init__()
        oslo_config_glue.setup(self, conf)

        self.conf = conf
        self.metric_processor_id = self.add(MetricProcessor,
                                            args=(self.conf, ),
                                            workers=conf.metricd.workers)
        if self.conf.metricd.metric_reporting_delay >= 0:
            self.add(MetricReporting, args=(self.conf, ))
        self.add(MetricJanitor, args=(self.conf, ))

        self.register_hooks(on_reload=self.on_reload)
示例#16
0
文件: metricd.py 项目: luo-zn/gnocchi
    def __init__(self, conf):
        super(MetricdServiceManager, self).__init__()
        oslo_config_glue.setup(self, conf)

        self.conf = conf
        self.metric_processor_id = self.add(
            MetricProcessor, args=(self.conf,),
            workers=conf.metricd.workers)
        if self.conf.metricd.metric_reporting_delay >= 0:
            self.add(MetricReporting, args=(self.conf,))
        self.add(MetricJanitor, args=(self.conf,))

        self.register_hooks(on_reload=self.on_reload)
示例#17
0
    def __init__(self, conf):
        super(GnocchiNagiosServiceManager, self).__init__()
        oslo_config_glue.setup(self, conf)

        self.conf = conf
        self.queue = multiprocessing.Manager().Queue()

        self.add(perfdata_dispatcher.PerfdataDispatcher,
                 args=(self.conf, self.queue))
        self.processor_id = self.add(perfdata_processor.PerfdataProcessor,
                                     args=(self.conf, self.queue),
                                     workers=conf.workers)

        self.register_hooks(on_reload=self.on_reload)
示例#18
0
def main():
    try:
        config.parse_args(args=common.get_properly_ordered_parameters())
        common.print_server_info("engine")
        logging.setup(CONF, 'qinling')
        # Initialize RPC configuration.
        rpc.get_transport()

        sm = cotyledon.ServiceManager()
        sm.add(
            eng_service.EngineService,
            workers=1,
        )
        oslo_config_glue.setup(sm, CONF, reload_method="mutate")
        sm.run()
    except RuntimeError as excp:
        sys.stderr.write("ERROR: %s\n" % excp)
        sys.exit(1)
示例#19
0
 def __init__(self, conf):
     super(PollingServiceManager, self).__init__()
     oslo_config_glue.setup(self, conf)
     self.conf = conf
     self.addService()
示例#20
0
        do_child_reload()


class MyOtherService(cotyledon.Service):
    name = "Second Service"


class MyThirdService(cotyledon.Service):
    pass


class MyServiceManager(cotyledon.ServiceManager):
    def __init__(self, conf)
    supper(MetricdServiceManager, self).__init__()
    self.conf = conf
    oslo_config_glue.setup(self, self.conf, restart_method='reload')
    self.queue = multiprocessing.Queue()

    # the queue is explicitly passed to this child (it will live
    # on all of them due to the usage of os.fork() to create children)
    sm.add(MyService, workers=2, args=(self.conf, queue))
    self.other_id = sm.add(MyOtherService, workers=conf.other_workers)
    sm.add(MyThirdService, workers=2)


def run(self):
    do_master_process_start()
    super(MyServiceManager, self).run()
    do_master_process_stop()