aboutsummaryrefslogtreecommitdiff
path: root/sh/openrc-run.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'sh/openrc-run.sh.in')
-rw-r--r--sh/openrc-run.sh.in9
1 files changed, 6 insertions, 3 deletions
diff --git a/sh/openrc-run.sh.in b/sh/openrc-run.sh.in
index 95d0ecab..e3dff6ce 100644
--- a/sh/openrc-run.sh.in
+++ b/sh/openrc-run.sh.in
@@ -260,9 +260,12 @@ for _cmd; do
# Apply cgroups settings if defined
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