Comment 1 for bug 948623

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 948623] [NEW] Can't start more than 35 containers on my machine

> lxc-start 1331084251.275 ERROR lxc_utmp - Too many open files - failed to inotify_init

Note I don't know that just stopping utmp watching will help this, however,

> lxc-start 1331084251.275 ERROR lxc_start - failed to add utmp handler to mainloop
> lxc-start 1331084251.275 ERROR lxc_start - mainloop exited with an error
> lxc-start 1331084251.276 DEBUG lxc_cgroup - get_init_cgroup: found init cgroup for subsys (null) at /
>
>
> lxc-start 1331084251.276 DEBUG lxc_cgroup - destroying /sys/fs/cgroup/cpuset//lxc/test40
>
> lxc-start 1331084251.276 ERROR lxc_cgroup - Device or resource
> busy - failed to remove cgroup '/sys/fs/cgroup/cpuset//lxc/test40'
>
>
> Which seems odd as we're not supposed to use that in 12.04 now that we have the kernel patch right?

Well this is embarassing.

The code to check whether utmp needs to be checked is run in a thread
which is actually cloned from the code which uses it. We need to
run must_drop_cap_sys_boot() earlier and cache its results in the
handler for both lxc_poll() and the do_start() which is run by a new
thread in lxc_spawn().

So, the check of must_drop_cap_sys_boot() should be run right before
lxc_spawn() is called in __lxc_start(), the results cached in
handler->conf, and used in do_start() (to decide whether to drop
caps) and lxc_poll() (to decide whether to watch utmp).

I can do this next week if you don't get to it first.