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