[lxc-users] Disappearing cgroups

Serge E. Hallyn serge at hallyn.com
Tue Oct 8 13:53:23 UTC 2019


On Tue, Oct 08, 2019 at 02:34:23PM +0100, Ben Green wrote:
> Quoting "Serge E. Hallyn" <serge at hallyn.com>:
> 
> > > 
> > > I'm not sure it will be this, as the loss of cgroups happens at random
> > > and I've not been able to find an associated login/logout event. It did
> > 
> > Oh, yeah, then that probably isn't it.
> 
> Thanks for thinking about this, it so hard as this is stopping me using LXC
> in production and I really want to be able to do that. For more information
> I created a script to figure out where the container was running, which user
> started it and which cgroups were attached. I found the exact moment they
> disappeared:

BTW, much as I'd like to get to the bottom of this, let's get you up
and running first.  I'd suggest you create a systemd service which starts
at boot which creates and configures cgroups called /sys/fs/cgroup/*/forcontainers
and chowns them to your userid.  Then for convenience a enter-container-cgroups
script which just does echo $$ > /sys/fs/cgroup/*/forcontainers/tasks.  Then
just run enter-container-cgroups before you lxc-start -n containerX

-serge


More information about the lxc-users mailing list