Modernize systemd scriptlets

This commit is contained in:
Petr Písař 2012-08-22 17:56:38 +02:00
parent a786322170
commit 0486870ef7

View File

@ -1,7 +1,7 @@
Summary: A Router Advertisement daemon
Name: radvd
Version: 1.9.1
Release: 3%{?dist}
Release: 4%{?dist}
# The code includes the advertising clause, so it's GPL-incompatible
License: BSD with advertising
Group: System Environment/Daemons
@ -64,22 +64,13 @@ install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/radvd.conf
install -m 644 %{SOURCE2} ${RPM_BUILD_ROOT}%{_unitdir}
%postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ "$1" -ge 1 ]; then
/bin/systemctl try-restart radvd.service >/dev/null 2>&1 || :
fi
%systemd_postun_with_restart radvd.service
%post
if [ "$1" -eq 1 ]; then
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
%systemd_post radvd.service
%preun
if [ "$1" -eq 0 ]; then
/bin/systemctl --no-reload disable radvd.service > /dev/null 2>&1 || :
/bin/systemctl stop radvd.service > /dev/null 2>&1 || :
fi
%systemd_preun radvd.service
%pre
getent group radvd >/dev/null || groupadd -r radvd
@ -100,6 +91,9 @@ exit 0
%{_sbindir}/radvdump
%changelog
* Wed Aug 22 2012 Petr Pisar <ppisar@redhat.com> - 1.9.1-4
- Modernize systemd scriptlets (bug #850292)
* Tue Aug 07 2012 Petr Pisar <ppisar@redhat.com> - 1.9.1-3
- Remove useless chkconfig invocation (bug #845562)
- Do not reload unit file while unistalling