summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2014-09-12 18:09:08 +0200
committerRemi Collet <fedora@famillecollet.com>2014-09-12 18:09:08 +0200
commit912b891ca07160a56924e91db92e8b4d40aa1175 (patch)
tree6926b3a08869aede23d8577f9a899a76b4909129
parent5d9fa3923a03b577eca13ba60fb95b36d9e5df72 (diff)
redis: 2.8.15
-rw-r--r--redis-2.8.15-conf.patch (renamed from redis-2.8.10-conf.patch)18
-rw-r--r--redis-sentinel.init (renamed from sentinel.init)4
-rw-r--r--redis-sentinel.service13
-rw-r--r--redis-shutdown28
-rw-r--r--redis.init4
-rw-r--r--redis.service7
-rw-r--r--redis.spec27
-rw-r--r--sentinel.service12
8 files changed, 75 insertions, 38 deletions
diff --git a/redis-2.8.10-conf.patch b/redis-2.8.15-conf.patch
index 77c2696..fc5e343 100644
--- a/redis-2.8.10-conf.patch
+++ b/redis-2.8.15-conf.patch
@@ -1,6 +1,6 @@
-diff -up redis-2.8.10/redis.conf.rpmconf redis-2.8.10/redis.conf
---- redis-2.8.10/redis.conf.rpmconf 2014-06-05 11:02:23.000000000 +0200
-+++ redis-2.8.10/redis.conf 2014-06-06 17:10:07.493834288 +0200
+diff -up redis-2.8.15/redis.conf.rpmconf redis-2.8.15/redis.conf
+--- redis-2.8.15/redis.conf.rpmconf 2014-09-12 16:16:58.000000000 +0200
++++ redis-2.8.15/redis.conf 2014-09-12 17:46:45.918482580 +0200
@@ -62,6 +62,7 @@ tcp-backlog 511
#
# bind 192.168.1.100 10.0.0.1
@@ -27,9 +27,9 @@ diff -up redis-2.8.10/redis.conf.rpmconf redis-2.8.10/redis.conf
################################# REPLICATION #################################
-diff -up redis-2.8.10/sentinel.conf.rpmconf redis-2.8.10/sentinel.conf
---- redis-2.8.10/sentinel.conf.rpmconf 2014-06-06 17:10:07.493834288 +0200
-+++ redis-2.8.10/sentinel.conf 2014-06-06 17:12:17.168324319 +0200
+diff -up redis-2.8.15/sentinel.conf.rpmconf redis-2.8.15/sentinel.conf
+--- redis-2.8.15/sentinel.conf.rpmconf 2014-09-12 17:46:45.918482580 +0200
++++ redis-2.8.15/sentinel.conf 2014-09-12 17:47:39.512717702 +0200
@@ -4,6 +4,11 @@
# The port that this sentinel instance will run on
port 26379
@@ -39,6 +39,6 @@ diff -up redis-2.8.10/sentinel.conf.rpmconf redis-2.8.10/sentinel.conf
+# output for logging but daemonize, logs will be sent to /dev/null
+logfile /var/log/redis/sentinel.log
+
- # dir <working-directory>
- # Every long running process should have a well-defined working directory.
- # For Redis Sentinel to chdir to /tmp at startup is the simplest thing
+ # sentinel announce-ip <ip>
+ # sentinel announce-port <port>
+ #
diff --git a/sentinel.init b/redis-sentinel.init
index 0ed325b..115f65b 100644
--- a/sentinel.init
+++ b/redis-sentinel.init
@@ -9,7 +9,7 @@
. /etc/rc.d/init.d/functions
name="redis-sentinel"
-exec="/usr/sbin/$name"
+exec="/usr/bin/$name"
pidfile="/var/run/redis/sentinel.pid"
REDIS_CONFIG="/etc/redis-sentinel.conf"
@@ -21,7 +21,7 @@ start() {
[ -f $REDIS_CONFIG ] || exit 6
[ -x $exec ] || exit 5
echo -n $"Starting $name: "
- daemon --user ${REDIS_USER-redis} "$exec $REDIS_CONFIG --daemonize yes --pidfile $pidfile"
+ daemon --user ${REDIS_USER-redis} "$exec $REDIS_CONFIG --daemonize yes --pidfile $pidfile"
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
diff --git a/redis-sentinel.service b/redis-sentinel.service
new file mode 100644
index 0000000..ff3a117
--- /dev/null
+++ b/redis-sentinel.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Redis Sentinel
+After=network.target
+
+[Service]
+ExecStart=/usr/bin/redis-sentinel /etc/redis-sentinel.conf --daemonize no
+ExecStop=/usr/bin/redis-shutdown sentinel
+User=redis
+Group=redis
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/redis-shutdown b/redis-shutdown
new file mode 100644
index 0000000..1bf0e16
--- /dev/null
+++ b/redis-shutdown
@@ -0,0 +1,28 @@
+#!/bin/bash
+#
+# Wrapper to close properly redis and sentinel
+test x"REDIS_DEBUG" != x && set -x
+
+REDIS_CLI=/usr/bin/redis-cli
+
+# Retrieve service name
+SERVICE_NAME="$2"
+if [ -z "$SERVICE_NAME" ]; then
+ SERVICE_NAME=redis
+fi
+
+# Get the proper config file based on service name
+CONFIG_FILE="/etc/$SERVICE_NAME.conf"
+
+# Use awk to retrieve port from config file
+PORT=`awk '/^[[:blank:]]*port/ { print $2 }' $CONFIG_FILE`
+
+# Just in case, use default port
+if [ "$SERVICE_NAME" = redis ]; then
+ PORT=${PORT:-6379}
+else
+ PORT=${PORT:-26739}
+fi
+
+# shutdown the service properly
+$REDIS_CLI -p $PORT shutdown \ No newline at end of file
diff --git a/redis.init b/redis.init
index f100f9f..0479769 100644
--- a/redis.init
+++ b/redis.init
@@ -9,7 +9,7 @@
. /etc/rc.d/init.d/functions
name="redis-server"
-exec="/usr/sbin/$name"
+exec="/usr/bin/$name"
pidfile="/var/run/redis/redis.pid"
REDIS_CONFIG="/etc/redis.conf"
@@ -21,7 +21,7 @@ start() {
[ -f $REDIS_CONFIG ] || exit 6
[ -x $exec ] || exit 5
echo -n $"Starting $name: "
- daemon --user ${REDIS_USER-redis} "$exec $REDIS_CONFIG --daemonize yes --pidfile $pidfile"
+ daemon --user ${REDIS_USER-redis} "$exec $REDIS_CONFIG --daemonize yes --pidfile $pidfile"
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
diff --git a/redis.service b/redis.service
index c7bb48a..1c549b4 100644
--- a/redis.service
+++ b/redis.service
@@ -1,9 +1,10 @@
[Unit]
-Description=A persistent key-value database
-After=syslog.target network.target
+Description=Redis persistent key-value database
+After=network.target
[Service]
-ExecStart=/usr/sbin/redis-server /etc/redis.conf --daemonize no
+ExecStart=/usr/bin/redis-server /etc/redis.conf --daemonize no
+ExecStop=/usr/bin/redis-shutdown
User=redis
Group=redis
diff --git a/redis.spec b/redis.spec
index 50ce0bf..49d6c52 100644
--- a/redis.spec
+++ b/redis.spec
@@ -10,7 +10,7 @@
%global with_tests %{?_with_tests:1}%{!?_with_tests:0}
Name: redis
-Version: 2.8.14
+Version: 2.8.15
Release: 1%{?dist}
Summary: A persistent key-value database
@@ -22,10 +22,11 @@ Source1: %{name}.logrotate
Source2: %{name}.init
Source3: %{name}.service
Source4: %{name}.tmpfiles
-Source5: sentinel.init
-Source6: sentinel.service
+Source5: %{name}-sentinel.init
+Source6: %{name}-sentinel.service
+Source7: %{name}-shutdown
# Update configuration for Fedora
-Patch0: %{name}-2.8.10-conf.patch
+Patch0: %{name}-2.8.15-conf.patch
Patch1: %{name}-deps-PIC.patch
Patch2: %{name}-deps-unbundle-jemalloc.patch
@@ -35,6 +36,8 @@ BuildRequires: tcl >= 8.5
%endif
BuildRequires: jemalloc-devel
+# Required for redis-shutdown
+Requires: /bin/awk
Requires: logrotate
Requires(pre): shadow-utils
%if %{with_systemd}
@@ -117,13 +120,12 @@ install -p -D -m 755 %{SOURCE5} %{buildroot}%{_initrddir}/%{name}-sentinel
# Fix non-standard-executable-perm error
chmod 755 %{buildroot}%{_bindir}/%{name}-*
-# Ensure redis-server location doesn't change
-mkdir -p %{buildroot}%{_sbindir}
-mv %{buildroot}%{_bindir}/%{name}-server %{buildroot}%{_sbindir}/%{name}-server
-
# create redis-sentinel command as described on
# http://redis.io/topics/sentinel
-ln -s %{name}-server %{buildroot}%{_sbindir}/%{name}-sentinel
+ln -s %{name}-server %{buildroot}%{_bindir}/%{name}-sentinel
+
+# Install redis-shutdown
+install -pDm755 %{SOURCE7} %{buildroot}%{_bindir}/%{name}-shutdown
%post
@@ -202,7 +204,6 @@ fi
%dir %attr(0755, redis, root) %{_localstatedir}/log/%{name}
%dir %attr(0755, redis, root) %{_localstatedir}/run/%{name}
%{_bindir}/%{name}-*
-%{_sbindir}/%{name}-*
%if %{with_systemd}
%{_prefix}/lib/tmpfiles.d/%{name}.conf
%{_unitdir}/%{name}.service
@@ -214,6 +215,12 @@ fi
%changelog
+* Fri Sep 12 2014 Remi Collet <remi@fedoraproject.org> - 2.8.15-1
+- Redis 2.8.15 - Release date: 12 Sep 2014
+ upgrade urgency: LOW for Redis, HIGH for Sentinel.
+- move commands from /usr/sbin to /usr/bin
+- add redis-shutdown command (systemd)
+
* Thu Sep 4 2014 Remi Collet <remi@fedoraproject.org> - 2.8.14-1
- Redis 2.8.14 - Release date: 1 Sep 2014
upgrade urgency: HIGH for Lua scripting users, otherwise LOW.
diff --git a/sentinel.service b/sentinel.service
deleted file mode 100644
index 487f283..0000000
--- a/sentinel.service
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=Redis sentinel
-After=syslog.target network.target
-
-[Service]
-ExecStart=/usr/sbin/redis-sentinel /etc/redis-sentinel.conf --daemonize no
-User=redis
-Group=redis
-
-[Install]
-WantedBy=multi-user.target
-