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