]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-checkpoint: close stdout/stdin when daemonizing
authorTycho Andersen <tycho.andersen@canonical.com>
Tue, 30 Sep 2014 21:35:13 +0000 (21:35 +0000)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 8 Oct 2014 20:18:53 +0000 (15:18 -0500)
If we don't close these running lxc-checkpoint via:

ssh host "sudo lxc-checkpoint ..."

just hangs. We leave stderr open so that subesquent errors will print correctly
(and also because for whatever reason it doesn't break ssh :).

Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxc_checkpoint.c

index 698e4342bd83de59ce03ff7a37cf00f3fbe62761..cfa08fc0d97babdadcad977142b6ef99416d77c3 100644 (file)
@@ -154,6 +154,11 @@ bool restore(struct lxc_container *c)
                pid = fork();
 
        if (pid == 0) {
+               if (my_args.daemonize) {
+                       close(0);
+                       close(1);
+               }
+
                ret = c->restore(c, checkpoint_dir, verbose);
 
                if (!ret) {