Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect which systemd cgroup mode is used #27

Open
wentasah opened this issue Sep 21, 2020 · 0 comments
Open

Detect which systemd cgroup mode is used #27

wentasah opened this issue Sep 21, 2020 · 0 comments

Comments

@wentasah
Copy link
Member

The modes are described here. Currently, we hardcode support only for the hybrid mode.

From the above linked document:

If you wonder how to detect which of these three modes is currently used, use
statfs() on /sys/fs/cgroup/. If it reports CGROUP2_SUPER_MAGIC in its
.f_type field, then you are in unified mode. If it reports TMPFS_MAGIC then
you are either in legacy or hybrid mode. To distinguish these two cases, run
statfs() again on /sys/fs/cgroup/unified/. If that succeeds and reports
CGROUP2_SUPER_MAGIC you are in hybrid mode, otherwise not.
From a shell, you can use check the Type in stat -f /sys/fs/cgroup and
stat -f /sys/fs/cgroup/unified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant