forked from pool/systemd-rpm-macros
- %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:
parent
3d2aa53763
commit
3b2c7f4694
@ -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 \
|
||||
|
@ -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>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user