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

Fix docker detection with cgroups v2 #234

Merged
merged 1 commit into from
Feb 13, 2022

Conversation

lazyfrosch
Copy link
Contributor

On Debian bullseye there will not always be a string after the first colon.

Example:

0::/system.slice/docker-xxx.scope

It might make sense to change this for LXC as well...

On Debian bullseye there will not always be a string after the first colon.

Example:

    0::/system.slice/docker-xxx.scope
@lazyfrosch
Copy link
Contributor Author

It seems as if this issue is related to cgroups v2:

  1. For cgroups version 1 hierarchies, this field contains
    a comma-separated list of the controllers bound to the
    hierarchy. For the cgroups version 2 hierarchy, this
    field is empty.

https://man7.org/linux/man-pages/man7/cgroups.7.html

@lazyfrosch lazyfrosch changed the title Fix docker detection on newer Kernels Fix docker detection with cgroups v2 Feb 11, 2022
@liske liske merged commit a91d3d4 into liske:master Feb 13, 2022
@liske
Copy link
Owner

liske commented Feb 13, 2022

Thanks!

cc #235

@liske liske added this to the v3.6 milestone Feb 13, 2022
@lazyfrosch lazyfrosch deleted the fix/docker-scopes branch February 13, 2022 09:24
lathiat added a commit to lathiat/needrestart that referenced this pull request Mar 10, 2022
The second field is always blank in cgroups v2 unlike v1, adjust parsing to
support both cases for LXC/LXD and machined. This is the same fix as previously
made for Docker in liske#234.

Example: 0::/lxc.payload.focal/system.slice/avahi-daemon.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants