From: Christian Brauner Date: Fri, 10 Nov 2017 23:21:09 +0000 (+0100) Subject: lxccontainer: enable daemonized app containers X-Git-Tag: lxc-3.0.0.beta1~186^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9605460f1cbaec5d65f6dc7bc6fa6aca9addfd3d;p=thirdparty%2Flxc.git 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 --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 7c5b504b6..ab2a5fc73 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -842,18 +842,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 */ @@ -1033,7 +1021,10 @@ reboot: 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) {