a3470f
From 9b299dff3811a48978a76cbdd5f4f66f0cf68d78 Mon Sep 17 00:00:00 2001
a3470f
From: Ambarish <asoman@redhat.com>
a3470f
Date: Tue, 12 Sep 2017 18:34:29 +0530
a3470f
Subject: [PATCH 69/74] ganesha-ha: don't set SELinux booleans if SELinux is
a3470f
 disabled
a3470f
a3470f
semanage commands inside ganesha-ha.sh script will fail if selinux is
a3470f
Disabled. This patch introduces a check if selinux is enabled or not,
a3470f
and subsequently run semange commands only on selinux enabled systems.
a3470f
a3470f
Change-Id: Ibee61cbb1d51a73e6c326b49bac5c7ce06feb310
a3470f
Signed-off-by: Ambarish <asoman@redhat.com>
a3470f
Reviewed-on: https://review.gluster.org/18264
a3470f
Reviewed-by: Niels de Vos <ndevos@redhat.com>
a3470f
Smoke: Gluster Build System <jenkins@build.gluster.org>
a3470f
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
a3470f
Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
a3470f
Reviewed-by: Daniel Gryniewicz <dang@redhat.com>
a3470f
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
a3470f
---
a3470f
 extras/ganesha/scripts/ganesha-ha.sh | 9 ++++++---
a3470f
 1 file changed, 6 insertions(+), 3 deletions(-)
a3470f
a3470f
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
a3470f
index 0b7642d..3a18a1a 100644
a3470f
--- a/extras/ganesha/scripts/ganesha-ha.sh
a3470f
+++ b/extras/ganesha/scripts/ganesha-ha.sh
a3470f
@@ -985,7 +985,9 @@ main()
a3470f
         exit 0
a3470f
     fi
a3470f
 
a3470f
-    semanage boolean -m gluster_use_execmem --on
a3470f
+    if (selinuxenabled) ;then
a3470f
+     semanage boolean -m gluster_use_execmem --on
a3470f
+    fi
a3470f
 
a3470f
     HA_CONFDIR=${1%/}; shift
a3470f
     local ha_conf=${HA_CONFDIR}/ganesha-ha.conf
a3470f
@@ -1133,8 +1135,9 @@ $HA_CONFDIR/ganesha-ha.conf
a3470f
 
a3470f
     esac
a3470f
 
a3470f
-    semanage boolean -m gluster_use_execmem --off
a3470f
-
a3470f
+    if (selinuxenabled) ;then
a3470f
+     semanage boolean -m gluster_use_execmem --off
a3470f
+    fi
a3470f
 }
a3470f
 
a3470f
 main $*
a3470f
-- 
a3470f
1.8.3.1
a3470f