diff options
| -rwxr-xr-x | bitbake/bin/bitbake-worker | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker index 05e0cf6313..d1ff5b36c5 100755 --- a/bitbake/bin/bitbake-worker +++ b/bitbake/bin/bitbake-worker | |||
| @@ -81,6 +81,11 @@ def workerlog_write(msg): | |||
| 81 | lf.write(msg) | 81 | lf.write(msg) |
| 82 | lf.flush() | 82 | lf.flush() |
| 83 | 83 | ||
| 84 | def sigterm_handler(signum, frame): | ||
| 85 | signal.signal(signal.SIGTERM, signal.SIG_DFL) | ||
| 86 | os.killpg(0, signal.SIGTERM) | ||
| 87 | sys.exit() | ||
| 88 | |||
| 84 | def fork_off_task(cfg, data, workerdata, fn, task, taskname, appends, taskdepdata, quieterrors=False): | 89 | def fork_off_task(cfg, data, workerdata, fn, task, taskname, appends, taskdepdata, quieterrors=False): |
| 85 | # We need to setup the environment BEFORE the fork, since | 90 | # We need to setup the environment BEFORE the fork, since |
| 86 | # a fork() or exec*() activates PSEUDO... | 91 | # a fork() or exec*() activates PSEUDO... |
| @@ -132,7 +137,7 @@ def fork_off_task(cfg, data, workerdata, fn, task, taskname, appends, taskdepdat | |||
| 132 | global worker_pipe | 137 | global worker_pipe |
| 133 | pipein.close() | 138 | pipein.close() |
| 134 | 139 | ||
| 135 | signal.signal(signal.SIGTERM, signal.SIG_DFL) | 140 | signal.signal(signal.SIGTERM, sigterm_handler) |
| 136 | 141 | ||
| 137 | # Save out the PID so that the event can include it the | 142 | # Save out the PID so that the event can include it the |
| 138 | # events | 143 | # events |
