Simplify systemd scriplets

It is better to use a single %systemd_* macro to avoid some executions
and repeated checks.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2024-02-06 10:42:42 +01:00
parent bac574c283
commit 1d0d7588dd

View File

@ -454,16 +454,14 @@ exit 0
%systemd_post uuidd.service %systemd_post uuidd.service
if [ $1 -eq 1 ] && [ -x /usr/bin/systemctl ]; then if [ $1 -eq 1 ] && [ -x /usr/bin/systemctl ]; then
# install # install
/bin/systemctl start uuidd.service > /dev/null 2>&1 || : /usr/bin/systemctl start uuidd.service > /dev/null 2>&1 || :
fi fi
%preun -n uuidd %preun -n uuidd
%systemd_preun uuidd.socket %systemd_preun uuidd.socket uuidd.service
%systemd_preun uuidd.service
%postun -n uuidd %postun -n uuidd
%systemd_postun_with_restart uuidd.socket %systemd_postun_with_restart uuidd.socket uuidd.service
%systemd_postun_with_restart uuidd.service
%triggerpostun -- util-linux < 2.35.1-7 %triggerpostun -- util-linux < 2.35.1-7
if [ $1 -gt 1 ] && [ -x /usr/bin/systemctl ] ; then if [ $1 -gt 1 ] && [ -x /usr/bin/systemctl ] ; then