cgroup2_set_limits: fix harmless error message

In legacy cgroups mode, we were running `mountinfo -q ""` which was
generating an error message. If we return immediately when
cgroup2_find_path returns an empty value, we avoid this message.
This commit is contained in:
William Hubbs 2021-04-04 17:30:03 -05:00
parent 852a3c86f6
commit 533a8c70b3

View File

@ -189,6 +189,7 @@ cgroup2_set_limits()
{ {
local cgroup_path local cgroup_path
cgroup_path="$(cgroup2_find_path)" cgroup_path="$(cgroup2_find_path)"
[ -z "${cgroup_path}" ] && return 0
mountinfo -q "${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}"