summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2019-07-31 15:40:55 +0530
committerRinku Kothiya <rkothiya@redhat.com>2019-08-19 11:20:02 +0000
commit8b7ceb3934f8e2dbcbabe5d1c0244c2bacda92c3 (patch)
treebef0a4c36c62ee08655685c604b66998f44c75a1
parent0a2ae69bcc393f0988fbd1ab6fbad1b93d991099 (diff)
geo-rep: Fix mount broker setup issue
Even the use builtin 'type' command as in patch [1] causes issues if argument in question is not part of PATH environment variable for that user. This patch fixes the same by doing source /etc/profile. This was already being used in another part of script. [1] https://review.gluster.org/23089 Backport of: > Patch: https://review.gluster.org/23136/ > Change-Id: Iceb78835967ec6a4350983eec9af28398410c002 > BUG: 1734738 > Signed-off-by: Kotresh HR <khiremat@redhat.com> (cherry picked from commit 84f7794547522463841068063b22fd3a8d8fca2b) Change-Id: Iceb78835967ec6a4350983eec9af28398410c002 fixes: bz#1739442 Signed-off-by: Kotresh HR <khiremat@redhat.com>
-rwxr-xr-xgeo-replication/src/gverify.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/geo-replication/src/gverify.sh b/geo-replication/src/gverify.sh
index 7c88f9f682d..f5f70d245e0 100755
--- a/geo-replication/src/gverify.sh
+++ b/geo-replication/src/gverify.sh
@@ -180,6 +180,8 @@ function main()
> $log_file
inet6=$7
+ local cmd_line
+ local ver
# Use FORCE_BLOCKER flag in the error message to differentiate
# between the errors which the force command should bypass
@@ -206,14 +208,15 @@ function main()
exit 1;
fi;
+ cmd_line=$(cmd_slave);
if [[ -z "${GR_SSH_IDENTITY_KEY}" ]]; then
- err=$((ssh -p ${SSH_PORT} -oNumberOfPasswordPrompts=0 -oStrictHostKeyChecking=no $2@$3 "gluster --version") 2>&1)
+ ver=$(ssh -p ${SSH_PORT} -oNumberOfPasswordPrompts=0 -oStrictHostKeyChecking=no $2@$3 bash -c "'$cmd_line'")
else
- err=$((ssh -p ${SSH_PORT} -i ${GR_SSH_IDENTITY_KEY} -oNumberOfPasswordPrompts=0 -oStrictHostKeyChecking=no $2@$3 "gluster --version") 2>&1)
+ ver=$(ssh -p ${SSH_PORT} -i ${GR_SSH_IDENTITY_KEY} -oNumberOfPasswordPrompts=0 -oStrictHostKeyChecking=no $2@$3 bash -c "'$cmd_line'")
fi
- if [ $? -ne 0 ]; then
- echo "FORCE_BLOCKER|gluster command on $2@$3 failed. Error: $err" > $log_file
+ if [ -z "$ver" ]; then
+ echo "FORCE_BLOCKER|gluster command not found on $3 for user $2." > $log_file
exit 1;
fi;