17b94a
From de24d64c2599e48a05e8792b845cfecc210a6fc5 Mon Sep 17 00:00:00 2001
17b94a
From: Kotresh HR <khiremat@redhat.com>
17b94a
Date: Mon, 22 Jul 2019 17:35:21 +0530
17b94a
Subject: [PATCH 258/261] geo-rep: Fix mount broker setup issue
17b94a
17b94a
The patch [1] added validation in gverify.sh to check if the gluster
17b94a
binary on slave by executing gluster directly on slave.  But for
17b94a
non-root users, even though gluster binary is present, path is not
17b94a
found when executed via ssh. Hence validate the gluster binary using
17b94a
bash builtin 'type' command.
17b94a
17b94a
[1] https://review.gluster.org/19224
17b94a
17b94a
Backport of:
17b94a
 > Patch: https://review.gluster.org/23089
17b94a
 > Change-Id: I93ca62c0c5b1e16263e586ddbbca8407d60ca126
17b94a
 > fixes: bz#1731920
17b94a
 > Signed-off-by: Kotresh HR <khiremat@redhat.com>
17b94a
17b94a
Change-Id: I93ca62c0c5b1e16263e586ddbbca8407d60ca126
17b94a
BUG: 1720992
17b94a
Signed-off-by: Kotresh HR <khiremat@redhat.com>
17b94a
Reviewed-on: https://code.engineering.redhat.com/gerrit/176727
17b94a
Tested-by: RHGS Build Bot <nigelb@redhat.com>
17b94a
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
17b94a
---
17b94a
 geo-replication/src/gverify.sh | 6 +++---
17b94a
 1 file changed, 3 insertions(+), 3 deletions(-)
17b94a
17b94a
diff --git a/geo-replication/src/gverify.sh b/geo-replication/src/gverify.sh
17b94a
index 7c88f9f..692c1d6 100755
17b94a
--- a/geo-replication/src/gverify.sh
17b94a
+++ b/geo-replication/src/gverify.sh
17b94a
@@ -207,13 +207,13 @@ function main()
17b94a
     fi;
17b94a
 
17b94a
     if [[ -z "${GR_SSH_IDENTITY_KEY}" ]]; then
17b94a
-        err=$((ssh -p ${SSH_PORT} -oNumberOfPasswordPrompts=0 -oStrictHostKeyChecking=no $2@$3 "gluster --version") 2>&1)
17b94a
+        ssh -p ${SSH_PORT} -oNumberOfPasswordPrompts=0 -oStrictHostKeyChecking=no $2@$3 "type -p gluster"
17b94a
     else
17b94a
-        err=$((ssh -p ${SSH_PORT} -i ${GR_SSH_IDENTITY_KEY} -oNumberOfPasswordPrompts=0 -oStrictHostKeyChecking=no $2@$3 "gluster --version") 2>&1)
17b94a
+        ssh -p ${SSH_PORT} -i ${GR_SSH_IDENTITY_KEY} -oNumberOfPasswordPrompts=0 -oStrictHostKeyChecking=no $2@$3 "type -p gluster"
17b94a
     fi
17b94a
 
17b94a
     if [ $? -ne 0 ]; then
17b94a
-        echo "FORCE_BLOCKER|gluster command on $2@$3 failed. Error: $err" > $log_file
17b94a
+        echo "FORCE_BLOCKER|gluster command not found on $3 for user $2." > $log_file
17b94a
         exit 1;
17b94a
     fi;
17b94a
 
17b94a
-- 
17b94a
1.8.3.1
17b94a