3
0

- %service_del_postun: make sure to restart services if /etc/sysconfig/service

is not present.

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=85
This commit is contained in:
Franck Bui 2023-03-29 11:35:52 +00:00 committed by Git OBS Bridge
parent 3d2aa53763
commit 3b2c7f4694
2 changed files with 15 additions and 7 deletions

View File

@ -134,17 +134,19 @@ if [ -x /usr/bin/systemctl ]; then \
fi \
%{nil}
# On uninstall, tell systemd to reload its unit files
#
# The default is to read DISABLE_RESTART_ON_UPDATE from /etc/sysconfig/services
# On uninstall, tell systemd to reload its unit files.
# On update, tell systemd to reload and restart service unless
# DISABLE_RESTART_ON_UPDATE from /etc/sysconfig/services says otherwise
#
%service_del_postun() \
if [ -x /usr/bin/systemctl ]; then \
/usr/bin/systemctl daemon-reload || : \
if [ $1 -ge 1 ] && [ -e /etc/sysconfig/services ]; then \
if [ $1 -ge 1 ]; then \
# Package upgrade, not uninstall \
DISABLE_RESTART_ON_UPDATE= \
. /etc/sysconfig/services \
DISABLE_RESTART_ON_UPDATE=no \
[ -e /etc/sysconfig/services ] && . /etc/sysconfig/services || : \
\
case "$DISABLE_RESTART_ON_UPDATE" in \
yes|1) ;; \
*) /usr/bin/systemctl try-restart %{*} || : \
@ -161,7 +163,7 @@ fi \
%systemd_post() %{expand::%%service_add_post %{?**}}
%systemd_preun() %{expand::%%service_del_preun %{?**}}
%systemd_postun() %{expand::%%service_del_postun_without_restart %{?**}}
%systemd_postun_with_restart() %{expand::%%service_del_postun %{?**}}
%systemd_postun_with_restart() %{expand::%%service_del_postun_with_restart %{?**}}
%systemd_user_pre() \
if [ -x /usr/bin/systemctl ]; then \

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 29 11:33:44 UTC 2023 - Franck Bui <fbui@suse.com>
- %service_del_postun: make sure to restart services if /etc/sysconfig/service
is not present.
-------------------------------------------------------------------
Wed Mar 29 10:40:14 UTC 2023 - Franck Bui <fbui@suse.com>