From c2cfed6d0237b633d2057e2227eb6a606a8893f6 Mon Sep 17 00:00:00 2001 From: compile_success <980965867@qq.com> Date: Wed, 15 Jan 2020 15:57:46 +0800 Subject: [PATCH] modify service --- redis-sentinel.service | 1 - redis.service | 1 - redis.spec | 21 ++++++++++++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/redis-sentinel.service b/redis-sentinel.service index 2c13233..5e8ae1c 100644 --- a/redis-sentinel.service +++ b/redis-sentinel.service @@ -4,7 +4,6 @@ After=network.target [Service] ExecStart=/usr/bin/redis-sentinel /etc/redis-sentinel.conf --supervised systemd -ExecStop=/usr/libexec/redis-shutdown redis-sentinel Type=notify User=redis Group=redis diff --git a/redis.service b/redis.service index 88e9edc..e4eff49 100644 --- a/redis.service +++ b/redis.service @@ -4,7 +4,6 @@ After=network.target [Service] ExecStart=/usr/bin/redis-server /etc/redis.conf --supervised systemd -ExecStop=/usr/libexec/redis-shutdown Type=notify User=redis Group=redis diff --git a/redis.spec b/redis.spec index 1910617..c9e28fc 100644 --- a/redis.spec +++ b/redis.spec @@ -1,6 +1,6 @@ Name: redis Version: 4.0.11 -Release: 2 +Release: 3 Summary: A persistent key-value database License: BSD and MIT URL: https://redis.io @@ -15,6 +15,9 @@ Redis is an advanced key-value store. It is often referred to as a dattructure s %prep %autosetup -p1 +sed -i -e 's|^logfile .*$|logfile /var/log/redis/redis.log|g' redis.conf +sed -i -e '$ alogfile /var/log/redis/sentinel.log' sentinel.conf +sed -i -e 's|^dir .*$|dir /var/lib/redis|g' redis.conf %build make @@ -28,6 +31,19 @@ install -pm644 %{SOURCE3} %{buildroot}%{_unitdir} install -pDm640 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}.conf install -pDm640 sentinel.conf %{buildroot}%{_sysconfdir}/%{name}-sentinel.conf +%post +%systemd_post %{name}.service +%systemd_post %{name}-sentinel.service + +%preun +%systemd_preun %{name}.service +%systemd_preun %{name}-sentinel.service + +%postun +%systemd_postun_with_restart %{name}.service +%systemd_postun_with_restart %{name}-sentinel.service + + %files %license COPYING %doc BUGS README.md 00-RELEASENOTES MANIFESTO CONTRIBUTING @@ -39,6 +55,9 @@ install -pDm640 sentinel.conf %{buildroot}%{_sysconfdir}/%{name}-sentinel.conf %{_unitdir}/%{name}-sentinel.service %changelog +* Wed Jan 15 2020 zhujunhao - 4.0.11-3 +- Modify redis service + * Wed Jan 08 2020 lijin Yang - 4.0.11-2 - Package init -- Gitee