diff --git a/macros.systemd b/macros.systemd index 407e966..ebe7201 100644 --- a/macros.systemd +++ b/macros.systemd @@ -58,10 +58,14 @@ OrderWithRequires(postun): systemd \ %_restart_on_update_never() : # Restart of %{*} skipped %{nil} %_restart_on_update() \ - test -z "$DISABLE_RESTART_ON_UPDATE" -a -f /etc/sysconfig/services &&\\\ + if [ -e /etc/sysconfig/services]; then \ + DISABLE_RESTART_ON_UPDATE= \ . /etc/sysconfig/services \ - test "$DISABLE_RESTART_ON_UPDATE" != yes -a "$DISABLE_RESTART_ON_UPDATE" != 1 &&\\\ - /usr/bin/systemctl try-restart %{*} || : \ + case "$DISABLE_RESTART_ON_UPDATE" in \ + yes|1) ;; \ + *) /usr/bin/systemctl try-restart %{*} || : \ + esac \ + fi \ %{nil} %service_add_pre() \ @@ -164,10 +168,9 @@ fi \ # # Options used if not in an installation systems # -f : force service restart on update -# -n : do not touch active service (deprecated) +# -n : do not touch active service (deprecated, replaced by %service_del_postun_without_restart) # -# the default is to check for DISABLE_RESTART_ON_UPDATE environment -# variable if not found use the value read from /etc/sysconfig/services +# The default is to read DISABLE_RESTART_ON_UPDATE from /etc/sysconfig/services # %service_del_postun(fn) \ %service_del_postun_without_restart %{?*} \ diff --git a/systemd-rpm-macros.changes b/systemd-rpm-macros.changes index 54401ac..6005279 100644 --- a/systemd-rpm-macros.changes +++ b/systemd-rpm-macros.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Nov 2 14:36:43 UTC 2020 - Franck Bui + +- DISABLE_RESTART_ON_UDPATE is no more read from the (build) environment + + %service_del_postun_without_restart is the interface that should be + used by packages that need to prevent theirs services from being + restarted. + ------------------------------------------------------------------- Fri Oct 30 17:37:54 UTC 2020 - Franck Bui