From abc06716d027d68f0da3b0f559fa7c85a21804d5 Mon Sep 17 00:00:00 2001 From: Alan Pevec Date: Mon, 2 Jul 2012 14:07:06 +0200 Subject: notify calling process we are ready to serve Fixes bug 980037 again Systemd notification should be sent in-process, otherwise systemd might miss the subprocess sending notification. See systemd bug https://bugzilla.redhat.com/show_bug.cgi?id=820448 Change-Id: Iccc51cf77af5598ee6b4c3cd69a12a7ee9fc2eb5 --- bin/keystone-all | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/keystone-all b/bin/keystone-all index fc499967..c7734cf2 100755 --- a/bin/keystone-all +++ b/bin/keystone-all @@ -22,6 +22,7 @@ from paste import deploy from keystone import config from keystone.common import wsgi from keystone.common import utils +from keystone.openstack.common import importutils CONF = config.CONF @@ -54,9 +55,13 @@ def serve(*servers): # notify calling process we are ready to serve if CONF.onready: try: - utils.check_output(CONF.onready.split()) - except Exception: - logging.exception('Failed to execute onready command') + notifier = importutils.import_module(CONF.onready) + notifier.notify() + except ImportError: + try: + utils.check_output(CONF.onready.split()) + except Exception: + logging.exception('Failed to execute onready command') for server in servers: try: -- cgit