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