Run %triggerun regardless of systemd_post variable definition

This commit is contained in:
Honza Horák 2012-10-04 13:57:09 +02:00
parent 0b05ecc6a2
commit 81e93d1073
1 changed files with 13 additions and 30 deletions

View File

@ -1,7 +1,7 @@
Summary: Client for sending messages to a host's logged in users
Name: rwall
Version: 0.17
Release: 36%{?dist}
Release: 37%{?dist}
License: BSD
Url: ftp://ftp.linux.org.uk/pub/linux/Networking/netkit/
Group: System Environment/Daemons
@ -83,41 +83,21 @@ make INSTALLROOT=${RPM_BUILD_ROOT} install
install -m 755 %{SOURCE1} ${RPM_BUILD_ROOT}%{_unitdir}/
%post server
%if 0%{?systemd_post:1}
%systemd_post rwalld.service
%else
if [ $1 = 1 ]; then
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
%systemd_post rwalld.service
# Package with native systemd unit file is installed for the first time
%triggerun -- rwall-server < 0.17-33
%{_bindir}/systemd-sysv-convert --save rwalld >/dev/null 2>&1 ||:
# Package with native systemd unit file is installed for the first time
%triggerun -- rwall-server < 0.17-33
%{_bindir}/systemd-sysv-convert --save rwalld >/dev/null 2>&1 ||:
# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del rwalld >/dev/null 2>&1 || :
/bin/systemctl try-restart rwalld.service >/dev/null 2>&1 || :
%endif
# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del rwalld >/dev/null 2>&1 || :
/bin/systemctl try-restart rwalld.service >/dev/null 2>&1 || :
%preun server
%if 0%{?systemd_preun:1}
%systemd_preun rwalld.service
%else
if [ $1 = 0 ]; then
/bin/systemctl --no-reload disable rwalld.service >/dev/null 2>&1 || :
/bin/systemctl stop rwalld.service >/dev/null 2>&1 || :
fi
%endif
%systemd_preun rwalld.service
%postun server
%if 0%{?systemd_postun_with_restart:1}
%systemd_postun_with_restart rwalld.service
%else
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ]; then
/bin/systemctl try-restart rwalld.service >/dev/null 2>&1 || :
fi
%endif
%systemd_postun_with_restart rwalld.service
%files
%{_bindir}/rwall
@ -130,6 +110,9 @@ install -m 755 %{SOURCE1} ${RPM_BUILD_ROOT}%{_unitdir}/
%{_unitdir}/*
%changelog
* Thu Oct 04 2012 Honza Horak <hhorak@redhat.com> - 0.17-37
- Run %%triggerun regardless of systemd_post variable definition
* Tue Sep 11 2012 Honza Horak <hhorak@redhat.com> - 0.17-36
- added ordering dependencies to rpcbind
- Minor spec file changes