From e2cbfcbf154cc7b0c95eaaf079eab7291ffdb580 Mon Sep 17 00:00:00 2001 From: Jiffin Tony Thottan Date: Thu, 2 Mar 2017 12:22:30 +0530 Subject: ganesha/scripts : Stop ganesha process on all nodes if cluster setup fails During staging phase of volume option "nfs-ganesha", symlink "ganesha.conf" will be created plus ganesha process will be started. The cluster setup happens during commit phase of that option. So if cluster set up fails, the ganesha process will be running on all cluster nodes. Change-Id: Ib2cb85364b7ef5b702acb4826ffdf8e6f31a2acd BUG: 1426156 Signed-off-by: Jiffin Tony Thottan Reviewed-on: https://review.gluster.org/16823 Smoke: Gluster Build System Tested-by: Kaleb KEITHLEY Reviewed-by: soumya k Reviewed-by: Kaleb KEITHLEY NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System --- extras/ganesha/scripts/ganesha-ha.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'extras') diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh index 2eb1a14c959..2ca6dc51632 100644 --- a/extras/ganesha/scripts/ganesha-ha.sh +++ b/extras/ganesha/scripts/ganesha-ha.sh @@ -175,6 +175,13 @@ determine_servers() fi } +stop_ganesha_all() +{ + local serverlist=${1} + for node in ${serverlist} ; do + manage_service "stop" ${node} + done +} setup_cluster() { @@ -191,6 +198,8 @@ setup_cluster() pcs cluster setup ${RHEL6_PCS_CNAME_OPTION} ${name} --transport udpu ${servers} if [ $? -ne 0 ]; then logger "pcs cluster setup ${RHEL6_PCS_CNAME_OPTION} ${name} ${servers} failed" + #set up failed stop all ganesha process and clean up symlinks in cluster + stop_ganesha_all ${servers} exit 1; fi -- cgit