handle KeyboardInterrupt
When running zuul in non-daemon mode (with -d), it is often useful to abort it using Control + C. Change-Id: I385a41625633f3120b95c07283bef015824e5853 Reviewed-on: https://review.openstack.org/13571 Reviewed-by: Monty Taylor <mordred@inaugust.com> Reviewed-by: James E. Blair <corvus@inaugust.com> Approved: James E. Blair <corvus@inaugust.com> Tested-by: Jenkins
This commit is contained in:
parent
40b9907cd3
commit
6ad5d5b1af
|
@ -101,8 +101,11 @@ class Server(object):
|
||||||
signal.signal(signal.SIGHUP, self.reconfigure_handler)
|
signal.signal(signal.SIGHUP, self.reconfigure_handler)
|
||||||
signal.signal(signal.SIGUSR1, self.exit_handler)
|
signal.signal(signal.SIGUSR1, self.exit_handler)
|
||||||
while True:
|
while True:
|
||||||
signal.pause()
|
try:
|
||||||
|
signal.pause()
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print "Ctrl + C: asking scheduler to exit nicely...\n"
|
||||||
|
self.exit_handler( signal.SIGINT, None )
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
server = Server()
|
server = Server()
|
||||||
|
|
Loading…
Reference in New Issue