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