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
diff --git a/zuul-server b/zuul-server
index 3e06e06..d57c564 100755
--- a/zuul-server
+++ b/zuul-server
@@ -101,8 +101,11 @@
signal.signal(signal.SIGHUP, self.reconfigure_handler)
signal.signal(signal.SIGUSR1, self.exit_handler)
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__':
server = Server()