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