From 7ed2c619598caedb2502b77f921404c0abfe02df Mon Sep 17 00:00:00 2001 From: Alexander V Vershilov Date: Sun, 30 Jun 2013 16:32:30 +0400 Subject: [PATCH] Put a service on into a top hierarchy of each cgroup This change will fix unwanted cgroup inheriting from user cgroups, and fixes issues with systemd cgroup tracking by logind. However this fix can lead to incorrect work for some user cgroup controllers - so more advanced solution, that coveres such cases will be created later. --- sh/rc-cgroup.sh.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sh/rc-cgroup.sh.in b/sh/rc-cgroup.sh.in index d96aa1646..9456152b0 100644 --- a/sh/rc-cgroup.sh.in +++ b/sh/rc-cgroup.sh.in @@ -72,6 +72,10 @@ cgroup_set_values() cgroup_set_limits() { + for d in /sys/fs/cgroup/* ; do + echo $$ > /sys/fs/cgroup/"${d}"/tasks + done + openrc_cgroup=/sys/fs/cgroup/openrc if [ -d "$openrc_cgroup" ]; then cgroup="$openrc_cgroup/$RC_SVCNAME"