[lxc-devel] lxc-start: Failed to find current cgroup

Serge Hallyn serge.hallyn at ubuntu.com
Sat Aug 17 13:29:36 UTC 2013


Quoting Harald Dunkel (harri at afaics.de):
> Hi folks,
> 
> Using the current (d24d56d7ee3420bb79238ff84cad07c20cf4757d)
> version lxc-start gives me
> 
> # lxc-start -n lxc0
> lxc-start: Failed to find current cgroup
> lxc-start: Out of memory reading cgroups
> lxc-start: failed to spawn 'lxc0'
> 
> The same container worked before for the lxc version checked out
> on 130811. Unfortunately I don't have the ID for git.
> 
> 
> ???
> Every helpful hint is highly appreciated.

Sounds like my fault then.  Can you please show:

	grep cgroup /proc/self/mountinfo
	cat /proc/self/cgroup
	cat /proc/cgroups

and then do

	lxc-start -n lxc0 -l info -o debug.out

and attach debug.out?

Actually I suspect I know what happened.  find_real_cgroup() doesn't
look like how I remember doing it.  Could you try the below
(untested) patch?  It'll enter you in a per-container subdir in
the name=systemd cgroup, which we didn't use to do.  But it may
be what we want to do in the future case of unprivileged starts
anyway.

[PATCH 1/1] find_free_cgroup: don't ignore cgroup mounts without subsystems

If we are storing it, then store our current cgroup.  We might
want to ignore it, but failing was the wrong thing to do in any
case.

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
---
 src/lxc/cgroup.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c
index d2737ea..8caba59 100644
--- a/src/lxc/cgroup.c
+++ b/src/lxc/cgroup.c
@@ -755,13 +755,6 @@ static bool find_real_cgroup(struct cgroup_desc *d, char *path)
 		return false;
 	}
 
-	// If there is no subsystem, ignore the mount.  Note we may want
-	// to change this, so that unprivileged users can use a unbound
-	// cgroup mount to arrange their container tasks.
-	if (!d->subsystems) {
-		fclose(f);
-		return false;
-	}
 	while (getline(&line, &len, f) != -1) {
 		if (!(p = index(line, ':')))
 			continue;
-- 
1.8.3.2





More information about the lxc-devel mailing list