-
Notifications
You must be signed in to change notification settings - Fork 935
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
LXD on OpenRC host not mounting cgroups in containers #4052
Comments
This has nothing to do with LXD actually. If cgroup namespaces are supported by your kernel (Which they should given your version.) liblxc will leave it up to the init system inside the container to mount cgroups or not. If openrc inside the container doesn't do it automatically or is not told to do so then there's nothing LXD can do. |
How can I tell openrc to mount it inside container? |
I'm not an openrc expert but https://wiki.gentoo.org/wiki/OpenRC/CGroups . |
OK, thanks. Will look into it and report back. Is discuss a better platform for this or should I use github issues? |
Discuss would probably be better for this. :) But are cgroups mounted on your gentoo with openrc host? |
Yes, they are. host# mount|grep cgroup
|
You said that this is an issue for openrc containers, does that mean that other containers successfully mount their own cgroups? |
For example xenial image from images: after mounting cgroup for systemd on the host starts without problems. On host:
Container:
|
This is the mount from the host:
|
As I said, with cgroup namespaces it is up to the init system to mount cgroups not liblxc. |
OK, will check OpenRC. Thanks for help. |
Just for reference, if someone knows how to solve this on OpenRC I have opened couple of threads. See: |
If openrc should be in charge of mounting cgroups, there is a solution to this (workaround). I have put my workaround in the issue report on OpenRC so go and read it there, please. |
Right, LXC/LXD's behavior is to setup the cgroup namespace in a way where the init system can do its normal cgroup configuration job. On systems which lack the cgroup namespce, lxcfs will then be used to fake a cgroup namespace through pre-mounted fuse. So looks like everything is working as designed here, except for the part where openrc should actually try to mount the cgroups inside a container (as systemd does). |
Fixed in openrc |
@palicia, for future reference I've also added logic to LXC to allow users to force cgroup mounting even when cgroup namespaces are enabled. |
how do you do that? do you have any doc? |
With |
Required information
Issue description
Running gentoo with openrc and LXD 2.20 as the host - the containers that are created as openrc containers don't get cgroups mounted.
Steps to reproduce
Information to attach
dmesg
)lxc info NAME --show-log
)lxc config show NAME --expanded
)The text was updated successfully, but these errors were encountered: