Merge "One 'ctrl-c' kills keystone."
This commit is contained in:
commit
654dd41632
@ -4,6 +4,7 @@
|
|||||||
import greenlet
|
import greenlet
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import signal
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
# If ../keystone/__init__.py exists, add ../ to Python search path, so that
|
# 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)
|
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):
|
def serve(*servers):
|
||||||
|
signal.signal(signal.SIGINT, sigint_handler)
|
||||||
|
|
||||||
for server in servers:
|
for server in servers:
|
||||||
logging.debug("starting server %s on port %s",
|
logging.debug("starting server %s on port %s",
|
||||||
server.application,
|
server.application,
|
||||||
|
Loading…
Reference in New Issue
Block a user