Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/openrc:master commit in: sh/
Date: Fri, 18 Nov 2011 14:39:31
Message-Id: a5ba2f3264397ac1ca1545ae67fbfdafa1b30b67.WilliamH@gentoo
1 commit: a5ba2f3264397ac1ca1545ae67fbfdafa1b30b67
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Fri Nov 18 14:32:06 2011 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Fri Nov 18 14:32:06 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=a5ba2f32
7
8 CGroups: fix group initialization
9
10 Make sure cpuset.cpus and cpuset.mems exist in the parent group before
11 attempting to copy them to the new group.
12
13 ---
14 sh/runscript.sh.in | 7 +++++--
15 1 files changed, 5 insertions(+), 2 deletions(-)
16
17 diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in
18 index 722364a..c7d712b 100644
19 --- a/sh/runscript.sh.in
20 +++ b/sh/runscript.sh.in
21 @@ -194,8 +194,11 @@ if [ -d /sys/fs/cgroup/ ]; then
22 # use RC_SVCNAME unless overridden in conf.d
23 SVC_CGROUP=${rc_cgroup:-$RC_SVCNAME}
24 mkdir -p /sys/fs/cgroup/${SVC_CGROUP}
25 - cp /sys/fs/cgroup/cpuset.cpus /sys/fs/cgroup/${SVC_CGROUP}
26 - cp /sys/fs/cgroup/cpuset.mems /sys/fs/cgroup/${SVC_CGROUP}
27 + for f in cpuset.cpus cpuset.mems; do
28 + if [ -f /sys/fs/cgroup/${f} ]; then
29 + cp /sys/fs/cgroup/${f} /sys/fs/cgroup/${SVC_CGROUP}
30 + fi
31 + done
32 # now attach self to cgroup - any children of this process will inherit this
33 echo $$ > /sys/fs/cgroup/${SVC_CGROUP}/tasks
34 # TODO: set res limits from conf.d