summaryrefslogtreecommitdiff
path: root/zuul/cmd/executor.py
diff options
context:
space:
mode:
Diffstat (limited to 'zuul/cmd/executor.py')
-rwxr-xr-xzuul/cmd/executor.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/zuul/cmd/executor.py b/zuul/cmd/executor.py
index ade9715c2..c82deb748 100755
--- a/zuul/cmd/executor.py
+++ b/zuul/cmd/executor.py
@@ -51,9 +51,10 @@ class Executor(zuul.cmd.ZuulDaemonApp):
if self.args.command:
self.args.nodaemon = True
- def exit_handler(self):
+ def exit_handler(self, signum, frame):
self.executor.stop()
self.executor.join()
+ sys.exit(0)
def start_log_streamer(self):
pipe_read, pipe_write = os.pipe()
@@ -132,13 +133,13 @@ class Executor(zuul.cmd.ZuulDaemonApp):
signal.signal(signal.SIGUSR2, zuul.cmd.stack_dump_handler)
if self.args.nodaemon:
+ signal.signal(signal.SIGTERM, self.exit_handler)
while True:
try:
signal.pause()
except KeyboardInterrupt:
print("Ctrl + C: asking executor to exit nicely...\n")
- self.exit_handler()
- sys.exit(0)
+ self.exit_handler(signal.SIGINT, None)
else:
self.executor.join()