diff options
author | Alan Pevec <apevec@redhat.com> | 2012-07-02 14:07:06 +0200 |
---|---|---|
committer | Alan Pevec <apevec@redhat.com> | 2012-07-04 00:36:20 +0200 |
commit | abc06716d027d68f0da3b0f559fa7c85a21804d5 (patch) | |
tree | 7c64eb47b5a0ba12e0688d7a754254f53ebb0d2d /bin | |
parent | 478cde128b4e1c6f8aa4595b71552207197917cd (diff) | |
download | keystone-abc06716d027d68f0da3b0f559fa7c85a21804d5.tar.gz keystone-abc06716d027d68f0da3b0f559fa7c85a21804d5.tar.xz keystone-abc06716d027d68f0da3b0f559fa7c85a21804d5.zip |
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
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/keystone-all | 11 |
1 files changed, 8 insertions, 3 deletions
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: |