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