diff --git a/macros.systemd b/macros.systemd index 6886189..bc90ff6 100644 --- a/macros.systemd +++ b/macros.systemd @@ -71,13 +71,10 @@ OrderWithRequires(postun): systemd \ %service_add_pre() \ if [ $1 -gt 1 -a -x /usr/bin/systemctl ]; then \ for service in %{?*} ; do \ - # The tag file might have been left by a preceding \ - # update (see bsc#1059627) \ - rm -f "/run/rpm-%{name}-update-$service-new-in-upgrade" \ - \ if [ ! -e "/usr/lib/systemd/system/$service" ] && \ [ ! -e "/etc/init.d/${service%.*}" ]; then \ - touch "/run/rpm-%{name}-update-$service-new-in-upgrade" \ + mkdir -p /run/systemd/rpm/needs-preset \ + touch "/run/systemd/rpm/needs-preset/$service" \ fi \ done \ fi \ @@ -94,11 +91,12 @@ if [ -x /usr/bin/systemctl ]; then \ /usr/bin/systemctl preset %{?*} || : \ else \ for service in %{?*} ; do \ - if [ -e "/run/rpm-%{name}-update-$service-new-in-upgrade" ]; then \ - rm -f "/run/rpm-%{name}-update-$service-new-in-upgrade" \ + if [ -e "/run/systemd/rpm/needs-preset/$service" ]; then \ /usr/bin/systemctl preset "$service" || : \ fi \ done \ + rm -fr /run/systemd/rpm/needs-preset \ + \ /usr/lib/systemd/systemd-sysv-convert --apply %{?*} || : \ fi \ fi \ @@ -180,7 +178,7 @@ fi \ %systemd_user_preun() \ if [ $1 -eq 0 -a -x /usr/bin/systemctl ]; then \ # Package removal, not upgrade \ - /usr/bin/systemctl --global disable %{?*} || : \ + /usr/bin/systemctl --global disable %{?*} || : \ fi \ %{nil} diff --git a/systemd-rpm-macros.changes b/systemd-rpm-macros.changes index 9039c7f..e27a98f 100644 --- a/systemd-rpm-macros.changes +++ b/systemd-rpm-macros.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Nov 20 06:34:57 UTC 2020 - Franck Bui + +- Rename the tag file used to detect when presets need to be applied + + Rather than placing these tags directly under /run, let's place them + under /run/systemd/rpm. This also has the benefit to make the + workaround for bsc#1059627 no more needed. + ------------------------------------------------------------------- Thu Nov 19 15:53:43 UTC 2020 - Franck Bui