cgroups: only create the cgroup when the service is being started

This commit is contained in:
William Hubbs 2012-01-29 09:47:43 -06:00
parent fb4aa20d05
commit cea71369e9

View File

@ -189,8 +189,8 @@ unset _conf_d
# Load any system overrides
sourcex -e "@SYSCONFDIR@/rc.conf"
if [ "$RC_UNAME" = "Linux" ]; then
if [ -d /sys/fs/cgroup/openrc ] && checkpath -W /sys/fs/cgroup/openrc ; then
if [ "$RC_UNAME" = "Linux" -a "$1" = "start" ]; then
if [ -d /sys/fs/cgroup/openrc ]; then
mkdir -p /sys/fs/cgroup/openrc/${RC_SVCNAME}
echo $$ > /sys/fs/cgroup/openrc/${RC_SVCNAME}/tasks
fi