[rwho] Run %triggerun regardless of systemd_post variable definition

Honza Horak hhorak at fedoraproject.org
Thu Oct 4 12:13:11 UTC 2012


commit 61b5e2f7e7c0a0356e45c58a973690cb2e076d02
Author: Honza HorĂ¡k <hhorak at redhat.com>
Date:   Thu Oct 4 14:12:52 2012 +0200

    Run %triggerun regardless of systemd_post variable definition

 rwho.spec |   43 +++++++++++++------------------------------
 1 files changed, 13 insertions(+), 30 deletions(-)
---
diff --git a/rwho.spec b/rwho.spec
index 2d63a06..b2ea5f3 100644
--- a/rwho.spec
+++ b/rwho.spec
@@ -1,7 +1,7 @@
 Summary: Displays who is logged in to local network machines
 Name: rwho
 Version: 0.17
-Release: 42%{?dist}
+Release: 43%{?dist}
 # part of rwhod is under GPL+, other parts are under BSD
 License: BSD and GPL+
 Group: System Environment/Daemons
@@ -84,41 +84,21 @@ make INSTALLROOT=${RPM_BUILD_ROOT} install -C ruptime
 install -m 644 %SOURCE1 ${RPM_BUILD_ROOT}%{_unitdir}/rwhod.service
 
 %post
-%if 0%{?systemd_post:1}
-  %systemd_post rwhod.service
-%else
-  if [ $1 = 1 ]; then
-      /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-  fi
+%systemd_post rwhod.service
 
-  # Package with native systemd unit file is installed for the first time
-  %triggerun -- rwho < 0.17-36
-  %{_bindir}/systemd-sysv-convert --save rwhod >/dev/null 2>&1 ||:
+# Package with native systemd unit file is installed for the first time
+%triggerun -- rwho < 0.17-36
+%{_bindir}/systemd-sysv-convert --save rwhod >/dev/null 2>&1 ||:
 
-  # Run these because the SysV package being removed won't do them
-  /sbin/chkconfig --del rwhod >/dev/null 2>&1 || :
-  /bin/systemctl try-restart rwhod.service >/dev/null 2>&1 || :
-%endif
+# Run these because the SysV package being removed won't do them
+/sbin/chkconfig --del rwhod >/dev/null 2>&1 || :
+/bin/systemctl try-restart rwhod.service >/dev/null 2>&1 || :
 
 %preun
-%if 0%{?systemd_preun:1}
-  %systemd_preun rwhod.service
-%else
-  if [ $1 = 0 ]; then
-      /bin/systemctl --no-reload disable rwhod.service >/dev/null 2>&1 || :
-      /bin/systemctl stop rwhod.service >/dev/null 2>&1 || :
-  fi
-%endif
+%systemd_preun rwhod.service
 
 %postun
-%if 0%{?systemd_postun_with_restart:1}
-  %systemd_postun_with_restart rwhod.service
-%else
-  /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-  if [ $1 -ge 1 ]; then
-      /bin/systemctl try-restart rwhod.service >/dev/null 2>&1 || :
-  fi
-%endif
+%systemd_postun_with_restart rwhod.service
 
 %files
 %doc README
@@ -132,6 +112,9 @@ install -m 644 %SOURCE1 ${RPM_BUILD_ROOT}%{_unitdir}/rwhod.service
 %{_unitdir}/*
 
 %changelog
+* Thu Oct 04 2012 Honza Horak <hhorak at redhat.com> - 0.17-43
+- Run %%triggerun regardless of systemd_post variable definition
+
 * Tue Sep 11 2012 Honza Horak <hhorak at redhat.com> - 0.17-42
 - GPL+ added since part of rwhod is licensed under that license
 


More information about the scm-commits mailing list