diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 0f65621ba1..9146f80137 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -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 */ @@ -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) {