[lxc-devel] lxc-start hangs when starting a new container

Daniel Lezcano dlezcano at fr.ibm.com
Wed Jul 1 08:12:43 UTC 2009


Matty wrote:
> I have an lxc container that keeps hanging when I run 'lxc-start -n
> <GUEST NAME>'. When I strace lxc-start, I see the following:
> 
> $ strace lxc-start -n test
>    ..............
> open("/usr/local/var/lib/lxc/test/state", O_WRONLY) = 13
> flock(13, LOCK_EX)                      = 0
> ftruncate(13, 0)                        = 0
> write(13, "RUNNING"..., 7)              = 7
> close(13)                               = 0
> socket(PF_FILE, SOCK_DGRAM, 0)          = 13
> sendto(13, "\0\0\0\0test\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,
> 4104, 0, {sa_family=AF_FILE, path=@"lxc-monitor"...}, 110) = -1
> ECONNREFUSED (Connection refused)
> close(13)                               = 0
> close(13)                               = -1 EBADF (Bad file descriptor)
> close(14)                               = 0
> socket(PF_FILE, SOCK_STREAM, 0)         = 13
> bind(13, {sa_family=AF_FILE, path=@"test"...}, 110) = 0
> listen(13, 100)                         = 0
> fcntl(13, F_SETFD, FD_CLOEXEC)          = 0
> epoll_create(1)                         = 14
> epoll_ctl(14, EPOLL_CTL_ADD, 12, {EPOLLIN, {u32=17707440, u64=17707440}}) = 0
> epoll_ctl(14, EPOLL_CTL_ADD, 13, {EPOLLIN, {u32=17707504, u64=17707504}}) = 0
> 
> I starting the container with 2.6.[29-31pre] kernels and with the
> latest lxc code, and they all appear to exhibit this behavior. Has
> anyone seen this before? Any idea what the lxc-monitor socket is used
> for?

Hi Matty,

can you give more information about the container itself ?

What is the configuration ?

Is it an application or a distro you are trying to launch ?

Can you strace with the "-f" option, please ?

Concerning the lxc-monitor, the lxc-start will send some events saying 
the container is starting, stopping, aborting, ... through a af_unix 
socket called "@lxc-monitor". This socket is an unix abstract socket 
where the lxc-monitor command will listen to. If the lxc-monitor is not 
running the event goes to a blackhole. In the strace, the sendto fails 
because the lxc-monitor is not running but it is not considered as an 
error in the code but just a discarded event.

I am looking forward to enhance the af_netlink protocol to have 
inter-process network communication, so a backbone notification can be 
created and used by several monitoring processes. At present it is not 
possible, you can only run one monitor instance, this is a little 
restrictive :)

Thanks
   -- Daniel




More information about the lxc-devel mailing list