summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cooker.py
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2014-11-17 02:27:36 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-11-20 14:15:32 +0000
commitc09e56168ea5a9e4ff3e7f38d7da79e5d883021b (patch)
tree5c987833c57afea7bb138e858bf2c36c6b1967c1 /bitbake/lib/bb/cooker.py
parent7d559fcca8ac552770e20d0831ed755a75f3a9fd (diff)
downloadpoky-c09e56168ea5a9e4ff3e7f38d7da79e5d883021b.tar.gz
bitbake: bitbake-worker: exit normally when SIGHUP
Fixed: 1) Run "bitbake recipe" in the terminal 2) Close the terminal while building 3) $ ps aux | grep bitbake-worker There will be many processes, and they will keep the resources (e.g., memory), and won't exit unless kill or kill -9. (Bitbake rev: 40d2ae0723de2bf5fee343faafb4afda40546839) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r--bitbake/lib/bb/cooker.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 087f72fc56..a08c14bbdc 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -153,9 +153,14 @@ class BBCooker:
153 self.parser = None 153 self.parser = None
154 154
155 signal.signal(signal.SIGTERM, self.sigterm_exception) 155 signal.signal(signal.SIGTERM, self.sigterm_exception)
156 # Let SIGHUP exit as SIGTERM
157 signal.signal(signal.SIGHUP, self.sigterm_exception)
156 158
157 def sigterm_exception(self, signum, stackframe): 159 def sigterm_exception(self, signum, stackframe):
158 bb.warn("Cooker recieved SIGTERM, shutting down...") 160 if signum == signal.SIGTERM:
161 bb.warn("Cooker recieved SIGTERM, shutting down...")
162 elif signum == signal.SIGHUP:
163 bb.warn("Cooker recieved SIGHUP, shutting down...")
159 self.state = state.forceshutdown 164 self.state = state.forceshutdown
160 165
161 def setFeatures(self, features): 166 def setFeatures(self, features):