From b891d309c2060ebdc1c515fa06d6266ac2408208 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 12 Nov 2021 10:32:56 +0100 Subject: [PATCH] Make check for privileged container work with cgroup v2 When running on top of a distribution using cgroup v2 (Debian Bullseye, Fedora >= 31, Arch), creating a file at the base of the hierarchy is not possible. However, we can create a directory. --- src/system_check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system_check.sh b/src/system_check.sh index fb8a83f..002ebf3 100755 --- a/src/system_check.sh +++ b/src/system_check.sh @@ -44,7 +44,7 @@ else fi echo -n "Check for container privileged mode ...... " -echo "hello" 2>/dev/null > /sys/fs/cgroup/aaa +mkdir /sys/fs/cgroup/aaa 2> /dev/null if [ $? -eq 0 ]; then echo yes else