a3470f
From aa20e41c3087f9ec68d0a7890ed953e5bc7aa096 Mon Sep 17 00:00:00 2001
a3470f
From: "Kaleb S. KEITHLEY" <kkeithle@redhat.com>
a3470f
Date: Wed, 26 Jul 2017 10:36:11 -0400
a3470f
Subject: [PATCH 67/74] packaging: own files in
a3470f
 (/var)/run/gluster/shared_storage/nfs-ganesha
a3470f
a3470f
The nfs-ganesha rpm owns /etc/ganesha and /etc/ganesha/ganesha.conf,
a3470f
but gluster-ganesha installs a ganesha-ha.conf.sample in /etc/ganesha/
a3470f
a3470f
Ganesha HA expects to find the config files in /var/run/.../nfs-ganesha
a3470f
and for there to be symlinks from /etc/ganesha/* to /var/run/...
a3470f
a3470f
As exports are created the ganesha export files are written to
a3470f
/var/run/gluster/shared_storage/nfs-ganesha/exports/*
a3470f
a3470f
This change creates rpm %ghosts for most of these files to manage
a3470f
ownership within rpm and ensure they are not deleted or overwritten
a3470f
during package install/upgrade/removal. The name of the exports varies,
a3470f
so it's not possible AFAIK to create wildcard %ghosts for them.
a3470f
a3470f
Change-Id: Ic4389291c0af0bd72c22fa742cdfa2011b9286f3
a3470f
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
a3470f
Reviewed-on: https://review.gluster.org/17883
a3470f
Smoke: Gluster Build System <jenkins@build.gluster.org>
a3470f
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
a3470f
Reviewed-by: Niels de Vos <ndevos@redhat.com>
a3470f
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
a3470f
---
a3470f
 glusterfs.spec.in | 15 ++++++++++++++-
a3470f
 1 file changed, 14 insertions(+), 1 deletion(-)
a3470f
a3470f
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
a3470f
index e6e2ba3..cbc77c3 100644
a3470f
--- a/glusterfs.spec.in
a3470f
+++ b/glusterfs.spec.in
a3470f
@@ -818,6 +818,13 @@ sed -i 's|option working-directory /etc/glusterd|option working-directory %{_sha
a3470f
 install -D -p -m 0644 extras/glusterfs-logrotate \
a3470f
     %{buildroot}%{_sysconfdir}/logrotate.d/glusterfs
a3470f
 
a3470f
+# ganesha ghosts
a3470f
+mkdir -p %{buildroot}%{_sysconfdir}/ganesha
a3470f
+touch %{buildroot}%{_sysconfdir}/ganesha/ganesha-ha.conf
a3470f
+mkdir -p %{buildroot}%{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/exports
a3470f
+touch %{buildroot}%{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/ganesha.conf
a3470f
+touch %{buildroot}%{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/ganesha-ha.conf
a3470f
+
a3470f
 %if ( 0%{!?_without_georeplication:1} )
a3470f
 mkdir -p %{buildroot}%{_sharedstatedir}/glusterd/geo-replication
a3470f
 touch %{buildroot}%{_sharedstatedir}/glusterd/geo-replication/gsyncd_template.conf
a3470f
@@ -1309,10 +1316,16 @@ exit 0
a3470f
 
a3470f
 %if ( 0%{?_build_server} )
a3470f
 %files ganesha
a3470f
-%{_sysconfdir}/ganesha/*
a3470f
+%dir %{_libexecdir}/ganesha
a3470f
 %{_libexecdir}/ganesha/*
a3470f
 %{_prefix}/lib/ocf/resource.d/heartbeat/*
a3470f
 %{_sharedstatedir}/glusterd/hooks/1/start/post/S31ganesha-start.sh
a3470f
+%{_sysconfdir}/ganesha/ganesha-ha.conf.sample
a3470f
+%ghost %config(noreplace) %{_sysconfdir}/ganesha/ganesha-ha.conf
a3470f
+%ghost %dir %{_localstatedir}/run/gluster/shared_storage/nfs-ganesha
a3470f
+%ghost %dir %{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/exports
a3470f
+%ghost %config(noreplace) %{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/ganesha.conf
a3470f
+%ghost %config(noreplace) %{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/ganesha-ha.conf
a3470f
 %endif
a3470f
 
a3470f
 %if ( 0%{?_build_server} )
a3470f
-- 
a3470f
1.8.3.1
a3470f