summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2017-08-10 13:13:39 -0400
committerKaleb KEITHLEY <kkeithle@redhat.com>2017-08-11 09:04:27 +0000
commit811c7ba470a6488570485ec7401e565b8ab1be47 (patch)
tree9d60431365f086093bf65d0b89eb52f38c4735b2
parent220d406ad13d840e950eef001a2b36f87570058d (diff)
packaging: /run and /var/run; prefer /run
Fedora packaging guidelines say to use /run. On newer Fedora and el7 /var/run is a symlink to ../run (i.e. /run). /run is a tmpfs file system that is mounted earlier than /var might be. See https://bugzilla.redhat.com/show_bug.cgi?id=1476794 Change-Id: I08d948a43c7698bebd26c88a673a7f77c2d317ca Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: https://review.gluster.org/18017 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Niels de Vos <ndevos@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
-rw-r--r--glusterfs.spec.in12
1 files changed, 7 insertions, 5 deletions
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
index 45411a39f66..039a93c43b0 100644
--- a/glusterfs.spec.in
+++ b/glusterfs.spec.in
@@ -106,7 +106,9 @@
# From https://fedoraproject.org/wiki/Packaging:Python#Macros
%if ( 0%{?rhel} && 0%{?rhel} <= 6 )
%{!?python2_sitelib: %global python2_sitelib %(python2 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+%global _rundir %{_localstatedir}/run
%{!?python2_sitearch: %global python2_sitearch %(python2 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
+%global _rundir /run
%endif
%if ( 0%{?_with_systemd:1} )
@@ -706,7 +708,7 @@ install -D -p -m 0755 %{SOURCE6} \
mkdir -p %{buildroot}%{_localstatedir}/log/glusterd
mkdir -p %{buildroot}%{_localstatedir}/log/glusterfs
mkdir -p %{buildroot}%{_localstatedir}/log/glusterfsd
-mkdir -p %{buildroot}%{_localstatedir}/run/gluster
+mkdir -p %{buildroot}%{_rundir}/gluster
# Remove unwanted files from all the shared libraries
find %{buildroot}%{_libdir} -name '*.a' -delete
@@ -887,7 +889,7 @@ if [ $? -eq 0 ]; then
#Cleaning leftover glusterd socket file which is created by glusterd in
#rpm_script_t context.
- rm -rf /var/run/glusterd.socket
+ rm -f %{_rundir}/glusterd.socket
# glusterd _was_ running, we killed it, it exited after *.upgrade=on,
# so start it again
@@ -897,7 +899,7 @@ else
#Cleaning leftover glusterd socket file which is created by glusterd in
#rpm_script_t context.
- rm -rf /var/run/glusterd.socket
+ rm -f %{_rundir}/glusterd.socket
fi
exit 0
@@ -906,7 +908,7 @@ exit 0
##
%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
+getent passwd gluster > /dev/null || useradd -r -g gluster -d %{_rundir}/gluster -s /sbin/nologin -c "GlusterFS daemons" gluster
exit 0
@@ -1027,7 +1029,7 @@ exit 0
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/system/posix-acl.so
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/experimental
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/experimental/fdl.so
-%dir %attr(0775,gluster,gluster) %{_localstatedir}/run/gluster
+%dir %attr(0775,gluster,gluster) %{_rundir}/gluster
%if 0%{?_tmpfilesdir:1}
%{_tmpfilesdir}/gluster.conf
%endif