parent
eac9bc7821
commit
836c562d7e
6
redis-limit-init
Normal file
6
redis-limit-init
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# If you need to change max open file limit
|
||||||
|
# for example, when you change maxclient in configuration
|
||||||
|
# you can change the value below
|
||||||
|
# see "man limits.conf" for information
|
||||||
|
redis soft nofile 10240
|
||||||
|
redis hard nofile 10240
|
7
redis-limit-systemd
Normal file
7
redis-limit-systemd
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# If you need to change max open file limit
|
||||||
|
# for example, when you change maxclient in configuration
|
||||||
|
# you can change the LimitNOFILE value below
|
||||||
|
# see "man systemd.exec" for information
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
LimitNOFILE=10240
|
66
redis.spec
66
redis.spec
@ -1,14 +1,7 @@
|
|||||||
%global _hardened_build 1
|
%global _hardened_build 1
|
||||||
%global with_perftools 0
|
%global with_perftools 0
|
||||||
|
|
||||||
# redis 2.8 sentinel is the first upstream version to work
|
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7
|
||||||
# however as packaged here it is entirely broken
|
|
||||||
# FIXME: consider removal into a separate package
|
|
||||||
%if 0%{?fedora} >= 21 || 0%{?rhel} >= 7
|
|
||||||
%global with_sentinel 1
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
|
|
||||||
%global with_systemd 1
|
%global with_systemd 1
|
||||||
%else
|
%else
|
||||||
%global with_systemd 0
|
%global with_systemd 0
|
||||||
@ -18,7 +11,7 @@
|
|||||||
%global with_tests %{?_with_tests:1}%{!?_with_tests:0}
|
%global with_tests %{?_with_tests:1}%{!?_with_tests:0}
|
||||||
|
|
||||||
Name: redis
|
Name: redis
|
||||||
Version: 2.8.18
|
Version: 2.8.19
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: A persistent key-value database
|
Summary: A persistent key-value database
|
||||||
License: BSD
|
License: BSD
|
||||||
@ -31,6 +24,8 @@ Source4: %{name}.tmpfiles
|
|||||||
Source5: %{name}-sentinel.init
|
Source5: %{name}-sentinel.init
|
||||||
Source6: %{name}.init
|
Source6: %{name}.init
|
||||||
Source7: %{name}-shutdown
|
Source7: %{name}-shutdown
|
||||||
|
Source8: %{name}-limit-systemd
|
||||||
|
Source9: %{name}-limit-init
|
||||||
# To refresh patches:
|
# To refresh patches:
|
||||||
# tar xf redis-xxx.tar.gz && cd redis-xxx && git init && git add . && git commit -m "%{version} baseline"
|
# tar xf redis-xxx.tar.gz && cd redis-xxx && git init && git add . && git commit -m "%{version} baseline"
|
||||||
# git am %{patches}
|
# git am %{patches}
|
||||||
@ -145,25 +140,23 @@ install -pDm644 %{S:1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
|
|||||||
|
|
||||||
# Install configuration files.
|
# Install configuration files.
|
||||||
install -pDm644 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}.conf
|
install -pDm644 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}.conf
|
||||||
%if 0%{?with_sentinel}
|
|
||||||
install -pDm644 sentinel.conf %{buildroot}%{_sysconfdir}/%{name}-sentinel.conf
|
install -pDm644 sentinel.conf %{buildroot}%{_sysconfdir}/%{name}-sentinel.conf
|
||||||
%endif
|
|
||||||
|
|
||||||
# Install Systemd/SysV files.
|
# Install Systemd unit files.
|
||||||
%if 0%{?with_systemd}
|
%if 0%{?with_systemd}
|
||||||
mkdir -p %{buildroot}%{_unitdir}
|
mkdir -p %{buildroot}%{_unitdir}
|
||||||
install -pm644 %{S:3} %{buildroot}%{_unitdir}
|
install -pm644 %{S:3} %{buildroot}%{_unitdir}
|
||||||
%if 0%{?with_sentinel}
|
|
||||||
install -pm644 %{S:2} %{buildroot}%{_unitdir}
|
install -pm644 %{S:2} %{buildroot}%{_unitdir}
|
||||||
%endif
|
|
||||||
|
|
||||||
# Install systemd tmpfiles config.
|
# Install systemd tmpfiles config.
|
||||||
install -pDm644 %{S:4} %{buildroot}%{_tmpfilesdir}/%{name}.conf
|
install -pDm644 %{S:4} %{buildroot}%{_tmpfilesdir}/%{name}.conf
|
||||||
%else
|
# Install systemd limit files (requires systemd >= 204)
|
||||||
%if 0%{?with_sentinel}
|
install -p -D -m 644 %{S:8} %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d/limit.conf
|
||||||
|
install -p -D -m 644 %{S:8} %{buildroot}%{_sysconfdir}/systemd/system/%{name}-sentinel.service.d/limit.conf
|
||||||
|
%else # install SysV service files
|
||||||
install -pDm755 %{S:5} %{buildroot}%{_initrddir}/%{name}-sentinel
|
install -pDm755 %{S:5} %{buildroot}%{_initrddir}/%{name}-sentinel
|
||||||
%endif
|
|
||||||
install -pDm755 %{S:6} %{buildroot}%{_initrddir}/%{name}
|
install -pDm755 %{S:6} %{buildroot}%{_initrddir}/%{name}
|
||||||
|
install -p -D -m 644 %{S:9} %{buildroot}%{_sysconfdir}/security/limits.d/95-%{name}.conf
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Fix non-standard-executable-perm error.
|
# Fix non-standard-executable-perm error.
|
||||||
@ -171,7 +164,7 @@ chmod 755 %{buildroot}%{_bindir}/%{name}-*
|
|||||||
|
|
||||||
# create redis-sentinel command as described on
|
# create redis-sentinel command as described on
|
||||||
# http://redis.io/topics/sentinel
|
# http://redis.io/topics/sentinel
|
||||||
ln -s %{name}-server %{buildroot}%{_bindir}/%{name}-sentinel
|
ln -sf %{name}-server %{buildroot}%{_bindir}/%{name}-sentinel
|
||||||
|
|
||||||
# Install redis-shutdown
|
# Install redis-shutdown
|
||||||
install -pDm755 %{S:7} %{buildroot}%{_bindir}/%{name}-shutdown
|
install -pDm755 %{S:7} %{buildroot}%{_bindir}/%{name}-shutdown
|
||||||
@ -179,10 +172,8 @@ install -pDm755 %{S:7} %{buildroot}%{_bindir}/%{name}-shutdown
|
|||||||
%check
|
%check
|
||||||
%if 0%{?with_tests}
|
%if 0%{?with_tests}
|
||||||
make test ||:
|
make test ||:
|
||||||
%if 0%{?with_sentinel}
|
|
||||||
make test-sentinel ||:
|
make test-sentinel ||:
|
||||||
%endif
|
%endif
|
||||||
%endif
|
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
getent group %{name} &> /dev/null || \
|
getent group %{name} &> /dev/null || \
|
||||||
@ -195,44 +186,32 @@ exit 0
|
|||||||
%post
|
%post
|
||||||
%if 0%{?with_systemd}
|
%if 0%{?with_systemd}
|
||||||
%systemd_post %{name}.service
|
%systemd_post %{name}.service
|
||||||
%if 0%{?with_sentinel}
|
|
||||||
%systemd_post %{name}-sentinel.service
|
%systemd_post %{name}-sentinel.service
|
||||||
%endif
|
|
||||||
%else
|
%else
|
||||||
chkconfig --add %{name}
|
chkconfig --add %{name}
|
||||||
%if 0%{?with_sentinel}
|
|
||||||
chkconfig --add %{name}-sentinel
|
chkconfig --add %{name}-sentinel
|
||||||
%endif
|
%endif
|
||||||
%endif
|
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
%if 0%{?with_systemd}
|
%if 0%{?with_systemd}
|
||||||
%systemd_preun %{name}.service
|
%systemd_preun %{name}.service
|
||||||
%if 0%{?with_sentinel}
|
|
||||||
%systemd_preun %{name}-sentinel.service
|
%systemd_preun %{name}-sentinel.service
|
||||||
%endif
|
|
||||||
%else
|
%else
|
||||||
if [ $1 -eq 0 ] ; then
|
if [ $1 -eq 0 ] ; then
|
||||||
service %{name} stop &> /dev/null
|
service %{name} stop &> /dev/null
|
||||||
chkconfig --del %{name} &> /dev/null
|
chkconfig --del %{name} &> /dev/null
|
||||||
%if 0%{?with_sentinel}
|
|
||||||
service %{name}-sentinel stop &> /dev/null
|
service %{name}-sentinel stop &> /dev/null
|
||||||
chkconfig --del %{name}-sentinel &> /dev/null
|
chkconfig --del %{name}-sentinel &> /dev/null
|
||||||
%endif
|
%endif
|
||||||
%endif
|
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
%if 0%{?with_systemd}
|
%if 0%{?with_systemd}
|
||||||
%systemd_postun_with_restart %{name}.service
|
%systemd_postun_with_restart %{name}.service
|
||||||
%if 0%{?with_sentinel}
|
|
||||||
%systemd_postun_with_restart %{name}-sentinel.service
|
%systemd_postun_with_restart %{name}-sentinel.service
|
||||||
%endif
|
|
||||||
%else
|
%else
|
||||||
if [ "$1" -ge "1" ] ; then
|
if [ "$1" -ge "1" ] ; then
|
||||||
service %{name} condrestart >/dev/null 2>&1 || :
|
service %{name} condrestart >/dev/null 2>&1 || :
|
||||||
%if 0%{?with_sentinel}
|
|
||||||
service %{name}-sentinel condrestart >/dev/null 2>&1 || :
|
service %{name}-sentinel condrestart >/dev/null 2>&1 || :
|
||||||
%endif
|
|
||||||
fi
|
fi
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -242,27 +221,32 @@ fi
|
|||||||
%doc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README
|
%doc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README
|
||||||
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
|
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
|
||||||
%attr(0644, redis, root) %config(noreplace) %{_sysconfdir}/%{name}.conf
|
%attr(0644, redis, root) %config(noreplace) %{_sysconfdir}/%{name}.conf
|
||||||
%if 0%{?with_sentinel}
|
|
||||||
%attr(0644, redis, root) %config(noreplace) %{_sysconfdir}/%{name}-sentinel.conf
|
%attr(0644, redis, root) %config(noreplace) %{_sysconfdir}/%{name}-sentinel.conf
|
||||||
%endif
|
%dir %attr(0755, redis, redis) %{_sharedstatedir}/%{name}
|
||||||
%dir %attr(0750, redis, redis) %{_sharedstatedir}/%{name}
|
%dir %attr(0755, redis, redis) %{_localstatedir}/log/%{name}
|
||||||
%dir %attr(0750, redis, redis) %{_localstatedir}/log/%{name}
|
%dir %attr(0755, redis, redis) %{_localstatedir}/run/%{name}
|
||||||
%dir %attr(0750, redis, redis) %{_localstatedir}/run/%{name}
|
|
||||||
%{_bindir}/%{name}-*
|
%{_bindir}/%{name}-*
|
||||||
%if 0%{?with_systemd}
|
%if 0%{?with_systemd}
|
||||||
%{_tmpfilesdir}/%{name}.conf
|
%{_tmpfilesdir}/%{name}.conf
|
||||||
%{_unitdir}/%{name}.service
|
%{_unitdir}/%{name}.service
|
||||||
%if 0%{?with_sentinel}
|
|
||||||
%{_unitdir}/%{name}-sentinel.service
|
%{_unitdir}/%{name}-sentinel.service
|
||||||
%endif
|
%dir %{_sysconfdir}/systemd/system/%{name}.service.d
|
||||||
|
%config(noreplace) %{_sysconfdir}/systemd/system/%{name}.service.d/limit.conf
|
||||||
|
%dir %{_sysconfdir}/systemd/system/%{name}-sentinel.service.d
|
||||||
|
%config(noreplace) %{_sysconfdir}/systemd/system/%{name}-sentinel.service.d/limit.conf
|
||||||
%else
|
%else
|
||||||
%{_initrddir}/%{name}
|
%{_initrddir}/%{name}
|
||||||
%if 0%{?with_sentinel}
|
|
||||||
%{_initrddir}/%{name}-sentinel
|
%{_initrddir}/%{name}-sentinel
|
||||||
%endif
|
%config(noreplace) %{_sysconfdir}/security/limits.d/95-%{name}.conf
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Feb 26 2015 Haïkel Guémar <hguemar@fedoraproject.org> - 2.8.19-1
|
||||||
|
- Upstream 2.8.19 (RHBZ #1175232)
|
||||||
|
- Fix permissions (RHBZ #1182913)
|
||||||
|
- Add limits config file
|
||||||
|
- Spec cleanups
|
||||||
|
|
||||||
* Tue Dec 09 2014 Haïkel Guémar <hguemar@fedoraproject.org> - 2.8.18-1
|
* Tue Dec 09 2014 Haïkel Guémar <hguemar@fedoraproject.org> - 2.8.18-1
|
||||||
- Upstream 2.8.18
|
- Upstream 2.8.18
|
||||||
- Backport init scripts fixes from rawhide
|
- Backport init scripts fixes from rawhide
|
||||||
|
Loading…
x
Reference in New Issue
Block a user