aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorE5ten <ethancsommer@gmail.com>2019-08-27 11:48:21 -0400
committerWilliam Hubbs <william.hubbs@sony.com>2019-09-03 16:38:03 -0500
commit87cfad3d6cd619c6090e8209092448ae68279b0c (patch)
tree068d1ddb5905f547992f2a88e94252f3da6cac19
parent8e31614c4b6679fc1bc1f1d1e0779dcedd066a5a (diff)
cgroup2_set_limits: verify that the cgroup2 path is a mount point
prior to cgroups getting mounted, /sys/fs/cgroup will still exist, but attempts to make directories in it will fail, change cgroup2_set_limits() to verify that cgroups are mounted instead of just checking that /sys/fs/cgroup exists. This fixes #307. This fixes #321.
-rw-r--r--sh/rc-cgroup.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/sh/rc-cgroup.sh b/sh/rc-cgroup.sh
index 5d24344d..77d56dd1 100644
--- a/sh/rc-cgroup.sh
+++ b/sh/rc-cgroup.sh
@@ -181,7 +181,7 @@ cgroup2_set_limits()
{
local cgroup_path
cgroup_path="$(cgroup2_find_path)"
- [ -d "${cgroup_path}" ] || return 0
+ mountinfo -q "${cgroup_path}"|| return 0
rc_cgroup_path="${cgroup_path}/${RC_SVCNAME}"
[ ! -d "${rc_cgroup_path}" ] && mkdir "${rc_cgroup_path}"
[ -f "${rc_cgroup_path}"/cgroup.procs ] &&