Commit 7943ec56 by Tycho Andersen Committed by Serge Hallyn

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 <tycho.andersen at canonical.com> Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
parent 2ba7a429
...@@ -154,6 +154,11 @@ bool restore(struct lxc_container *c) ...@@ -154,6 +154,11 @@ bool restore(struct lxc_container *c)
pid = fork(); pid = fork();
if (pid == 0) { if (pid == 0) {
if (my_args.daemonize) {
close(0);
close(1);
}
ret = c->restore(c, checkpoint_dir, verbose); ret = c->restore(c, checkpoint_dir, verbose);
if (!ret) { if (!ret) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment