From ee94c1279ae653f95bca8766d7bfb3db832dea2a Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Wed, 1 Feb 2017 09:32:59 +0100 Subject: [PATCH] marsadm: safeguard rsync at join-cluster --- userspace/marsadm | 47 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/userspace/marsadm b/userspace/marsadm index 60249e8e..4d305902 100755 --- a/userspace/marsadm +++ b/userspace/marsadm @@ -155,13 +155,15 @@ sub make_ssh_cmd { } sub ssh_cmd { - my ($peer, $cmd) = @_; + my ($peer, $cmd, $no_fail) = @_; my $ssh = make_ssh_cmd($peer) . " \"$cmd\""; - system $ssh or ldie "SSH to '$peer' command '$cmd' failed\n"; + if (system ($ssh) && defined($no_fail)) { + ldie "SSH to '$peer' command '$cmd' failed\nFull command: '$ssh'\n"; + } } sub rsync_cmd { - my ($peer, $cmd) = @_; + my ($peer, $cmd, $no_fail) = @_; my ($real_peer, $port, $ssh) = make_ssh_cmd($peer, 1); $cmd =~ s/(?