summaryrefslogtreecommitdiffstats
path: root/extras/ganesha/scripts/ganesha-ha.sh
diff options
context:
space:
mode:
authorJiffin Tony Thottan <jthottan@redhat.com>2017-10-16 14:24:29 +0530
committerAmar Tumballi <amarts@gmail.com>2019-08-24 02:08:57 +0000
commit673f2f90f35e5ea381bd22a43403278f89c957a5 (patch)
tree297f645a4cc6dfbe48609b03da26a1e93607ab7d /extras/ganesha/scripts/ganesha-ha.sh
parent3fe34c921146a8d11875dc3d904e3a5994eb1cb6 (diff)
Revert "glusterd: (storhaug) remove ganesha (843e1b0)"
please note as an additional change, macro GLUSTERD_GET_SNAP_DIR moved from glusterd-store.c to glusterd-snapshot-utils.h Change-Id: I811efefc148453fe32e4f0d322e80455447cec71 updates: #663 Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
Diffstat (limited to 'extras/ganesha/scripts/ganesha-ha.sh')
-rw-r--r--extras/ganesha/scripts/ganesha-ha.sh27
1 files changed, 13 insertions, 14 deletions
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
index 2df98ac5fbf..32af1cab10e 100644
--- a/extras/ganesha/scripts/ganesha-ha.sh
+++ b/extras/ganesha/scripts/ganesha-ha.sh
@@ -20,6 +20,7 @@
# ensure that the NFS GRACE DBUS signal is sent after the VIP moves to
# the new host.
+GANESHA_HA_SH=$(realpath $0)
HA_NUM_SERVERS=0
HA_SERVERS=""
HA_VOL_NAME="gluster_shared_storage"
@@ -68,9 +69,9 @@ function find_rhel7_conf
done
}
-if [ -z $CONFFILE ]
+if [ -z ${CONFFILE} ]
then
- find_rhel7_conf $OPTIONS
+ find_rhel7_conf ${OPTIONS}
fi
@@ -90,9 +91,9 @@ usage() {
determine_service_manager () {
- if [ -e "/usr/bin/systemctl" ];
+ if [ -e "/bin/systemctl" ];
then
- SERVICE_MAN="/usr/bin/systemctl"
+ SERVICE_MAN="/bin/systemctl"
elif [ -e "/sbin/invoke-rc.d" ];
then
SERVICE_MAN="/sbin/invoke-rc.d"
@@ -100,7 +101,7 @@ determine_service_manager () {
then
SERVICE_MAN="/sbin/service"
fi
- if [ "$SERVICE_MAN" == "DISTRO_NOT_FOUND" ]
+ if [ "${SERVICE_MAN}" == "DISTRO_NOT_FOUND" ]
then
echo "Service manager not recognized, exiting"
exit 1
@@ -113,21 +114,21 @@ manage_service ()
local new_node=${2}
local option=
- if [ "$action" == "start" ]; then
+ if [ "${action}" == "start" ]; then
option="yes"
else
option="no"
fi
ssh -oPasswordAuthentication=no -oStrictHostKeyChecking=no -i \
-${SECRET_PEM} root@${new_node} "/usr/libexec/ganesha/ganesha-ha.sh --setup-ganesha-conf-files $HA_CONFDIR $option"
+${SECRET_PEM} root@${new_node} "${GANESHA_HA_SH} --setup-ganesha-conf-files $HA_CONFDIR $option"
- if [ "$SERVICE_MAN" == "/usr/bin/systemctl" ]
+ if [ "${SERVICE_MAN}" == "/bin/systemctl" ]
then
ssh -oPasswordAuthentication=no -oStrictHostKeyChecking=no -i \
-${SECRET_PEM} root@${new_node} "$SERVICE_MAN ${action} nfs-ganesha"
+${SECRET_PEM} root@${new_node} "${SERVICE_MAN} ${action} nfs-ganesha"
else
ssh -oPasswordAuthentication=no -oStrictHostKeyChecking=no -i \
-${SECRET_PEM} root@${new_node} "$SERVICE_MAN nfs-ganesha ${action}"
+${SECRET_PEM} root@${new_node} "${SERVICE_MAN} nfs-ganesha ${action}"
fi
}
@@ -274,8 +275,7 @@ string:\"EXPORT(Export_Id=$export_id)\" 2>&1")
ret=$?
logger <<< "${output}"
if [ ${ret} -ne 0 ]; then
- echo "Error: refresh-config failed on ${current_host}."
- exit 1
+ echo "Refresh-config failed on ${current_host}. Please check logs on ${current_host}"
else
echo "Refresh-config completed on ${current_host}."
fi
@@ -296,8 +296,7 @@ string:"EXPORT(Export_Id=$export_id)" 2>&1)
ret=$?
logger <<< "${output}"
if [ ${ret} -ne 0 ] ; then
- echo "Error: refresh-config failed on localhost."
- exit 1
+ echo "Refresh-config failed on localhost."
else
echo "Success: refresh-config completed."
fi