]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc_wait should start monitord
authorDwight Engen <dwight.engen@oracle.com>
Thu, 25 Apr 2013 16:21:53 +0000 (12:21 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 26 Apr 2013 07:54:29 +0000 (09:54 +0200)
If lxc_wait is called before the container has started the socket will not
yet have been created and lxc_wait's connect to it will fail. Starting the
daemon will create the socket for lxc_wait to connect to.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/state.c

index 4ab131a4cae52b94be72bbda99b2324e1b9989ad..68ec00ba012b12b997dc46f5d091a64f333a2072 100644 (file)
@@ -207,6 +207,9 @@ extern int lxc_wait(const char *lxcname, const char *states, int timeout, const
        if (fillwaitedstates(states, s))
                return -1;
 
+       if (lxc_monitord_spawn(lxcpath))
+               return -1;
+
        fd = lxc_monitor_open(lxcpath);
        if (fd < 0)
                return -1;