[Lxc-users] can't restart container without rebooting entire host, because can't delete cgroups files, tasks is 0

Serge E. Hallyn serge.hallyn at canonical.com
Fri Nov 5 20:27:30 UTC 2010


Quoting Miroslav Lednicky (lednicky at avonet.cz):
> Hello,
> 
> 	it is the same problem as I have may be:
> 
> http://sourceforge.net/mailarchive/forum.php?thread_name=4CD297E2.2030806%40avonet.cz&forum_name=lxc-users
> 
> I don't know what can I do with it.
> 
> Server reboot is necessary ...

I fired off a container and did a bunch of ns_exec's under it to create
some cgroup subdirectories.  When I powered off the container, lxc did
indeed complain about not being able to remove /cgroup/ubuntu1.  I did

	find /cgroup/ubuntu1 -type d -print0 | xargs -0 rmdir

which deleted the subdirectories and complainted about not being able
to remove ubuntu1 itself.  Then I did 'rmdir /cgroup/ubuntu1' and it
worked.

So the only problem with my find statement is that it doesn't work
depth-first, so you might have to do it a few times to get all of the
subdirectories.

Daniel, I think it would be worthwhile for lxc, on exiting a container,
to do a depth-first search or all directories under the container's
cgroup, and rmdir them all.  What do you think?

-serge




More information about the lxc-users mailing list