diff options
Diffstat (limited to 'sh')
-rw-r--r-- | sh/openrc-run.sh.in | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/sh/openrc-run.sh.in b/sh/openrc-run.sh.in index c3b38107..ed565a46 100644 --- a/sh/openrc-run.sh.in +++ b/sh/openrc-run.sh.in @@ -271,23 +271,25 @@ for _cmd; do fi fi # Apply cgroups settings if defined - if [ "$(command -v cgroup_add_service)" = "cgroup_add_service" ] - then - if grep -qs /sys/fs/cgroup /proc/1/mountinfo + if [ "${RC_USER_SERVICES}" != "YES" ]; then + if [ "$(command -v cgroup_add_service)" = "cgroup_add_service" ] then - if [ -d /sys/fs/cgroup -a ! -w /sys/fs/cgroup ]; then - eerror "No permission to apply cgroup settings" - break + if grep -qs /sys/fs/cgroup /proc/1/mountinfo + then + if [ -d /sys/fs/cgroup -a ! -w /sys/fs/cgroup ]; then + eerror "No permission to apply cgroup settings" + break + fi fi + cgroup_add_service fi - cgroup_add_service + [ "$(command -v cgroup_set_limits)" = "cgroup_set_limits" ] && + cgroup_set_limits + [ "$(command -v cgroup2_set_limits)" = "cgroup2_set_limits" ] && + [ "$_cmd" = start ] && + cgroup2_set_limits + break fi - [ "$(command -v cgroup_set_limits)" = "cgroup_set_limits" ] && - cgroup_set_limits - [ "$(command -v cgroup2_set_limits)" = "cgroup2_set_limits" ] && - [ "$_cmd" = start ] && - cgroup2_set_limits - break fi done |