Commit ebfeee2 1 parent 3b6d1f8 commit ebfeee2 Copy full SHA for ebfeee2
File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -63,10 +63,18 @@ cgroupfs_mount() {
63
63
# see also https://github.com/tianon/cgroupfs-mount/blob/master/cgroupfs-mount
64
64
if grep -v ' ^#' /etc/fstab | grep -q cgroup \
65
65
|| [ ! -e /proc/cgroups ] \
66
- || [ ! -d /sys/fs/cgroup ]; then
66
+ || [ ! -d /sys/fs/cgroup ] \
67
+ || [ " $( stat -fc ' %T' /sys/fs/cgroup) " = " cgroup2fs" ]; then
67
68
return
68
69
fi
69
70
if ! mountpoint -q /sys/fs/cgroup; then
71
+ # cgroup2
72
+ # https://github.com/systemd/systemd/blob/5c6c587ce24096d36826418b5390599d1e5ad55c/src/shared/cgroup-setup.c#L35-L74
73
+ if awk ' !/^#/ && $4 == 1 && $2 != 0 { count++ } END { exit count != 0 }' /proc/cgroups; then
74
+ mount -t cgroup2 cgroup2 /sys/fs/cgroup
75
+ return
76
+ fi
77
+ # cgroup1
70
78
mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup
71
79
fi
72
80
(
You can’t perform that action at this time.
0 commit comments