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.
This commit is contained in:
parent
8e31614c4b
commit
87cfad3d6c
@ -181,7 +181,7 @@ cgroup2_set_limits()
|
|||||||
{
|
{
|
||||||
local cgroup_path
|
local cgroup_path
|
||||||
cgroup_path="$(cgroup2_find_path)"
|
cgroup_path="$(cgroup2_find_path)"
|
||||||
[ -d "${cgroup_path}" ] || return 0
|
mountinfo -q "${cgroup_path}"|| return 0
|
||||||
rc_cgroup_path="${cgroup_path}/${RC_SVCNAME}"
|
rc_cgroup_path="${cgroup_path}/${RC_SVCNAME}"
|
||||||
[ ! -d "${rc_cgroup_path}" ] && mkdir "${rc_cgroup_path}"
|
[ ! -d "${rc_cgroup_path}" ] && mkdir "${rc_cgroup_path}"
|
||||||
[ -f "${rc_cgroup_path}"/cgroup.procs ] &&
|
[ -f "${rc_cgroup_path}"/cgroup.procs ] &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user