Skip to content

Commit

Permalink
CA-399643 Use full paths when stopping fairlock on upgrade
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Tim Smith authored and MarkSymsCtx committed Sep 26, 2024
1 parent 130615c commit 24de268
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mk/sm.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,16 @@ Manager and some other packages
%{_unitdir}/[email protected]
%{_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
Expand Down

0 comments on commit 24de268

Please sign in to comment.