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