Revert/clean up broken changes to allow redis to work at all on systemd.
This commit is contained in:
parent
46ea918a98
commit
01c0789b60
@ -1,13 +1,7 @@
|
|||||||
Index: redis-2.8.11/redis.conf
|
diff -urN redis-2.8.13.orig/redis.conf redis-2.8.13/redis.conf
|
||||||
===================================================================
|
--- redis-2.8.13.orig/redis.conf 2014-07-14 05:48:14.000000000 -1000
|
||||||
--- redis-2.8.11.orig/redis.conf
|
+++ redis-2.8.13/redis.conf 2014-07-29 02:35:49.053847503 -1000
|
||||||
+++ redis-2.8.11/redis.conf
|
@@ -38,7 +38,7 @@
|
||||||
@@ -34,11 +34,11 @@
|
|
||||||
|
|
||||||
# By default Redis does not run as a daemon. Use 'yes' if you need it.
|
|
||||||
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
|
|
||||||
-daemonize no
|
|
||||||
+daemonize yes
|
|
||||||
|
|
||||||
# When running daemonized, Redis writes a pid file in /var/run/redis.pid by
|
# When running daemonized, Redis writes a pid file in /var/run/redis.pid by
|
||||||
# default. You can specify a custom pid file location here.
|
# default. You can specify a custom pid file location here.
|
||||||
@ -16,7 +10,7 @@ Index: redis-2.8.11/redis.conf
|
|||||||
|
|
||||||
# Accept connections on the specified port, default is 6379.
|
# Accept connections on the specified port, default is 6379.
|
||||||
# If port 0 is specified Redis will not listen on a TCP socket.
|
# If port 0 is specified Redis will not listen on a TCP socket.
|
||||||
@@ -61,7 +61,7 @@ tcp-backlog 511
|
@@ -61,7 +61,7 @@
|
||||||
# Examples:
|
# Examples:
|
||||||
#
|
#
|
||||||
# bind 192.168.1.100 10.0.0.1
|
# bind 192.168.1.100 10.0.0.1
|
||||||
@ -25,16 +19,7 @@ Index: redis-2.8.11/redis.conf
|
|||||||
|
|
||||||
# Specify the path for the Unix socket that will be used to listen for
|
# Specify the path for the Unix socket that will be used to listen for
|
||||||
# incoming connections. There is no default, so Redis will not listen
|
# incoming connections. There is no default, so Redis will not listen
|
||||||
@@ -87,7 +87,7 @@ timeout 0
|
@@ -100,7 +100,7 @@
|
||||||
# On other kernels the period depends on the kernel configuration.
|
|
||||||
#
|
|
||||||
# A reasonable value for this option is 60 seconds.
|
|
||||||
-tcp-keepalive 0
|
|
||||||
+tcp-keepalive 60
|
|
||||||
|
|
||||||
# Specify the server verbosity level.
|
|
||||||
# This can be one of:
|
|
||||||
@@ -100,7 +100,7 @@ loglevel notice
|
|
||||||
# Specify the log file name. Also the empty string can be used to force
|
# Specify the log file name. Also the empty string can be used to force
|
||||||
# Redis to log on the standard output. Note that if you use standard
|
# Redis to log on the standard output. Note that if you use standard
|
||||||
# output for logging but daemonize, logs will be sent to /dev/null
|
# output for logging but daemonize, logs will be sent to /dev/null
|
||||||
@ -43,7 +28,7 @@ Index: redis-2.8.11/redis.conf
|
|||||||
|
|
||||||
# To enable logging to the system logger, just set 'syslog-enabled' to yes,
|
# To enable logging to the system logger, just set 'syslog-enabled' to yes,
|
||||||
# and optionally update the other syslog parameters to suit your needs.
|
# and optionally update the other syslog parameters to suit your needs.
|
||||||
@@ -184,7 +184,7 @@ dbfilename dump.rdb
|
@@ -184,7 +184,7 @@
|
||||||
# The Append Only File will also be created inside this directory.
|
# The Append Only File will also be created inside this directory.
|
||||||
#
|
#
|
||||||
# Note that you must specify a directory here, not a file name.
|
# Note that you must specify a directory here, not a file name.
|
@ -3,7 +3,6 @@ Description=Redis Sentinel
|
|||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStartPre=/usr/bin/mkdir -p /var/lib/redis
|
|
||||||
ExecStart=/usr/bin/redis-sentinel /etc/sentinel.conf
|
ExecStart=/usr/bin/redis-sentinel /etc/sentinel.conf
|
||||||
ExecStop=/usr/bin/redis-cli shutdown
|
ExecStop=/usr/bin/redis-cli shutdown
|
||||||
User=redis
|
User=redis
|
||||||
|
@ -8,11 +8,10 @@
|
|||||||
# Source function library.
|
# Source function library.
|
||||||
. /etc/rc.d/init.d/functions
|
. /etc/rc.d/init.d/functions
|
||||||
|
|
||||||
NAME="redis-server"
|
name="redis-server"
|
||||||
EXEC="/usr/bin/$NAME"
|
exec="/usr/sbin/$name"
|
||||||
|
pidfile="/var/run/redis/redis.pid"
|
||||||
REDIS_CONFIG="/etc/redis.conf"
|
REDIS_CONFIG="/etc/redis.conf"
|
||||||
RUNDIR="/var/run/redis"
|
|
||||||
PIDFILE="$RUNDIR/redis.pid"
|
|
||||||
|
|
||||||
[ -e /etc/sysconfig/redis ] && . /etc/sysconfig/redis
|
[ -e /etc/sysconfig/redis ] && . /etc/sysconfig/redis
|
||||||
|
|
||||||
@ -20,13 +19,9 @@ lockfile=/var/lock/subsys/redis
|
|||||||
|
|
||||||
start() {
|
start() {
|
||||||
[ -f $REDIS_CONFIG ] || exit 6
|
[ -f $REDIS_CONFIG ] || exit 6
|
||||||
[ -x $EXEC ] || exit 5
|
[ -x $exec ] || exit 5
|
||||||
echo -n $"Starting $NAME: "
|
echo -n $"Starting $name: "
|
||||||
mkdir -p $RUNDIR
|
daemon --user ${REDIS_USER-redis} "$exec $REDIS_CONFIG"
|
||||||
touch $PIDFILE
|
|
||||||
chown redis:redis $RUNDIR $PIDFILE
|
|
||||||
chmod 750 $RUNDIR
|
|
||||||
daemon --user ${REDIS_USER-redis} "$EXEC $REDIS_CONFIG"
|
|
||||||
retval=$?
|
retval=$?
|
||||||
echo
|
echo
|
||||||
[ $retval -eq 0 ] && touch $lockfile
|
[ $retval -eq 0 ] && touch $lockfile
|
||||||
@ -34,8 +29,8 @@ start() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
echo -n $"Stopping $NAME: "
|
echo -n $"Stopping $name: "
|
||||||
killproc -p $PIDFILE $NAME
|
killproc -p $pidfile $name
|
||||||
retval=$?
|
retval=$?
|
||||||
echo
|
echo
|
||||||
[ $retval -eq 0 ] && rm -f $lockfile
|
[ $retval -eq 0 ] && rm -f $lockfile
|
||||||
@ -52,7 +47,7 @@ reload() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rh_status() {
|
rh_status() {
|
||||||
status -p $PIDFILE $NAME
|
status -p $pidfile $name
|
||||||
}
|
}
|
||||||
|
|
||||||
rh_status_q() {
|
rh_status_q() {
|
@ -3,11 +3,10 @@ Description=Redis persistent key-value database
|
|||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStartPre=/usr/bin/mkdir -p /var/lib/redis
|
|
||||||
ExecStart=/usr/bin/redis-server /etc/redis.conf
|
ExecStart=/usr/bin/redis-server /etc/redis.conf
|
||||||
ExecStop=/usr/bin/redis-cli shutdown
|
|
||||||
User=redis
|
User=redis
|
||||||
Group=redis
|
Group=redis
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
46
redis.spec
46
redis.spec
@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
%global with_perftools 0
|
%global with_perftools 0
|
||||||
|
|
||||||
# Prior to redis 2.8 sentinel didn't work correctly.
|
# redis 2.8 sentinel is the first upstream version to work
|
||||||
|
# however as packaged here it is entirely broken
|
||||||
|
# FIXME: consider removal into a separate package
|
||||||
%if 0%{?fedora} >= 21 || 0%{?rhel} >= 7
|
%if 0%{?fedora} >= 21 || 0%{?rhel} >= 7
|
||||||
%global with_sentinel 1
|
%global with_sentinel 1
|
||||||
%endif
|
%endif
|
||||||
@ -22,19 +24,19 @@
|
|||||||
|
|
||||||
Name: redis
|
Name: redis
|
||||||
Version: 2.8.13
|
Version: 2.8.13
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
Summary: A persistent caching system, key-value and data structures database
|
Summary: A persistent caching system, key-value and data structures database
|
||||||
License: BSD
|
License: BSD
|
||||||
URL: http://redis.io
|
URL: http://redis.io
|
||||||
Source0: http://download.redis.io/releases/%{name}-%{version}.tar.gz
|
Source0: http://download.redis.io/releases/%{name}-%{version}.tar.gz
|
||||||
Source1: %{name}.logrotate
|
Source1: %{name}.logrotate
|
||||||
Source2: %{name}-sentinel.service
|
Source2: %{name}-sentinel.service
|
||||||
Source3: %{name}-server.service
|
Source3: %{name}.service
|
||||||
Source4: %{name}.tmpfiles
|
Source4: %{name}.tmpfiles
|
||||||
Source5: %{name}-sentinel.init
|
Source5: %{name}-sentinel.init
|
||||||
Source6: %{name}-server.init
|
Source6: %{name}.init
|
||||||
# Update configuration for Fedora
|
# Update configuration for Fedora
|
||||||
Patch0: redis-2.8.11-redis-conf-location-variables.patch
|
Patch0: redis-2.8.11-redis-conf.patch
|
||||||
Patch1: redis-2.8.11-deps-library-fPIC-performance-tuning.patch
|
Patch1: redis-2.8.11-deps-library-fPIC-performance-tuning.patch
|
||||||
Patch2: redis-2.8.11-use-system-jemalloc.patch
|
Patch2: redis-2.8.11-use-system-jemalloc.patch
|
||||||
# tests/integration/replication-psync.tcl failed on slow machines(GITHUB #1417)
|
# tests/integration/replication-psync.tcl failed on slow machines(GITHUB #1417)
|
||||||
@ -157,7 +159,7 @@ install -pDm644 %{S:4} %{buildroot}%{_tmpfilesdir}/%{name}.conf
|
|||||||
%if 0%{?with_sentinel}
|
%if 0%{?with_sentinel}
|
||||||
install -pDm755 %{S:5} %{buildroot}%{_initrddir}/%{name}-sentinel
|
install -pDm755 %{S:5} %{buildroot}%{_initrddir}/%{name}-sentinel
|
||||||
%endif
|
%endif
|
||||||
install -pDm755 %{S:6} %{buildroot}%{_initrddir}/%{name}-server
|
install -pDm755 %{S:6} %{buildroot}%{_initrddir}/%{name}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Fix non-standard-executable-perm error.
|
# Fix non-standard-executable-perm error.
|
||||||
@ -183,12 +185,12 @@ exit 0
|
|||||||
%if 0%{?with_sentinel}
|
%if 0%{?with_sentinel}
|
||||||
%systemd_post %{name}-sentinel.service
|
%systemd_post %{name}-sentinel.service
|
||||||
%endif
|
%endif
|
||||||
%systemd_post %{name}-server.service
|
%systemd_post %{name}.service
|
||||||
%else
|
%else
|
||||||
%if 0%{?with_sentinel}
|
%if 0%{?with_sentinel}
|
||||||
chkconfig --add %{name}-sentinel
|
chkconfig --add %{name}-sentinel
|
||||||
%endif
|
%endif
|
||||||
chkconfig --add %{name}-server
|
chkconfig --add %{name}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
@ -196,15 +198,15 @@ chkconfig --add %{name}-server
|
|||||||
%if 0%{?with_sentinel}
|
%if 0%{?with_sentinel}
|
||||||
%systemd_preun %{name}-sentinel.service
|
%systemd_preun %{name}-sentinel.service
|
||||||
%endif
|
%endif
|
||||||
%systemd_preun %{name}-server.service
|
%systemd_preun %{name}.service
|
||||||
%else
|
%else
|
||||||
if [ $1 -eq 0 ] ; then
|
if [ $1 -eq 0 ] ; then
|
||||||
%if 0%{?with_sentinel}
|
%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
|
||||||
service %{name}-server stop &> /dev/null
|
service %{name} stop &> /dev/null
|
||||||
chkconfig --del %{name}-server &> /dev/null
|
chkconfig --del %{name} &> /dev/null
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
@ -212,13 +214,13 @@ chkconfig --del %{name}-server &> /dev/null
|
|||||||
%if 0%{?with_sentinel}
|
%if 0%{?with_sentinel}
|
||||||
%systemd_postun_with_restart %{name}-sentinel.service
|
%systemd_postun_with_restart %{name}-sentinel.service
|
||||||
%endif
|
%endif
|
||||||
%systemd_postun_with_restart %{name}-server.service
|
%systemd_postun_with_restart %{name}.service
|
||||||
%else
|
%else
|
||||||
if [ "$1" -ge "1" ] ; then
|
if [ "$1" -ge "1" ] ; then
|
||||||
%if 0%{?with_sentinel}
|
%if 0%{?with_sentinel}
|
||||||
service %{name}-sentinel condrestart >/dev/null 2>&1 || :
|
service %{name}-sentinel condrestart >/dev/null 2>&1 || :
|
||||||
%endif
|
%endif
|
||||||
service %{name}-server condrestart >/dev/null 2>&1 || :
|
service %{name} condrestart >/dev/null 2>&1 || :
|
||||||
fi
|
fi
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -231,22 +233,34 @@ fi
|
|||||||
%endif
|
%endif
|
||||||
%dir %attr(0750, redis, redis) %{_sharedstatedir}/%{name}
|
%dir %attr(0750, redis, redis) %{_sharedstatedir}/%{name}
|
||||||
%dir %attr(0750, redis, redis) %{_localstatedir}/log/%{name}
|
%dir %attr(0750, redis, redis) %{_localstatedir}/log/%{name}
|
||||||
%ghost %dir %attr(0750, 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
|
||||||
%if 0%{?with_sentinel}
|
%if 0%{?with_sentinel}
|
||||||
%{_unitdir}/%{name}-sentinel.service
|
%{_unitdir}/%{name}-sentinel.service
|
||||||
%endif
|
%endif
|
||||||
%{_unitdir}/%{name}-server.service
|
%{_unitdir}/%{name}.service
|
||||||
%else
|
%else
|
||||||
%if 0%{?with_sentinel}
|
%if 0%{?with_sentinel}
|
||||||
%{_initrddir}/%{name}-sentinel
|
%{_initrddir}/%{name}-sentinel
|
||||||
%endif
|
%endif
|
||||||
%{_initrddir}/%{name}-server
|
%{_initrddir}/%{name}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jul 29 2014 Warren Togami <warren@slickage.com> - 2.8.13-3
|
||||||
|
- Revert rename redis.service to redis-server (4 years as packaged service name).
|
||||||
|
- Revert "daemonize yes" in default redis.conf
|
||||||
|
systemd handles background and process tracking on its own, this broke systemd launch.
|
||||||
|
- Revert redis.init as it too handled daemonizing.
|
||||||
|
- Revert tcp-keepalive default to 0.
|
||||||
|
- Revert ExecStartPre hack, /var/lib/redis is owned by the package.
|
||||||
|
No %ghost directories, just own it.
|
||||||
|
- FIXME: sentinel is broken, mispackaged and quite possibly belongs in an entirely separate package
|
||||||
|
because it is not meant to be used concurrently with the ordinary systemd redis and it requires
|
||||||
|
a highly specialized custom configuration.
|
||||||
|
|
||||||
* Wed Jul 23 2014 Warren Togami <warren@slickage.com> - 2.8.13-2
|
* Wed Jul 23 2014 Warren Togami <warren@slickage.com> - 2.8.13-2
|
||||||
- Fix detection of EL7: systemd unit was missing
|
- Fix detection of EL7: systemd unit was missing
|
||||||
- Fix detection of EL5
|
- Fix detection of EL5
|
||||||
|
Loading…
x
Reference in New Issue
Block a user