aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2021-04-04 17:30:03 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2021-04-04 17:31:49 -0500
commit533a8c70b3b757d2ca06de7392805ab5d1698a53 (patch)
tree31edff6e031b6c325d07a6e22987c0654fe06657 /sh
parent852a3c86f66829864d5c0b7d0bd88841ac6b23a8 (diff)
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.
Diffstat (limited to 'sh')
-rw-r--r--sh/rc-cgroup.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/sh/rc-cgroup.sh b/sh/rc-cgroup.sh
index fafc3b37..392c8b3d 100644
--- a/sh/rc-cgroup.sh
+++ b/sh/rc-cgroup.sh
@@ -189,6 +189,7 @@ cgroup2_set_limits()
{
local cgroup_path
cgroup_path="$(cgroup2_find_path)"
+ [ -z "${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}"