diff options
-rw-r--r-- | sh/rc-cgroup.sh.in | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sh/rc-cgroup.sh.in b/sh/rc-cgroup.sh.in index d96aa164..21f5f50d 100644 --- a/sh/rc-cgroup.sh.in +++ b/sh/rc-cgroup.sh.in @@ -72,6 +72,14 @@ cgroup_set_values() cgroup_set_limits() { + # 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" |