Skip to content

libcontainer: Skip cgroup creation for rootless containers with cgroupfs#3146

Open
vadorovsky wants to merge 1 commit intoyouki-dev:mainfrom
vadorovsky:cgroupfs-rootless-warning
Open

libcontainer: Skip cgroup creation for rootless containers with cgroupfs#3146
vadorovsky wants to merge 1 commit intoyouki-dev:mainfrom
vadorovsky:cgroupfs-rootless-warning

Conversation

@vadorovsky
Copy link
Copy Markdown

Creating cgroups with cgroupfs as non-root is not possible. Before this change, we used to enforce systemd as a cgroup manager for all rootless containers, but that prevents the usage of rootless youki on systems wuthout systemd. To make such usage possible, raise a warning and skip cgroup-related activities instead. That matches the behavior of crun (containers/crun#97).

Description

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test updates
  • CI/CD related changes
  • Other (please describe):

Testing

  • Added new unit tests
  • Added new integration tests
  • Ran existing test suite
  • Tested manually (please provide steps)

Related Issues

Fixes #3144

Additional Context

Creating cgroups with cgroupfs as non-root is not possible. Before this
change, we used to enforce systemd as a cgroup manager for all rootless
containers, but that prevents the usage of rootless youki on systems
wuthout systemd. To make such usage possible, raise a warning and skip
cgroup-related activities instead. That matches the behavior of crun
(containers/crun#97).

Fixes youki-dev#3144

Signed-off-by: Michal Rostecki <vadorovsky@disroot.org>
@vadorovsky vadorovsky force-pushed the cgroupfs-rootless-warning branch from e918f58 to d8198be Compare April 11, 2025 05:50
@contra-bit
Copy link
Copy Markdown

I would be very great-full to the youki maintainers if they could merge this PR. This would allow me to use libcontainer rootless on non-systemd systems such as alpine linux.
Getting this into the next release would also benefit downstream such as syd-oci.

I can try to address any blockers, if there any :)

@utam0k
Copy link
Copy Markdown
Member

utam0k commented Jan 16, 2026

Sorry for being late. I'll review this PR this week or next week.

@utam0k
Copy link
Copy Markdown
Member

utam0k commented Jan 18, 2026

How about creating a dedicated cgroup manager for that case?

@utam0k
Copy link
Copy Markdown
Member

utam0k commented Apr 4, 2026

@vadorovsky Do you need any help from the maintainer?

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.

[Bug]: libcontainer/libcgroup: rootless containers are trying to use systemd as cgroup manager, even if systemd is not present

3 participants