From be22ea03145581699ffe7a292d5b94f53e13a9cf Mon Sep 17 00:00:00 2001 From: Robert Yang Date: Mon, 17 Nov 2014 02:27:36 -0800 Subject: 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: 72536d4e0cc3379001b730950afa012f7a96a79b) Signed-off-by: Robert Yang Signed-off-by: Richard Purdie --- bitbake/lib/bb/cooker.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'bitbake/lib') diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index c6c69c30ea..a900b07a80 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -153,9 +153,14 @@ class BBCooker: self.parser = None 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("Cooker recieved SIGTERM, shutting down...") + if signum == signal.SIGTERM: + bb.warn("Cooker recieved SIGTERM, shutting down...") + elif signum == signal.SIGHUP: + bb.warn("Cooker recieved SIGHUP, shutting down...") self.state = state.forceshutdown def setFeatures(self, features): -- cgit v1.2.3-54-g00ecf