]> arthur.barton.de Git - bup.git/commit
on: handle remote stdout and stderr via mux
authorRob Browning <rlb@defaultvalue.org>
Sun, 9 Nov 2014 00:32:55 +0000 (18:32 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sun, 1 Feb 2015 19:05:08 +0000 (13:05 -0600)
commitc4846ab44a9f4b182715ec413a3fc1b8334e5107
tree5d89cfda34ff57a5662b13b135fe0d9764672f4f
parent408d5c2504ebfe6888548fd1974ca1f18511d4f9
on: handle remote stdout and stderr via mux

Previously, when running "bup on" (i.e. when in BUP_SERVER_REVERSE
mode), bup would redirect the remote command's stdout to stderr because
stderr is the only remaining avenue back to the local console.  It's the
only avenue because in reverse mode, stdout (and stdin) are connected
back to a local "bup server" instance (hence the "reverse").

Of course that makes it impossible to reliably capture the
non-diagnostic output from the remote commands, i.e.

  commit_id="$(bup on HOST save -t ...)"

To fix that, in the remote "bup on--server" multiplex the stdout and
stderr from all "bup on" subcommands with "bup mux", and then
demultiplex those streams back to the local stdout and stderr via
DemuxConn() in the receiving "bup on".

Thanks to Alexander Barton for pointing out an error in a previous
version of this commit message, and thanks to Gabriel Filion for
pointing out that we could use the existing mux infrastructure instead
of reinventing the wheel.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
cmd/on--server-cmd.py
cmd/on-cmd.py
lib/bup/ssh.py
t/test-on.sh