Skip to content

Commit d49dda8

Browse files
Restart service async'y when we're the uninstalled pkg in an upgrade
We have a problem in updating old update-motd packages to a new package. Some installation scripts run systemctl-try-reload, which runs update-motd, which runs a system-release hook that asks yum to do something that requires a lock. That is bad because a first yum is causing that sequence and it already owns that lock. Classic deadlock. We can't just make the new package smarter. Rpm rules are not well-designed and the last thing to run is the post-un script of the old evicted package, and if the old package script is determined to do something bad, the new package can not prevent it. That is the case here. The already-vended systemrelease and updatemotd are already going to get in a deadlock. Because we're distributing, in this package, the software that makes up the middle step in the upcoming deadlock, we can make it refuse to wait it out. Closes: SIM#KAROO-1257
1 parent 5b68674 commit d49dda8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

SPECS/update-motd.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ fi
5858
%systemd_preun update-motd.service sshd.socket
5959

6060
%postun
61-
%systemd_postun_with_restart update-motd.service
61+
systemctl daemon-reload >/dev/null 2>&1 || :
62+
if [ $1 -ge 1 ] ; then
63+
# 1 = Package upgrade, not uninstall
64+
systemctl try-restart update-motd.service sshd.socket --no-block >/dev/null 2>&1 || :
65+
fi
6266

6367

6468
%files

0 commit comments

Comments
 (0)