From cd0e291d13db4fe21a0c6ec0f262f439a6d8fb23 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Jan 09 2024 09:12:34 +0000 Subject: Add missing %postun scriptlets for systemd-{resolved,networkd} ... (rhbz#2255718) I'm not sure what happened here. But I think both services should be fine with a restart and there is no reason not to do this. --- diff --git a/systemd.spec b/systemd.spec index ec214ca..0359026 100644 --- a/systemd.spec +++ b/systemd.spec @@ -1032,6 +1032,24 @@ fi %preun networkd %systemd_preun systemd-networkd.service systemd-networkd-wait-online.service +%postun networkd +%systemd_postun_with_restart systemd-networkd.service +%systemd_postun systemd-networkd-wait-online.service + +%post resolved +[ $1 -eq 1 ] || exit 0 +# Initial installation + +touch %{_localstatedir}/lib/rpm-state/systemd-resolved.initial-installation + +# Related to https://bugzilla.redhat.com/show_bug.cgi?id=1943263 +if ls /usr/lib/systemd/libsystemd-shared-24[0-8].so &>/dev/null; then + echo "Skipping presets for systemd-resolved.service, seems we are upgrading from old systemd." + exit 0 +fi + +%systemd_post systemd-resolved.service + %preun resolved if [ $1 -eq 0 ] ; then systemctl disable --quiet \ @@ -1047,19 +1065,8 @@ if [ $1 -eq 0 ] ; then fi fi -%post resolved -[ $1 -eq 1 ] || exit 0 -# Initial installation - -touch %{_localstatedir}/lib/rpm-state/systemd-resolved.initial-installation - -# Related to https://bugzilla.redhat.com/show_bug.cgi?id=1943263 -if ls /usr/lib/systemd/libsystemd-shared-24[0-8].so &>/dev/null; then - echo "Skipping presets for systemd-resolved.service, seems we are upgrading from old systemd." - exit 0 -fi - -%systemd_post systemd-resolved.service +%postun resolved +%systemd_postun_with_restart systemd-resolved.service %posttrans resolved [ -e %{_localstatedir}/lib/rpm-state/systemd-resolved.initial-installation ] || exit 0