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.
This commit is contained in:
Nathan Scott 2017-08-28 16:06:15 +10:00
parent 5085a9081d
commit dc361d6b75
3 changed files with 7 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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} \