From dc361d6b754f80872b38fc70caa13683ab465675 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Mon, 28 Aug 2017 16:06:15 +1000 Subject: [PATCH] Switch to systemd service Type=notify for Redis Enable the systemd supervision support in redis configuration files and update the service type in the systemd service file to enable its use. This resolves RHBZ #1172841. --- redis-sentinel.service | 1 + redis.service | 1 + redis.spec | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/redis-sentinel.service b/redis-sentinel.service index 0c87ff7..850cd81 100644 --- a/redis-sentinel.service +++ b/redis-sentinel.service @@ -5,6 +5,7 @@ After=network.target [Service] ExecStart=/usr/bin/redis-sentinel /etc/redis-sentinel.conf --daemonize no ExecStop=/usr/libexec/redis-shutdown redis-sentinel +Type=notify User=redis Group=redis RuntimeDirectory=redis diff --git a/redis.service b/redis.service index 6c19f81..dffde40 100644 --- a/redis.service +++ b/redis.service @@ -5,6 +5,7 @@ After=network.target [Service] ExecStart=/usr/bin/redis-server /etc/redis.conf --daemonize no ExecStop=/usr/libexec/redis-shutdown +Type=notify User=redis Group=redis RuntimeDirectory=redis diff --git a/redis.spec b/redis.spec index ad6d620..a18a635 100644 --- a/redis.spec +++ b/redis.spec @@ -136,6 +136,11 @@ sed -i -e 's|OPTIMIZATION?=-O3|OPTIMIZATION=%{optflags}|g' deps/hiredis/Makefile sed -i -e 's|$(LDFLAGS)|%{?__global_ldflags}|g' deps/hiredis/Makefile sed -i -e 's|$(CFLAGS)|%{optflags}|g' deps/linenoise/Makefile sed -i -e 's|$(LDFLAGS)|%{?__global_ldflags}|g' deps/linenoise/Makefile +# Configuration file changes and additions +%if 0%{?with_systemd} +sed -i -e 's|^supervised .*$|supervised systemd|g' redis.conf +sed -i -e '$ asupervised systemd|g' sentinel.conf +%endif %build make %{?_smp_mflags} \