summaryrefslogtreecommitdiffstats
path: root/bin/bitbake-worker
diff options
context:
space:
mode:
Diffstat (limited to 'bin/bitbake-worker')
-rwxr-xr-xbin/bitbake-worker7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/bitbake-worker b/bin/bitbake-worker
index 05e0cf631..d1ff5b36c 100755
--- a/bin/bitbake-worker
+++ b/bin/bitbake-worker
@@ -81,6 +81,11 @@ def workerlog_write(msg):
lf.write(msg)
lf.flush()
+def sigterm_handler(signum, frame):
+ signal.signal(signal.SIGTERM, signal.SIG_DFL)
+ os.killpg(0, signal.SIGTERM)
+ sys.exit()
+
def fork_off_task(cfg, data, workerdata, fn, task, taskname, appends, taskdepdata, quieterrors=False):
# We need to setup the environment BEFORE the fork, since
# a fork() or exec*() activates PSEUDO...
@@ -132,7 +137,7 @@ def fork_off_task(cfg, data, workerdata, fn, task, taskname, appends, taskdepdat
global worker_pipe
pipein.close()
- signal.signal(signal.SIGTERM, signal.SIG_DFL)
+ signal.signal(signal.SIGTERM, sigterm_handler)
# Save out the PID so that the event can include it the
# events