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