a3470f
From f16ba446e30197ff1724a5e257b35fb41330835d Mon Sep 17 00:00:00 2001
a3470f
From: "Kaleb S. KEITHLEY" <kkeithle@redhat.com>
a3470f
Date: Wed, 21 Jun 2017 10:01:20 -0400
a3470f
Subject: [PATCH 65/74] common-ha: enable and disable selinux
a3470f
 ganesha_use_fusefs
a3470f
a3470f
Starting in Fedora 26 and RHEL 7.4 there are new targeted policies
a3470f
in selinux which include a tuneable to allow ganesha.nfsd to access
a3470f
the gluster (FUSE) shared_storage volume where ganesha maintains its
a3470f
state.
a3470f
a3470f
N.B. rpm doesn't have a way to distinguish between RHEL 7.3 or 7.4
a3470f
so it can't be enabled for RHEL at this time. /usr/sbin/semanage is
a3470f
in policycoreutils-python in RHEL (versus policycoreutils-python-utils
a3470f
in Fedora.) Once RHEL 7.4 GAs we may also wish to specify the version
a3470f
for RHEL 7 explicitly, i.e.
a3470f
  Requires: selinux-policy >= 3.13.1-160.
a3470f
But beware, the corresponding version in Fedora 26 seems to be
a3470f
selinux-policy-3.13.1.258 or so. (Maybe earlier versions, but that's
a3470f
what's currently in the F26 beta.
a3470f
a3470f
release-3.10 is the upstream master branch for glusterfs-ganesha. For
a3470f
release-3.11 and later storhaug needs a similar change, which is
a3470f
tracked by https://github.com/linux-ha-storage/storhaug/issues/11
a3470f
a3470f
Maybe at some point we would want to consider migrating the targeted
a3470f
policies for glusterfs (and nfs-ganesha) from selinux-policy to a
a3470f
glusterfs-selinux (and nfs-ganesha-selinux) subpackage?
a3470f
a3470f
Change-Id: I04a5443edd00636cbded59a2baddfa98095bf7ac
a3470f
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
a3470f
Reviewed-on: https://review.gluster.org/17597
a3470f
Smoke: Gluster Build System <jenkins@build.gluster.org>
a3470f
Reviewed-by: Niels de Vos <ndevos@redhat.com>
a3470f
Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
a3470f
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
a3470f
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
a3470f
---
a3470f
 glusterfs.spec.in | 16 ++++++++++++++++
a3470f
 1 file changed, 16 insertions(+)
a3470f
a3470f
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
a3470f
index 0bad6cf..17f814b 100644
a3470f
--- a/glusterfs.spec.in
a3470f
+++ b/glusterfs.spec.in
a3470f
@@ -410,6 +410,10 @@ Requires:         pcs, dbus
a3470f
 %if ( 0%{?rhel} && 0%{?rhel} == 6 )
a3470f
 Requires:         cman, pacemaker, corosync
a3470f
 %endif
a3470f
+%if ( 0%{?fedora} && 0%{?fedora} > 25 )
a3470f
+Requires(post):   policycoreutils-python-utils
a3470f
+Requires(postun): policycoreutils-python-utils
a3470f
+%endif
a3470f
 %if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} > 5 )
a3470f
 # we need portblock resource-agent in 3.9.5 and later.
a3470f
 Requires:         resource-agents >= 3.9.5
a3470f
@@ -876,6 +880,12 @@ modprobe fuse
a3470f
 exit 0
a3470f
 %endif
a3470f
 
a3470f
+%if ( 0%{?fedora} && 0%{?fedora} > 25 )
a3470f
+%post ganesha
a3470f
+semanage boolean -m ganesha_use_fusefs --on
a3470f
+exit 0
a3470f
+%endif
a3470f
+
a3470f
 %if ( 0%{?_build_server} )
a3470f
 %if ( 0%{!?_without_georeplication:1} )
a3470f
 %post geo-replication
a3470f
@@ -998,6 +1008,12 @@ fi
a3470f
 %postun api
a3470f
 /sbin/ldconfig
a3470f
 
a3470f
+%if ( 0%{?fedora} && 0%{?fedora} > 25 )
a3470f
+%postun ganesha
a3470f
+semanage boolean -m ganesha_use_fusefs --off
a3470f
+exit 0
a3470f
+%endif
a3470f
+
a3470f
 %postun libs
a3470f
 /sbin/ldconfig
a3470f
 
a3470f
-- 
a3470f
1.8.3.1
a3470f