diff options
author | William Hubbs <williamh@gentoo.org> | 2012-01-26 22:09:07 -0600 |
---|---|---|
committer | William Hubbs <williamh@gentoo.org> | 2012-01-26 22:09:07 -0600 |
commit | ab9cf25197bccaff72d636f511b876aa2c379fdb (patch) | |
tree | 3a11d8e2beaa215cefb8ff0a6b62b172a9154333 /sh/runscript.sh.in | |
parent | 7ea5c614d9c9e36c55f1da3d7fb894e83bbb56f3 (diff) |
cgroups: add all services to the openrc cgroup
This is a modified version of a patch originally submitted by
Patrick Lauer <patrick@gentoo.org>.
Diffstat (limited to 'sh/runscript.sh.in')
-rw-r--r-- | sh/runscript.sh.in | 8 |
1 files changed, 8 insertions, 0 deletions
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} |