Systemd can use one of three modes in regard to how it manages cgroups:
- legacy
- hybrid
- unified
How can I check which one is it using?
Systemd can use one of three modes in regard to how it manages cgroups:
How can I check which one is it using?
According to Lennart Poettering:
Try this:
stat -fc %T /sys/fs/cgroup/if that reports "cgroups2fs" then you are in full cgroupsv2 mode. If it returns "tmpfs" then you are in either full cgroupsv1 mode, or in hybrid mode. Then, check if /sys/fs/cgroup/unified exists. If it does, then you are in hybrid mode. if not you are in pure cgroupsv1 mode.
which translates to this shell code:
[ $(stat -fc %T /sys/fs/cgroup/) = "cgroup2fs" ] && echo "unified" || ( [ -e /sys/fs/cgroup/unified/ ] && echo "hybrid" || echo "legacy")