Pretty much the only case where we do NOT want to daemonize
a container start is lxc-start. So make c->daemonize true
by default, and have lxc-start set it to false.
If there are existing API users who rely on daemonize by
default, then they will be broken by this. It seems we should
do this before beta1 if we're going to do it.
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
conf->inherit_ns_fd[i] = fd;
}
- if (my_args.daemonize) {
- c->want_daemonize(c, true);
+ if (!my_args.daemonize) {
+ c->want_daemonize(c, false);
}
if (pid_fp != NULL) {
lxcapi_destroy(c);
lxcapi_clear_config(c);
}
+ c->daemonize = true;
// assign the member functions
c->is_defined = lxcapi_is_defined;
fprintf(stderr, "%d: failed to get extra ref to container\n", __LINE__);
exit(1);
}
+ c->want_daemonize(false);
pid_t pid = fork();
if (pid < 0) {
fprintf(stderr, "%d: fork failed\n", __LINE__);