From 0147416a2b8637ede0fc3d2f74a3adf1f6e78b2d Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Sat, 11 Nov 2017 00:21:09 +0100 Subject: [PATCH] lxccontainer: enable daemonized app containers This enables daemonized application containers with our minimal init running as pid one and the requested program running as second pid. Signed-off-by: Christian Brauner --- src/lxc/lxccontainer.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 5e8ad00f98..626bae0957 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -818,18 +818,6 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a if (!handler) return false; - if (useinit) { - TRACE("calling \"lxc_execute\""); - ret = lxc_execute(c->name, argv, 1, handler, c->config_path, - daemonize); - c->error_num = ret; - - if (ret != 0) - return false; - - return true; - } - /* If no argv was passed in, use lxc.init_cmd if provided in the * configuration */ @@ -1009,7 +997,10 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a goto on_error; } - ret = lxc_start(c->name, argv, handler, c->config_path, daemonize); + if (useinit) + ret = lxc_execute(c->name, argv, 1, handler, c->config_path, daemonize); + else + ret = lxc_start(c->name, argv, handler, c->config_path, daemonize); c->error_num = ret; if (conf->reboot == 1) {