]> git.proxmox.com Git - mirror_lxc.git/commitdiff
decide whether daemonize implies close_all_fds at start
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 13 Jan 2015 05:07:28 +0000 (23:07 -0600)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 13 Jan 2015 05:07:28 +0000 (23:07 -0600)
This isn't the perfect fix.  In fact close_all_fds shouldn't be stored
in the lxc_conf.  But this will fix the tests short-term.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxccontainer.c

index 406cead1590f4be0f4cfc6fe06580b62f22b8b81..0d366873bf69a87beae11079b1349568208d7a5a 100644 (file)
@@ -466,9 +466,6 @@ static bool lxcapi_want_daemonize(struct lxc_container *c, bool state)
                return false;
        }
        c->daemonize = state;
-       /* daemonize implies close_all_fds so set it */
-       if (state == 1)
-               c->lxc_conf->close_all_fds = 1;
        container_mem_unlock(c);
        return true;
 }
@@ -609,6 +606,7 @@ static bool lxcapi_start(struct lxc_container *c, int useinit, char * const argv
        * while container is running...
        */
        if (daemonize) {
+               conf->close_all_fds = 1;
                lxc_monitord_spawn(c->config_path);
 
                pid_t pid = fork();