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