- Upstream 2.8.17
- fix redis-sentinel service unit file for systemd - fix redis-shutdown for sentinel - also use redis-shutdown in init scripts
This commit is contained in:
parent
e4f5128ae6
commit
f312977bd1
@ -8,11 +8,11 @@
|
||||
# Source function library.
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
NAME="redis-sentinel"
|
||||
EXEC="/usr/bin/$NAME"
|
||||
name="redis-sentinel"
|
||||
exec="/usr/bin/$name"
|
||||
shut="/usr/bin/redis-shutdown"
|
||||
pidfile="/var/run/redis/sentinel.pid"
|
||||
SENTINEL_CONFIG="/etc/redis-sentinel.conf"
|
||||
RUNDIR="/var/run/redis"
|
||||
PIDFILE="$RUNDIR/redis-sentinel.pid"
|
||||
|
||||
[ -e /etc/sysconfig/redis-sentinel ] && . /etc/sysconfig/redis-sentinel
|
||||
|
||||
@ -20,13 +20,9 @@ lockfile=/var/lock/subsys/redis
|
||||
|
||||
start() {
|
||||
[ -f $SENTINEL_CONFIG ] || exit 6
|
||||
[ -x $EXEC ] || exit 5
|
||||
echo -n $"Starting $NAME: "
|
||||
mkdir -p $RUNDIR
|
||||
touch $PIDFILE
|
||||
chown redis:redis $RUNDIR $PIDFILE
|
||||
chmod 750 $RUNDIR
|
||||
daemon --user ${REDIS_USER-redis} --pidfile=$PIDFILE "$EXEC $SENTINEL_CONFIG"
|
||||
[ -x $exec ] || exit 5
|
||||
echo -n $"Starting $name: "
|
||||
daemon --user ${REDIS_USER-redis} "$exec $SENTINEL_CONFIG --daemonize yes --pidfile $pidfile"
|
||||
retval=$?
|
||||
echo
|
||||
[ $retval -eq 0 ] && touch $lockfile
|
||||
@ -34,9 +30,17 @@ start() {
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo -n $"Stopping $NAME: "
|
||||
killproc -p $PIDFILE $NAME
|
||||
echo -n $"Stopping $name: "
|
||||
[ -x $shut ] && $shut $name
|
||||
retval=$?
|
||||
if [ -f $pidfile ]
|
||||
then
|
||||
# shutdown haven't work, try old way
|
||||
killproc -p $pidfile $name
|
||||
retval=$?
|
||||
else
|
||||
success "$name shutdown"
|
||||
fi
|
||||
echo
|
||||
[ $retval -eq 0 ] && rm -f $lockfile
|
||||
return $retval
|
||||
@ -52,7 +56,7 @@ reload() {
|
||||
}
|
||||
|
||||
rh_status() {
|
||||
status -p $PIDFILE $NAME
|
||||
status -p $pidfile $name
|
||||
}
|
||||
|
||||
rh_status_q() {
|
||||
|
@ -4,9 +4,10 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/redis-sentinel /etc/redis-sentinel.conf --daemonize no
|
||||
ExecStop=/usr/bin/redis-shutdown sentinel
|
||||
ExecStop=/usr/bin/redis-shutdown redis-sentinel
|
||||
User=redis
|
||||
Group=redis
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
|
@ -6,7 +6,7 @@ test x"$REDIS_DEBUG" != x && set -x
|
||||
REDIS_CLI=/usr/bin/redis-cli
|
||||
|
||||
# Retrieve service name
|
||||
SERVICE_NAME="$2"
|
||||
SERVICE_NAME="$1"
|
||||
if [ -z "$SERVICE_NAME" ]; then
|
||||
SERVICE_NAME=redis
|
||||
fi
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
name="redis-server"
|
||||
exec="/usr/bin/$name"
|
||||
shut="/usr/bin/redis-shutdown"
|
||||
pidfile="/var/run/redis/redis.pid"
|
||||
REDIS_CONFIG="/etc/redis.conf"
|
||||
|
||||
@ -30,8 +31,16 @@ start() {
|
||||
|
||||
stop() {
|
||||
echo -n $"Stopping $name: "
|
||||
[ -x $shut ] && $shut
|
||||
retval=$?
|
||||
if [ -f $pidfile ]
|
||||
then
|
||||
# shutdown haven't work, try old way
|
||||
killproc -p $pidfile $name
|
||||
retval=$?
|
||||
else
|
||||
success "$name shutdown"
|
||||
fi
|
||||
echo
|
||||
[ $retval -eq 0 ] && rm -f $lockfile
|
||||
return $retval
|
||||
|
10
redis.spec
10
redis.spec
@ -18,8 +18,8 @@
|
||||
%global with_tests %{?_with_tests:1}%{!?_with_tests:0}
|
||||
|
||||
Name: redis
|
||||
Version: 2.8.15
|
||||
Release: 2%{?dist}
|
||||
Version: 2.8.17
|
||||
Release: 1%{?dist}
|
||||
Summary: A persistent key-value database
|
||||
License: BSD
|
||||
URL: http://redis.io
|
||||
@ -263,6 +263,12 @@ fi
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Sun Sep 20 2014 Remi Collet <remi@fedoraproject.org> - 2.8.17-1
|
||||
- Upstream 2.8.17
|
||||
- fix redis-sentinel service unit file for systemd
|
||||
- fix redis-shutdown for sentinel
|
||||
- also use redis-shutdown in init scripts
|
||||
|
||||
* Wed Sep 17 2014 Haïkel Guémar <hguemar@fedoraproject.org> - 2.8.15-2
|
||||
- Minor fix to redis-shutdown (from Remi Collet)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user