17b94a
From 93635333d17a03078a6bf72771445e1bd9ebdc15 Mon Sep 17 00:00:00 2001
17b94a
From: Jiffin Tony Thottan <jthottan@redhat.com>
17b94a
Date: Thu, 2 Mar 2017 12:22:30 +0530
17b94a
Subject: [PATCH 060/124] ganesha/scripts : Stop ganesha process on all nodes
17b94a
 if cluster setup fails
17b94a
17b94a
During staging phase of volume option "nfs-ganesha", symlink "ganesha.conf"
17b94a
will be created plus ganesha process will be started. The cluster setup
17b94a
happens during commit phase of that option. So if cluster set up fails, the
17b94a
ganesha process will be running on all cluster nodes.
17b94a
17b94a
Label: DOWNSTREAM ONLY
17b94a
17b94a
Change-Id: Ib2cb85364b7ef5b702acb4826ffdf8e6f31a2acd
17b94a
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
17b94a
Reviewed-on: https://review.gluster.org/16823
17b94a
Smoke: Gluster Build System <jenkins@build.gluster.org>
17b94a
Tested-by: Kaleb KEITHLEY <kkeithle@redhat.com>
17b94a
Reviewed-by: soumya k <skoduri@redhat.com>
17b94a
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
17b94a
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
17b94a
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
17b94a
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
17b94a
Reviewed-on: https://code.engineering.redhat.com/gerrit/167145
17b94a
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
17b94a
Tested-by: RHGS Build Bot <nigelb@redhat.com>
17b94a
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
17b94a
---
17b94a
 extras/ganesha/scripts/ganesha-ha.sh | 9 +++++++++
17b94a
 1 file changed, 9 insertions(+)
17b94a
17b94a
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
17b94a
index 7ba80b5..db3f921 100644
17b94a
--- a/extras/ganesha/scripts/ganesha-ha.sh
17b94a
+++ b/extras/ganesha/scripts/ganesha-ha.sh
17b94a
@@ -175,6 +175,13 @@ determine_servers()
17b94a
     fi
17b94a
 }
17b94a
 
17b94a
+stop_ganesha_all()
17b94a
+{
17b94a
+    local serverlist=${1}
17b94a
+    for node in ${serverlist} ; do
17b94a
+        manage_service "stop" ${node}
17b94a
+    done
17b94a
+}
17b94a
 
17b94a
 setup_cluster()
17b94a
 {
17b94a
@@ -191,6 +198,8 @@ setup_cluster()
17b94a
     pcs cluster setup ${RHEL6_PCS_CNAME_OPTION} ${name} --transport udpu ${servers}
17b94a
     if [ $? -ne 0 ]; then
17b94a
         logger "pcs cluster setup ${RHEL6_PCS_CNAME_OPTION} ${name} ${servers} failed"
17b94a
+        #set up failed stop all ganesha process and clean up symlinks in cluster
17b94a
+        stop_ganesha_all ${servers}
17b94a
         exit 1;
17b94a
     fi
17b94a
     pcs cluster start --all
17b94a
-- 
17b94a
1.8.3.1
17b94a