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 7982b83 commit 0147416
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/lxc/lxccontainer.c
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 0147416

Please sign in to comment.