From ab9cf25197bccaff72d636f511b876aa2c379fdb Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Thu, 26 Jan 2012 22:09:07 -0600 Subject: [PATCH] cgroups: add all services to the openrc cgroup This is a modified version of a patch originally submitted by Patrick Lauer . --- sh/runscript.sh.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in index 3b910017..344e31c6 100644 --- a/sh/runscript.sh.in +++ b/sh/runscript.sh.in @@ -194,6 +194,14 @@ unset _conf_d # Load any system overrides sourcex -e "@SYSCONFDIR@/rc.conf" +if [ "$RC_UNAME" = "Linux" ]; 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 + #todo: add processes to cgroups based on settings in conf.d +fi + # Apply any ulimit defined [ -n "${rc_ulimit:-$RC_ULIMIT}" ] && ulimit ${rc_ulimit:-$RC_ULIMIT}