CGroups: finish initializing the CGroup

When a CGroup is created, we need to copy cpuset.cpus and cpuset.mems
from the new group's parent into the new group before we can attach any
processes to it.
This commit is contained in:
William Hubbs 2011-11-17 23:49:07 -06:00
parent 0bbb764f70
commit 62f4438376

View File

@ -194,6 +194,8 @@ if [ -d /sys/fs/cgroup/ ]; then
# use RC_SVCNAME unless overridden in conf.d
SVC_CGROUP=${rc_cgroup:-$RC_SVCNAME}
mkdir -p /sys/fs/cgroup/${SVC_CGROUP}
cp /sys/fs/cgroup/cpuset.cpus /sys/fs/cgroup/${SVC_CGROUP}
cp /sys/fs/cgroup/cpuset.mems /sys/fs/cgroup/${SVC_CGROUP}
# now attach self to cgroup - any children of this process will inherit this
echo $$ > /sys/fs/cgroup/${SVC_CGROUP}/tasks
# TODO: set res limits from conf.d