From c6f7df8b6c1b764cb6e32240b866a00b11156649 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Apr 27 2024 18:52:59 +0000 Subject: Add additional daemon-reexec for upgrades from old systemd versions https://github.com/systemd/systemd/issues/32508#issuecomment-2079991745 > The new systemd package does the reexec in %postun, but the old one does it in > %post. So if we install the new one, we don't do any reexec (since %postun > doesn't run in this case), but once we remove the old one we also don't do any > reexec, because in this case there's no reexec in %postun: > # dnf upgrade --rpmverbosity=debug ./*.rpm |& tee log.txt > ... > : %postun(systemd-255.5-1.fc41.x86_64): scriptlet start > D: %postun(systemd-255.5-1.fc41.x86_64): execv(/bin/sh) pid 2649 > D: Plugin: calling hook scriptlet_fork_post in selinux plugin > D: setexecfilecon: (/bin/sh, rpm_script_t) > + '[' 1 -eq 1 ']' > + '[' -w /var ']' > + journalctl --update-catalog > + systemd-tmpfiles --create --- diff --git a/systemd.spec b/systemd.spec index 0ca444f..c0ef7e4 100644 --- a/systemd.spec +++ b/systemd.spec @@ -951,6 +951,10 @@ if [ $1 -ge 1 ] && [ -x "/usr/lib/systemd/systemd-update-helper" ]; then /usr/lib/systemd/systemd-update-helper user-reexec || : fi +%triggerun -- systemd < 256 +# This is for upgrades from previous versions before systemd restart was moved to %%postun +systemctl daemon-reexec || : + %triggerpostun -- systemd < 253~rc1-2 # This is for upgrades from previous versions where systemd-journald-audit.socket # had a static enablement symlink.