summaryrefslogtreecommitdiff
path: root/bitbake/bin/bitbake-worker
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/bin/bitbake-worker')
-rwxr-xr-xbitbake/bin/bitbake-worker9
1 files changed, 8 insertions, 1 deletions
diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker
index dde2c9c8fc..371c99a677 100755
--- a/bitbake/bin/bitbake-worker
+++ b/bitbake/bin/bitbake-worker
@@ -147,6 +147,8 @@ def fork_off_task(cfg, data, workerdata, fn, task, taskname, appends, taskdepdat
pipein.close()
signal.signal(signal.SIGTERM, sigterm_handler)
+ # Let SIGHUP exit as SIGTERM
+ signal.signal(signal.SIGHUP, sigterm_handler)
# Save out the PID so that the event can include it the
# events
@@ -266,9 +268,14 @@ class BitbakeWorker(object):
self.build_pipes = {}
signal.signal(signal.SIGTERM, self.sigterm_exception)
+ # Let SIGHUP exit as SIGTERM
+ signal.signal(signal.SIGHUP, self.sigterm_exception)
def sigterm_exception(self, signum, stackframe):
- bb.warn("Worker recieved SIGTERM, shutting down...")
+ if signum == signal.SIGTERM:
+ bb.warn("Worker recieved SIGTERM, shutting down...")
+ elif signum == signal.SIGHUP:
+ bb.warn("Worker recieved SIGHUP, shutting down...")
self.handle_finishnow(None)
signal.signal(signal.SIGTERM, signal.SIG_DFL)
os.kill(os.getpid(), signal.SIGTERM)