summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2013-07-05 10:38:51 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2013-07-05 10:38:51 -0500
commit88cdcc145eb6343b94626ab3910a5eb1f8654212 (patch)
tree66bc94f989f2846b5b8399c4932658a21216b306
parent00caa1431abd5f7ae28bc9f4284d65f6a3575a7b (diff)
parent992807de55bd9b0e8cbb569a86bb84b75fe9482e (diff)
downloadopenrc-88cdcc145eb6343b94626ab3910a5eb1f8654212.tar.gz
openrc-88cdcc145eb6343b94626ab3910a5eb1f8654212.tar.bz2
openrc-88cdcc145eb6343b94626ab3910a5eb1f8654212.tar.xz
Merge branch 'cgroup.systemd'
Conflicts: sh/rc-cgroup.sh.in
-rw-r--r--sh/rc-cgroup.sh.in13
1 files changed, 11 insertions, 2 deletions
diff --git a/sh/rc-cgroup.sh.in b/sh/rc-cgroup.sh.in
index afcbb03..b3bab0f 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