]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
api change: default container->daemonize to true
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 13 Jan 2014 17:08:48 +0000 (11:08 -0600)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 14 Jan 2014 21:25:58 +0000 (16:25 -0500)
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>
src/lxc/lxc_start.c
src/lxc/lxccontainer.c
src/tests/startone.c

index e6ca3555806453f13bf8e8a18d5bcd973cec6c41..d5379daf7517414d521851496810c4db0c82faf9 100644 (file)
@@ -325,8 +325,8 @@ int main(int argc, char *argv[])
                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) {
index e5534158e9f58f7c4e9846b578de4394bad13736..8462ba581ebc297897a57a775042c5a09161c689 100644 (file)
@@ -3052,6 +3052,7 @@ struct lxc_container *lxc_container_new(const char *name, const char *configpath
                lxcapi_destroy(c);
                lxcapi_clear_config(c);
        }
+       c->daemonize = true;
 
        // assign the member functions
        c->is_defined = lxcapi_is_defined;
index 678f62e6b21c186ea0db9846972dbffc5a600de7..93992c1fc859608b08b4c0595549bb45cc00a3d6 100644 (file)
@@ -168,6 +168,7 @@ int main(int argc, char *argv[])
                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__);