Skip to content

Commit

Permalink
lxccontainer: enable daemonized app containers
Browse files Browse the repository at this point in the history
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 <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Nov 11, 2017
1 parent 9873ed3 commit acd8bbf
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/lxc/lxccontainer.c
Expand Up @@ -812,18 +812,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
*/
Expand Down Expand Up @@ -1003,7 +991,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) {
Expand Down

0 comments on commit acd8bbf

Please sign in to comment.