From: Serge Hallyn Date: Tue, 13 Jan 2015 05:07:28 +0000 (-0600) Subject: decide whether daemonize implies close_all_fds at start X-Git-Tag: lxc-2.1.1~1180 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=db2930e17441d39caaa61b52ecf4116504107a26;p=mirror_lxc.git decide whether daemonize implies close_all_fds at start 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 --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 406cead15..0d366873b 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -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();