5

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?

5

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")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.