diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2013-07-05 10:38:51 -0500 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2013-07-05 10:38:51 -0500 |
commit | 88cdcc145eb6343b94626ab3910a5eb1f8654212 (patch) | |
tree | 66bc94f989f2846b5b8399c4932658a21216b306 | |
parent | 00caa1431abd5f7ae28bc9f4284d65f6a3575a7b (diff) | |
parent | 992807de55bd9b0e8cbb569a86bb84b75fe9482e (diff) |
Merge branch 'cgroup.systemd'
Conflicts:
sh/rc-cgroup.sh.in
-rw-r--r-- | sh/rc-cgroup.sh.in | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sh/rc-cgroup.sh.in b/sh/rc-cgroup.sh.in index afcbb031..b3bab0f9 100644 --- a/sh/rc-cgroup.sh.in +++ b/sh/rc-cgroup.sh.in @@ -72,8 +72,17 @@ cgroup_set_values() cgroup_add_service() { - if [ -d "$1" ]; then - cgroup="$1/$RC_SVCNAME" + # relocate starting process to the top of the cgroup + # it prevents from unwanted inheriting of the user + # cgroups. But may lead to a problems where that inheriting + # is needed. + for d in /sys/fs/cgroup/* ; do + echo $$ > "${d}"/tasks + done + + openrc_cgroup=/sys/fs/cgroup/openrc + if [ -d "$openrc_cgroup" ]; then + cgroup="$openrc_cgroup/$RC_SVCNAME" mkdir -p "$cgroup" [ -f "$cgroup/tasks" ] && echo 0 > "$cgroup/tasks" fi |