From: Tycho Andersen Date: Tue, 30 Sep 2014 21:35:13 +0000 (+0000) Subject: lxc-checkpoint: close stdout/stdin when daemonizing X-Git-Tag: lxc-1.1.0.alpha3~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7943ec56e9c32d5dc2c187730d0a7b784c494d2a;p=thirdparty%2Flxc.git lxc-checkpoint: close stdout/stdin when daemonizing 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 Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/lxc_checkpoint.c b/src/lxc/lxc_checkpoint.c index 698e4342b..cfa08fc0d 100644 --- a/src/lxc/lxc_checkpoint.c +++ b/src/lxc/lxc_checkpoint.c @@ -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) {