summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2019-07-31 15:40:55 +0530
committerKotresh HR <khiremat@redhat.com>2019-08-06 12:32:00 +0530
commit216735a52a91844e5a27ee541815bb0b6482edff (patch)
tree29fc6bf681657f0948666620591d70e0327239eb
parent155a4bf36d739ddc3de60db47589626a7717c938 (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> Change-Id: Iceb78835967ec6a4350983eec9af28398410c002 fixes: bz#1737716 Signed-off-by: Kotresh HR <khiremat@redhat.com>
-rwxr-xr-xgeo-replication/src/gverify.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/geo-replication/src/gverify.sh b/geo-replication/src/gverify.sh
index 1f06ecfe7da..47d819f3209 100755
--- a/geo-replication/src/gverify.sh
+++ b/geo-replication/src/gverify.sh
@@ -167,6 +167,9 @@ function main()
log_file=$6
> $log_file
+ local cmd_line
+ local ver
+
# Use FORCE_BLOCKER flag in the error message to differentiate
# between the errors which the force command should bypass
@@ -192,13 +195,14 @@ function main()
exit 1;
fi;
+ cmd_line=$(cmd_slave);
if [[ -z "${GR_SSH_IDENTITY_KEY}" ]]; then
- ssh -p ${SSH_PORT} -oNumberOfPasswordPrompts=0 -oStrictHostKeyChecking=no $2@$3 "type -p gluster"
+ ver=$(ssh -p ${SSH_PORT} -oNumberOfPasswordPrompts=0 -oStrictHostKeyChecking=no $2@$3 bash -c "'$cmd_line'")
else
- ssh -p ${SSH_PORT} -i ${GR_SSH_IDENTITY_KEY} -oNumberOfPasswordPrompts=0 -oStrictHostKeyChecking=no $2@$3 "type -p gluster"
+ 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
+ if [ -z "$ver" ]; then
echo "FORCE_BLOCKER|gluster command not found on $3 for user $2." > $log_file
exit 1;
fi;