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: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 9873ed36
...@@ -812,18 +812,6 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a ...@@ -812,18 +812,6 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
if (!handler) if (!handler)
return false; 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 /* If no argv was passed in, use lxc.init_cmd if provided in the
* configuration * configuration
*/ */
...@@ -1003,6 +991,9 @@ reboot: ...@@ -1003,6 +991,9 @@ reboot:
goto on_error; goto on_error;
} }
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); ret = lxc_start(c->name, argv, handler, c->config_path, daemonize);
c->error_num = ret; c->error_num = ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment