summaryrefslogtreecommitdiff
path: root/contrib/check-config.sh
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/check-config.sh')
-rwxr-xr-xcontrib/check-config.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/check-config.sh b/contrib/check-config.sh
index 09c2c91d5f..4240684bc9 100755
--- a/contrib/check-config.sh
+++ b/contrib/check-config.sh
@@ -163,7 +163,7 @@ printf -- '- '
if [ "$(stat -f -c %t /sys/fs/cgroup 2> /dev/null)" = '63677270' ]; then
wrap_good 'cgroup hierarchy' 'cgroupv2'
else
- cgroupSubsystemDir="$(awk '/[, ](cpu|cpuacct|cpuset|devices|freezer|memory)[, ]/ && $3 == "cgroup" { print $2 }' /proc/mounts | head -n1)"
+ cgroupSubsystemDir="$(sed -rne '/^[^ ]+ ([^ ]+) cgroup ([^ ]*,)?(cpu|cpuacct|cpuset|devices|freezer|memory)[, ].*$/ { s//\1/p; q }' /proc/mounts)"
cgroupDir="$(dirname "$cgroupSubsystemDir")"
if [ -d "$cgroupDir/cpu" ] || [ -d "$cgroupDir/cpuacct" ] || [ -d "$cgroupDir/cpuset" ] || [ -d "$cgroupDir/devices" ] || [ -d "$cgroupDir/freezer" ] || [ -d "$cgroupDir/memory" ]; then
echo "$(wrap_good 'cgroup hierarchy' 'properly mounted') [$cgroupDir]"