summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/keystone-all8
-rw-r--r--etc/keystone.conf.sample4
-rw-r--r--keystone/config.py1
3 files changed, 13 insertions, 0 deletions
diff --git a/bin/keystone-all b/bin/keystone-all
index f58c2a03..bc4ab4b8 100755
--- a/bin/keystone-all
+++ b/bin/keystone-all
@@ -20,6 +20,7 @@ from paste import deploy
from keystone import config
from keystone.common import wsgi
+from keystone.common import utils
CONF = config.CONF
@@ -37,6 +38,13 @@ def serve(*servers):
server.port)
server.start()
+ # 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')
+
for server in servers:
try:
server.wait()
diff --git a/etc/keystone.conf.sample b/etc/keystone.conf.sample
index 4f146d91..7d3d52c8 100644
--- a/etc/keystone.conf.sample
+++ b/etc/keystone.conf.sample
@@ -46,6 +46,10 @@
# Format string for %(asctime)s in log records.
# log_date_format = %Y-%m-%d %H:%M:%S
+# onready allows you to run a command when the process is ready to serve
+# for example to have it notify using systemd, one could set
+# onready = systemd-notify --ready
+
[sql]
# The SQLAlchemy connection string used to connect to the database
# connection = sqlite:///keystone.db
diff --git a/keystone/config.py b/keystone/config.py
index 36523d22..4b50f411 100644
--- a/keystone/config.py
+++ b/keystone/config.py
@@ -143,6 +143,7 @@ register_str('bind_host', default='0.0.0.0')
register_str('compute_port', default=8774)
register_str('admin_port', default=35357)
register_str('public_port', default=5000)
+register_str('onready')
# sql options