Avoid restarting a child when terminating

When sending a SIGTERM to the main glare-api process, it was sending a SIGTERM to its children but then also re-spawning its first dead child.

Related-bug: #1714240

Change-Id: Ibef426c198d287bbdac4e764fd654edba4b7c2d7
This commit is contained in:
Bernhard M. Wiedemann 2017-09-19 13:36:45 +02:00
parent e93e29bb50
commit 32b91f3a0e

View File

@ -259,6 +259,7 @@ class Server(object):
"""Kills the entire process group.""" """Kills the entire process group."""
signal.signal(signal.SIGTERM, signal.SIG_IGN) signal.signal(signal.SIGTERM, signal.SIG_IGN)
signal.signal(signal.SIGINT, signal.SIG_IGN) signal.signal(signal.SIGINT, signal.SIG_IGN)
signal.signal(signal.SIGCHLD, signal.SIG_IGN)
self.running = False self.running = False
os.killpg(self.pgid, signal.SIGTERM) os.killpg(self.pgid, signal.SIGTERM)