[rusers] Run %triggerun regardless of systemd_post variable definition
Honza Horak
hhorak at fedoraproject.org
Thu Oct 4 11:21:40 UTC 2012
commit ad121cbf3457a0ab3a20c54504b15df8b6abc360
Author: Honza HorĂ¡k <hhorak at redhat.com>
Date: Thu Oct 4 13:21:24 2012 +0200
Run %triggerun regardless of systemd_post variable definition
rusers.spec | 62 ++++++++++++++++++++---------------------------------------
1 files changed, 21 insertions(+), 41 deletions(-)
---
diff --git a/rusers.spec b/rusers.spec
index 546ce88..d932929 100644
--- a/rusers.spec
+++ b/rusers.spec
@@ -5,7 +5,7 @@
Summary: Displays the users logged into machines on the local network
Name: rusers
Version: 0.17
-Release: 70%{?dist}
+Release: 71%{?dist}
License: BSD
Url: http://rstatd.sourceforge.net/
Group: System Environment/Daemons
@@ -128,50 +128,27 @@ install %SOURCE1 ${RPM_BUILD_ROOT}%{_unitdir}/rusersd.service
install %SOURCE3 ${RPM_BUILD_ROOT}%{_unitdir}/rstatd.service
%post server
-%if 0%{?systemd_post:1}
- %systemd_post rstatd.service
- %systemd_post rusersd.service
-%else
- if [ $1 -eq 1 ] ; then
- # Initial installation
- /bin/systemctl daemon-reload >/dev/null 2>&1 || :
- fi
-
- %triggerun -- rusers-server < 0.17-64
- /bin/systemctl daemon-reload >/dev/null 2>&1 || :
- # Save the current service runlevel info
- # User must manually run systemd-sysv-convert --apply httpd
- # to migrate them to systemd targets
- /usr/bin/systemd-sysv-convert --save rstatd rusersd >/dev/null 2>&1 ||:
-
- # Run these because the SysV package being removed won't do them
- /sbin/chkconfig --del rstatd rusersd >/dev/null 2>&1 || :
- /bin/systemctl try-restart rstatd.service rusersd.service >/dev/null 2>&1 || :
-%endif
+%systemd_post rstatd.service
+%systemd_post rusersd.service
+
+%triggerun -- rusers-server < 0.17-64
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+# Save the current service runlevel info
+# User must manually run systemd-sysv-convert --apply httpd
+# to migrate them to systemd targets
+/usr/bin/systemd-sysv-convert --save rstatd rusersd >/dev/null 2>&1 ||:
+
+# Run these because the SysV package being removed won't do them
+/sbin/chkconfig --del rstatd rusersd >/dev/null 2>&1 || :
+/bin/systemctl try-restart rstatd.service rusersd.service >/dev/null 2>&1 || :
%preun server
-%if 0%{?systemd_preun:1}
- %systemd_preun rstatd.service
- %systemd_preun rusersd.service
-%else
- if [ $1 = 0 ]; then
- # Package removal, not upgrade
- /bin/systemctl --no-reload disable rstatd.service rusersd.service > /dev/null 2>&1 || :
- /bin/systemctl stop rstatd.service rusersd.service > /dev/null 2>&1 || :
- fi
-%endif
+%systemd_preun rstatd.service
+%systemd_preun rusersd.service
%postun server
-%if 0%{?systemd_postun_with_restart:1}
- %systemd_postun_with_restart rstatd.service
- %systemd_postun_with_restart rusersd.service
-%else
- /bin/systemctl daemon-reload >/dev/null 2>&1 || :
- if [ $1 -ge 1 ] ; then
- # Package upgrade, not uninstall
- /bin/systemctl try-restart rstatd.service rusersd.service >/dev/null 2>&1 || :
- fi
-%endif
+%systemd_postun_with_restart rstatd.service
+%systemd_postun_with_restart rusersd.service
%files
%doc README
@@ -187,6 +164,9 @@ install %SOURCE3 ${RPM_BUILD_ROOT}%{_unitdir}/rstatd.service
%{_unitdir}/rstatd.service
%changelog
+* Thu Oct 04 2012 Honza Horak <hhorak at redhat.com> - 0.17-71
+- Run %%triggerun regardless of systemd_post variable definition
+
* Tue Sep 11 2012 Honza Horak <hhorak at redhat.com> - 0.17-70
- Minor spec file changes
- Use new systemd macros (Resolves: #850302)
More information about the scm-commits
mailing list