All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] bitbake-worker: exit normally when SIGHUP
@ 2014-11-17 13:07 Robert Yang
  2014-11-17 13:07 ` [PATCH 1/1] " Robert Yang
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Yang @ 2014-11-17 13:07 UTC (permalink / raw)
  To: bitbake-devel

The following changes since commit edaeb8940813b620090a0797ad3b6a076897512d:

  bitbake: cooker.py: fix loginfo op being set to an invalid value (2014-11-12 17:04:50 +0000)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib rbt/sighup
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=rbt/sighup

Robert Yang (1):
  bitbake-worker: exit normally when SIGHUP

 bitbake/bin/bitbake-worker |    9 ++++++++-
 bitbake/lib/bb/cooker.py   |    7 ++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

-- 
1.7.9.5



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] bitbake-worker: exit normally when SIGHUP
  2014-11-17 13:07 [PATCH 0/1] bitbake-worker: exit normally when SIGHUP Robert Yang
@ 2014-11-17 13:07 ` Robert Yang
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Yang @ 2014-11-17 13:07 UTC (permalink / raw)
  To: bitbake-devel

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.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 bitbake/bin/bitbake-worker |    9 ++++++++-
 bitbake/lib/bb/cooker.py   |    7 ++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker
index dde2c9c..371c99a 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)
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 087f72f..a08c14b 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):
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-17 13:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-17 13:07 [PATCH 0/1] bitbake-worker: exit normally when SIGHUP Robert Yang
2014-11-17 13:07 ` [PATCH 1/1] " Robert Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.