diff options
author | Remi Collet <remi@remirepo.net> | 2023-03-28 08:45:55 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2023-03-28 08:45:55 +0200 |
commit | 098aac9ad4745844418ef5838e423ef63975086c (patch) | |
tree | 896e08c2bffe551b6eac357f3842f6cdccebcdb5 | |
parent | 4fe2e7f9d64d39c5f9b98a91d86ac370f9ba9884 (diff) |
drop redis-shutdown helper and rely on systemd #2181181
-rw-r--r-- | redis-sentinel.service | 1 | ||||
-rw-r--r-- | redis-shutdown | 40 | ||||
-rw-r--r-- | redis.service | 1 | ||||
-rw-r--r-- | redis.spec | 12 |
4 files changed, 4 insertions, 50 deletions
diff --git a/redis-sentinel.service b/redis-sentinel.service index a055cf5..0bcc990 100644 --- a/redis-sentinel.service +++ b/redis-sentinel.service @@ -6,7 +6,6 @@ Wants=network-online.target [Service] ExecStart=/usr/bin/redis-sentinel /etc/redis/sentinel.conf --daemonize no --supervised systemd -ExecStop=/usr/libexec/redis-shutdown sentinel Type=notify User=redis Group=redis diff --git a/redis-shutdown b/redis-shutdown deleted file mode 100644 index 1a4335a..0000000 --- a/redis-shutdown +++ /dev/null @@ -1,40 +0,0 @@ -#!/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="$1" -if [ -z "$SERVICE_NAME" ]; then - SERVICE_NAME=redis -fi - -# Get the proper config file based on service name -CONFIG_FILE="/etc/redis/$SERVICE_NAME.conf" - -# Use awk to retrieve host, port from config file -HOST=`awk '/^[[:blank:]]*bind/ { print $2 }' $CONFIG_FILE | tail -n1` -PORT=`awk '/^[[:blank:]]*port/ { print $2 }' $CONFIG_FILE | tail -n1` -PASS=`awk '/^[[:blank:]]*requirepass/ { print $2 }' $CONFIG_FILE | tail -n1` -SOCK=`awk '/^[[:blank:]]*unixsocket\s/ { print $2 }' $CONFIG_FILE | tail -n1` - -# Just in case, use default host, port -HOST=${HOST:-127.0.0.1} -if [ "$SERVICE_NAME" = redis ]; then - PORT=${PORT:-6379} -else - PORT=${PORT:-26739} -fi - -# Setup additional parameters -# e.g password-protected redis instances -[ -z "$PASS" ] || ADDITIONAL_PARAMS="-a $PASS" - -# shutdown the service properly -if [ -e "$SOCK" ] ; then - $REDIS_CLI -s $SOCK $ADDITIONAL_PARAMS shutdown -else - $REDIS_CLI -h $HOST -p $PORT $ADDITIONAL_PARAMS shutdown -fi diff --git a/redis.service b/redis.service index 4e59720..a577c83 100644 --- a/redis.service +++ b/redis.service @@ -6,7 +6,6 @@ Wants=network-online.target [Service] ExecStart=/usr/bin/redis-server /etc/redis/redis.conf --daemonize no --supervised systemd -ExecStop=/usr/libexec/redis-shutdown Type=notify User=redis Group=redis @@ -40,7 +40,7 @@ Name: redis Version: %{upstream_ver}%{?upstream_pre:~%{upstream_pre}} -Release: 1%{?dist} +Release: 2%{?dist} Summary: A persistent key-value database Group: Applications/Databases # redis, hiredis: BSD-3-Clause @@ -53,7 +53,6 @@ Source0: https://download.redis.io/releases/%{name}-%{upstream_ver}%{? Source1: %{name}.logrotate Source2: %{name}-sentinel.service Source3: %{name}.service -Source6: %{name}-shutdown Source7: %{name}-limit-systemd Source9: macros.%{name} Source10: https://github.com/%{gh_owner}/%{gh_project}-doc/archive/%{doc_commit}/%{name}-doc-%{short_doc_commit}.tar.gz @@ -91,8 +90,6 @@ BuildRequires: openssl-devel >= 1.0.2 Obsoletes: redis-trib < %{version}-%{release} %endif -# Required for redis-shutdown -Requires: /bin/awk Requires: logrotate Requires(pre): shadow-utils Requires(post): systemd @@ -254,9 +251,6 @@ install -p -D -m 644 %{S:7} %{buildroot}%{_sysconfdir}/systemd/system/%{name}-se # Fix non-standard-executable-perm error. chmod 755 %{buildroot}%{_bindir}/%{name}-* -# Install redis-shutdown -install -pDm755 %{S:6} %{buildroot}%{_libexecdir}/%{name}-shutdown - # Install redis module header install -pDm644 src/%{name}module.h %{buildroot}%{_includedir}/%{name}module.h @@ -379,7 +373,6 @@ fi %exclude %{_includedir} %exclude %{_docdir}/%{name}/* %{_bindir}/%{name}-* -%{_libexecdir}/%{name}-* %{_mandir}/man1/%{name}* %{_mandir}/man5/%{name}* %{_unitdir}/%{name}.service @@ -408,6 +401,9 @@ fi %changelog +* Tue Mar 28 2023 Remi Collet <remi@remirepo.net> - 7.2~rc1-2 +- drop redis-shutdown helper and rely on systemd #2181181 + * Thu Mar 23 2023 Remi Collet <remi@remirepo.net> - 7.2~rc1-1 - rebuild with upstream sources instead of git snapshot - refresh documentation |