From 0e50c4b3ea734456c14e2d7a578463999bd332c3 Mon Sep 17 00:00:00 2001 From: "Kaleb S. KEITHLEY" Date: Wed, 26 Apr 2017 08:11:56 -0400 Subject: packaging: /var/run/gluster owner gluster:gluster(0775) for statedumps gfapi has the ability to take statedumps. However, if the application using gfapi isn't running with root privs the statedump file can't be written to the default location, i.e. /var/run/gluster. Change-Id: I97d8919ef8b8cd4775e1a206f939a2bf0046786d BUG: 1445569 Signed-off-by: Kaleb S. KEITHLEY Reviewed-on: https://review.gluster.org/17122 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Niels de Vos --- extras/run-gluster.tmpfiles.in | 2 +- glusterfs.spec.in | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/extras/run-gluster.tmpfiles.in b/extras/run-gluster.tmpfiles.in index 49a2662c4c8..329f2dde6db 100644 --- a/extras/run-gluster.tmpfiles.in +++ b/extras/run-gluster.tmpfiles.in @@ -1,2 +1,2 @@ # hardcoding /run for now, should be detected while building from source? -d /run/gluster 0755 root root - +d /run/gluster 0775 gluster gluster - diff --git a/glusterfs.spec.in b/glusterfs.spec.in index 89cc284fcb3..27a4351c1af 100644 --- a/glusterfs.spec.in +++ b/glusterfs.spec.in @@ -190,6 +190,7 @@ Source0: @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) +Requires(pre): shadow-utils %if ( 0%{?rhel} && 0%{?rhel} <= 5 ) BuildRequires: python-simplejson %endif @@ -875,6 +876,15 @@ else fi exit 0 +##----------------------------------------------------------------------------- +## All %%pre should be placed here and keep them sorted +## +%pre +getent group gluster > /dev/null || groupadd -r gluster +getent passwd gluster > /dev/null || useradd -r -g gluster -d /var/run/gluster -s /sbin/nologin -c "GlusterFS daemons" gluster +exit 0 + + ##----------------------------------------------------------------------------- ## All %%preun should be placed here and keep them sorted ## @@ -983,7 +993,7 @@ exit 0 %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/performance/write-behind.so %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/performance/nl-cache.so %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/system/posix-acl.so -%dir %{_localstatedir}/run/gluster +%dir %attr(0775,gluster,gluster) %{_localstatedir}/run/gluster %if 0%{?_tmpfilesdir:1} %{_tmpfilesdir}/gluster.conf %endif @@ -1262,6 +1272,10 @@ exit 0 %endif %changelog +* Wed Apr 26 2017 Kaleb S. KEITHLEY +- /var/run/gluster owner gluster:gluster(0775) for qemu(gfapi) + statedumps (#1445569) + * Thu Apr 20 2017 Kaleb S. KEITHLEY - firewalld-filesystem -> firewalld (#1443959) -- cgit