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

cgroup: ignore rootless errors if manager != systemd #97

Merged
merged 1 commit into from
Sep 19, 2019

Conversation

giuseppe
Copy link
Member

on an unified hierarchy ignore cgroups errors if running in a user
namespace and the manager != systemd. It is the same behaviour that
exists on cgroup v1.

The issue caused the default buildah configuration to fail when
running as rootless on cgroups v2.

Signed-off-by: Giuseppe Scrivano giuseppe@scrivano.org

@giuseppe
Copy link
Member Author

/cc @nalind @rhatdan

@giuseppe giuseppe force-pushed the cgroupfs-ignore-rootless-errors branch from 47b1655 to fa1b6f3 Compare September 19, 2019 08:30
@@ -914,8 +914,9 @@ libcrun_cgroup_enter (oci_container_linux_resources *resources, int cgroup_mode,
return ret;
}

if (rootless > 0 && cgroup_mode != CGROUP_MODE_UNIFIED)
if (rootless > 0 && (cgroup_mode != CGROUP_MODE_UNIFIED || manager != CGROUP_MANAGER_SYSTEMD))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we at least log a debug message if manager != SYSTEMD?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a warning when manager != SYSTEMD and running on cgroups v2

@giuseppe giuseppe force-pushed the cgroupfs-ignore-rootless-errors branch from fa1b6f3 to 986ed08 Compare September 19, 2019 10:21
on an unified hierarchy ignore cgroups errors if running in a user
namespace and the manager != systemd.  It is the same behaviour that
exists on cgroup v1.

The issue caused the default buildah configuration to fail when
running as rootless on cgroups v2.

Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
@giuseppe giuseppe force-pushed the cgroupfs-ignore-rootless-errors branch from 986ed08 to 164e00b Compare September 19, 2019 10:22
@rhatdan
Copy link
Member

rhatdan commented Sep 19, 2019

LGTM
Merge once tests pass.

@giuseppe
Copy link
Member Author

tests are green, merging

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

Successfully merging this pull request may close these issues.

2 participants