diff options
author | Jenkins <jenkins@review.openstack.org> | 2012-05-29 19:24:12 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2012-05-29 19:24:12 +0000 |
commit | 654dd416321972f8666dfad201228a456a8915a2 (patch) | |
tree | 05c77c03af6a1086448fc416ac9c0c53cd935987 /bin | |
parent | bb2fbb703092b8c788ae4da718f32fcf86f1f9eb (diff) | |
parent | 012c3d361fc2f6855f3612967aada0fa04aac188 (diff) | |
download | keystone-654dd416321972f8666dfad201228a456a8915a2.tar.gz keystone-654dd416321972f8666dfad201228a456a8915a2.tar.xz keystone-654dd416321972f8666dfad201228a456a8915a2.zip |
Merge "One 'ctrl-c' kills keystone."
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/keystone-all | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/keystone-all b/bin/keystone-all index bc4ab4b8..d961669c 100755 --- a/bin/keystone-all +++ b/bin/keystone-all @@ -4,6 +4,7 @@ import greenlet import logging import os +import signal import sys # If ../keystone/__init__.py exists, add ../ to Python search path, so that @@ -31,7 +32,15 @@ def create_server(conf, name, host, port): return wsgi.Server(app, host=host, port=port) +def sigint_handler(signal, frame): + """Exits at SIGINT signal.""" + logging.debug('SIGINT received, stopping servers.') + sys.exit(0) + + def serve(*servers): + signal.signal(signal.SIGINT, sigint_handler) + for server in servers: logging.debug("starting server %s on port %s", server.application, |