int ret;
struct lxc_handler *handler;
struct lxc_conf *conf;
- bool daemonize = false;
char *default_args[] = {
"/sbin/init",
NULL,
return false;
conf = c->lxc_conf;
- daemonize = c->daemonize;
/* initialize handler */
- handler = lxc_init_handler(c->name, conf, c->config_path, daemonize);
+ handler = lxc_init_handler(c->name, conf, c->config_path, c->daemonize);
container_mem_unlock(c);
if (!handler)
* here to protect the on disk container? We don't want to exclude
* things like lxc_info while the container is running.
*/
- if (daemonize) {
+ if (c->daemonize) {
bool started;
char title[2048];
pid_t pid;
SYSERROR("Failed to write monitor pid to \"%s\"", c->pidfile);
- if (daemonize)
+ if (c->daemonize)
_exit(EXIT_FAILURE);
return false;
SYSERROR("Failed to write '%s'", c->pidfile);
- if (daemonize)
+ if (c->daemonize)
_exit(EXIT_FAILURE);
return false;
reboot:
if (conf->reboot == 2) {
/* initialize handler */
- handler = lxc_init_handler(c->name, conf, c->config_path, daemonize);
+ handler = lxc_init_handler(c->name, conf, c->config_path, c->daemonize);
if (!handler) {
ret = 1;
goto on_error;
keepfds[0] = handler->conf->maincmd_fd;
keepfds[1] = handler->state_socket_pair[0];
keepfds[2] = handler->state_socket_pair[1];
- ret = lxc_check_inherited(conf, daemonize, keepfds,
+ ret = lxc_check_inherited(conf, c->daemonize, keepfds,
sizeof(keepfds) / sizeof(keepfds[0]));
if (ret < 0) {
lxc_free_handler(handler);
}
if (useinit)
- ret = lxc_execute(c->name, argv, 1, handler, c->config_path, daemonize, &c->error_num);
+ ret = lxc_execute(c->name, argv, 1, handler, c->config_path,
+ c->daemonize, &c->error_num);
else
- ret = lxc_start(c->name, argv, handler, c->config_path, daemonize, &c->error_num);
+ ret = lxc_start(c->name, argv, handler, c->config_path,
+ c->daemonize, &c->error_num);
if (conf->reboot == 1) {
INFO("Container requested reboot");
}
free_init_cmd(init_cmd);
- if (daemonize && ret != 0)
+ if (c->daemonize && ret != 0)
_exit(EXIT_FAILURE);
- else if (daemonize)
+ else if (c->daemonize)
_exit(EXIT_SUCCESS);
if (ret != 0)