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