]>
Commit | Line | Data |
---|---|---|
eac44f69 MT |
1 | From 3503b1493c09bbcca6d8dff203126703a7fc5822 Mon Sep 17 00:00:00 2001 |
2 | From: Michael Tremer <michael.tremer@ipfire.org> | |
3 | Date: Sun, 10 Mar 2013 01:22:37 +0100 | |
4 | Subject: [PATCH 07/19] cgroup: Move builder process out of cgroup before | |
5 | destroying it. | |
6 | ||
7 | Before all processes in the cgroup are killed, the builder process | |
8 | is migrated to the parent group, because kill_and_wait() waits | |
9 | for 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 | ||
14 | diff --git a/python/pakfire/builder.py b/python/pakfire/builder.py | |
15 | index 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 | -- | |
34 | 1.8.1.4 | |
35 |