Commit dccee4e8 authored by Rowan Thorpe's avatar Rowan Thorpe Committed by Brad Davidson

Fix regression from commit 137e80cd

Problem: A false-negative in check-config.sh for cgroups v2 systems was fixed but the commit introduced a regression based on a small assumption that content of /sys/fs/cgroup/cgroup.controllers would have the same format as the content of /proc/self/cgroup. It doesn't. Solution: This just tweaks the regex to count occurrences of either cgroup subsystem-names on each line (as occurs in the sysfs pseudo-file), or those names with colons either side (as occurs in the procfs pseudo-file). Signed-off-by: 's avatarRowan Thorpe <rowan@rowanthorpe.com>
parent 7a36c3f7
......@@ -341,7 +341,7 @@ case "${cgroupVariant}" in
cgroupFile='/proc/self/cgroup'
;;
esac
if [ "$(tr -s ' ' '\n' <"${cgroupFile}" 2>/dev/null | grep -Ec "^(${cgroupMatch})\$")" -eq ${cgroupMatchNum} ]; then
if [ "$(tr -s ' ' '\n' <"${cgroupFile}" 2>/dev/null | grep -Ec "(^|:)(${cgroupMatch})(\$|:)")" -eq ${cgroupMatchNum} ]; then
cgroupStatus='good'
else
cgroupStatus='bad'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment