diff --git a/iptables.spec b/iptables.spec index 387ca27..8a44156 100644 --- a/iptables.spec +++ b/iptables.spec @@ -148,25 +148,14 @@ rm -rf %{buildroot} %postun -p /sbin/ldconfig %post services -if [ $1 -eq 1 ] ; then # Initial installation - /bin/systemctl daemon-reload >/dev/null 2>&1 || : -fi +%systemd_post iptables.service ip6tables.service %preun services -if [ $1 -eq 0 ]; then # Package removal, not upgrade - /bin/systemctl --no-reload disable iptables.service > /dev/null 2>&1 || : - /bin/systemctl --no-reload disable ip6tables.service > /dev/null 2>&1 || : - /bin/systemctl stop iptables.service > /dev/null 2>&1 || : - /bin/systemctl stop ip6tables.service > /dev/null 2>&1 || : -fi +%systemd_preun iptables.service ip6tables.service %postun services /sbin/ldconfig -/bin/systemctl daemon-reload >/dev/null 2>&1 || : -if [ $1 -ge 1 ] ; then # Package upgrade, not uninstall - /bin/systemctl try-restart iptables.service >/dev/null 2>&1 || : - /bin/systemctl try-restart ip6tables.service >/dev/null 2>&1 || : -fi +%systemd_postun_with_restart iptables.service ip6tables.service %triggerun -- iptables < 1.4.11.1-3 # To apply saved runlevel, use systemd-sysv-convert --apply iptables @@ -240,6 +229,7 @@ fi %changelog * Thu Jan 09 2014 Jiri Popelka - 1.4.21-3 - no need to support the pre-systemd things +- use systemd macros (#850166) * Thu Jan 9 2014 Thomas Woerner 1.4.21-2 - fixed system hang at shutdown if root device is network based (RHBZ#1007934)