summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-12-08 21:31:56 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-11 17:36:50 +0000
commit646cd97d248b2391101e3108a8f3ecd11a5210db (patch)
tree0f044e5b85b4e96775e837587ab3f8847b98e41e /bitbake
parent384863c7bc4d36d584537b00f1469b68eb94b487 (diff)
downloadpoky-646cd97d248b2391101e3108a8f3ecd11a5210db.tar.gz
bitbake: bitbake-worker: Use setsid() rather than setpgid()
The bug has a long discussion of this. Basically, in some environments, the exact details of which aren't understood, a Ctrl+C signal to the UI is being transmitted to all the process children. Looking at the output of "ps ax -O tpgid", its clear the main process is still the terminal owner of these processes. stty -a on a problematic system shows: "-ignbrk brkint" and on a working system shows: "-ignbrk -brkint" The description of brkint would suggest this is the problem, setting up that terminal environment wasn't able to reproduce the problem though. It was confirmed that using setsid() caused the problem to be resolved and is probably the right thing to be doing anyway, so lets do it. [YOCTO #6949] (Bitbake rev: 81d90389edd4d4778d3aec86e0775ab98dd1496e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-xbitbake/bin/bitbake-worker7
1 files changed, 5 insertions, 2 deletions
diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker
index 371c99a677..8a24161250 100755
--- a/bitbake/bin/bitbake-worker
+++ b/bitbake/bin/bitbake-worker
@@ -156,8 +156,11 @@ def fork_off_task(cfg, data, workerdata, fn, task, taskname, appends, taskdepdat
156 bb.event.worker_fire = worker_child_fire 156 bb.event.worker_fire = worker_child_fire
157 worker_pipe = pipeout 157 worker_pipe = pipeout
158 158
159 # Make the child the process group leader 159 # Make the child the process group leader and ensure no
160 os.setpgid(0, 0) 160 # child process will be controlled by the current terminal
161 # This ensures signals sent to the controlling terminal like Ctrl+C
162 # don't stop the child processes.
163 os.setsid()
161 # No stdin 164 # No stdin
162 newsi = os.open(os.devnull, os.O_RDWR) 165 newsi = os.open(os.devnull, os.O_RDWR)
163 os.dup2(newsi, sys.stdin.fileno()) 166 os.dup2(newsi, sys.stdin.fileno())