bitbake runqueue.py: Set children as process group leaders and send SIGTERM to the process groups
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@998 311d38ba-8fff-0310-9ca6-ca027cbcb966
This commit is contained in:
parent
62747098a8
commit
21fb2cbe1c
|
@ -423,6 +423,8 @@ class RunQueue:
|
||||||
active_builds = 0
|
active_builds = 0
|
||||||
# Stop Ctrl+C being sent to children
|
# Stop Ctrl+C being sent to children
|
||||||
signal.signal(signal.SIGINT, signal.SIG_IGN)
|
signal.signal(signal.SIGINT, signal.SIG_IGN)
|
||||||
|
# Make the child the process group leader
|
||||||
|
os.setpgid(0, 0)
|
||||||
sys.stdin = open('/dev/null', 'r')
|
sys.stdin = open('/dev/null', 'r')
|
||||||
cooker.configuration.cmd = taskname[3:]
|
cooker.configuration.cmd = taskname[3:]
|
||||||
try:
|
try:
|
||||||
|
@ -472,7 +474,7 @@ class RunQueue:
|
||||||
except:
|
except:
|
||||||
bb.msg.note(1, bb.msg.domain.RunQueue, "Sending SIGTERM to remaining %s tasks" % active_builds)
|
bb.msg.note(1, bb.msg.domain.RunQueue, "Sending SIGTERM to remaining %s tasks" % active_builds)
|
||||||
for k, v in build_pids.iteritems():
|
for k, v in build_pids.iteritems():
|
||||||
os.kill(k, signal.SIGTERM)
|
os.kill(-k, signal.SIGTERM)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
# Sanity Checks
|
# Sanity Checks
|
||||||
|
|
Loading…
Reference in New Issue