From 9746a1fc378a9a10029105aeeb61e71afd2f49e7 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Tue, 24 Sep 2024 12:32:30 +0100 Subject: [PATCH] CA-399643 Use full paths when stopping fairlock on upgrade Amend the fairlock upgrade scriptlet so that it uses full paths. This prevents it failing unexpectedly. Also, change it from a %posttrans scriptlet to a %post scriptlet so that the new version will have an effect immediately any new version is available. Signed-off-by: Tim Smith --- mk/sm.spec.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mk/sm.spec.in b/mk/sm.spec.in index 3203ee11..ac33116a 100755 --- a/mk/sm.spec.in +++ b/mk/sm.spec.in @@ -237,13 +237,16 @@ Manager and some other packages %{_unitdir}/fairlock@.service %{_libexecdir}/fairlock -%posttrans fairlock +%post fairlock ## On upgrade, shut down existing lock services so new ones will ## be started. There should be no locks held during upgrade operations ## so this is safe. if [ $1 -gt 1 ]; then - systemctl stop $(systemctl list-units fairlock@* --all --no-legend | cut -d' ' -f1) + /usr/bin/systemctl list-units fairlock@* --all --no-legend | /usr/bin/cut -d' ' -f1 | while read service; + do + /usr/bin/systemctl stop "$service" + done fi %changelog