From a78616733f2ab4a5a75e9999d34a61c8ee82aadb Mon Sep 17 00:00:00 2001 From: Alan Pevec Date: Tue, 11 Feb 2014 22:36:00 +0100 Subject: [PATCH] notify calling process we are ready to serve Deploy systemd notifications in api, registry and scrubber services. It does not have an effect when running the service outside the systemd environment. Change-Id: I80f325c9be9c171c2dc8d5526570bf64f0f87c78 Conflicts: glance/cmd/api.py glance/cmd/registry.py glance/cmd/scrubber.py --- glance/cmd/api.py | 2 ++ glance/cmd/registry.py | 2 ++ glance/cmd/scrubber.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/glance/cmd/api.py b/glance/cmd/api.py index 28fdeaf..c219db9 100755 --- a/glance/cmd/api.py +++ b/glance/cmd/api.py @@ -50,6 +50,7 @@ from glance.common import config from glance.common import exception from glance.common import wsgi from glance import notifier +from glance.openstack.common import systemd CONF = cfg.CONF CONF.import_group("profiler", "glance.common.wsgi") @@ -85,6 +86,7 @@ def main(): server = wsgi.Server(initialize_glance_store=True) server.start(config.load_paste_app('glance-api'), default_port=9292) + systemd.notify_once() server.wait() except KNOWN_EXCEPTIONS as e: fail(e) diff --git a/glance/cmd/registry.py b/glance/cmd/registry.py index 58393b6..f95662e 100755 --- a/glance/cmd/registry.py +++ b/glance/cmd/registry.py @@ -46,6 +46,7 @@ from glance.common import config from glance.common import utils from glance.common import wsgi from glance import notifier +from glance.openstack.common import systemd CONF = cfg.CONF CONF.import_group("profiler", "glance.common.wsgi") @@ -72,6 +73,7 @@ def main(): server = wsgi.Server() server.start(config.load_paste_app('glance-registry'), default_port=9191) + systemd.notify_once() server.wait() except RuntimeError as e: sys.exit("ERROR: %s" % utils.exception_to_str(e)) diff --git a/glance/cmd/scrubber.py b/glance/cmd/scrubber.py index e7b4a1b..aaae76e 100755 --- a/glance/cmd/scrubber.py +++ b/glance/cmd/scrubber.py @@ -35,6 +35,7 @@ from oslo_config import cfg from oslo_log import log as logging from glance.common import config +from glance.openstack.common import systemd from glance import scrubber @@ -59,6 +60,7 @@ def main(): if CONF.daemon: server = scrubber.Daemon(CONF.wakeup_time) server.start(app) + systemd.notify_once() server.wait() else: import eventlet