]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blame - pakfire/patches/0007-cgroup-Move-builder-process-out-of-cgroup-before-des.patch
pakfire: Sync with upstream.
[people/ms/ipfire-3.x.git] / pakfire / patches / 0007-cgroup-Move-builder-process-out-of-cgroup-before-des.patch
CommitLineData
eac44f69
MT
1From 3503b1493c09bbcca6d8dff203126703a7fc5822 Mon Sep 17 00:00:00 2001
2From: Michael Tremer <michael.tremer@ipfire.org>
3Date: Sun, 10 Mar 2013 01:22:37 +0100
4Subject: [PATCH 07/19] cgroup: Move builder process out of cgroup before
5 destroying it.
6
7Before all processes in the cgroup are killed, the builder process
8is migrated to the parent group, because kill_and_wait() waits
9for nothing because it will never kill its own process.
10---
11 python/pakfire/builder.py | 4 +++-
12 1 file changed, 3 insertions(+), 1 deletion(-)
13
14diff --git a/python/pakfire/builder.py b/python/pakfire/builder.py
15index 7427a8c..944c1a0 100644
16--- a/python/pakfire/builder.py
17+++ b/python/pakfire/builder.py
18@@ -200,11 +200,13 @@ class BuildEnviron(object):
19
20 def stop(self):
21 if self.cgroup:
22+ # Move the builder process out of the cgroup.
23+ self.cgroup.migrate_task(self.cgroup.parent, os.getpid())
24+
25 # Kill all still running processes in the cgroup.
26 self.cgroup.kill_and_wait()
27
28 # Remove cgroup and all parent cgroups if they are empty.
29- self.cgroup.migrate_task(self.cgroup.root, os.getpid())
30 self.cgroup.destroy()
31
32 parent = self.cgroup.parent
33--
341.8.1.4
35