Skip to content

Commit

Permalink
--init=systemd: check cgroup version with statfs #349
Browse files Browse the repository at this point in the history
  • Loading branch information
mviereck committed Feb 11, 2022
1 parent 669a65e commit 3d68645
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions x11docker
Expand Up @@ -7282,11 +7282,15 @@ check_host() { # check host environment
Hostlibc="unknown"
ldd --version 2>&1 | grep -q 'musl libc' && Hostlibc='musl'
ldd --version 2>&1 | grep -q -E 'GLIBC|GNU libc' && Hostlibc='glibc'

# Check cgroup version
grep -q '^0:' /proc/self/cgroup && Cgroupversion="v2" || Cgroupversion="v1"

# cgroup version
case "$(stat -c"%T" -f /sys/fs/cgroup)" in
tmpfs) Cgroupversion="v1" ;;
cgroup2fs) Cgroupversion="v2" ;;
*) Cgroupversion="UNKNOWN" ;;
esac
debugnote "Detected cgroup $Cgroupversion"

# Check host time zone
Hostlocaltimefile="$(myrealpath /etc/localtime)" # Find time zone file in /usr/share/zoneinfo
[ -e "$Hostlocaltimefile" ] || Hostlocaltimefile=""
Expand Down

0 comments on commit 3d68645

Please sign in to comment.