Accepting request 678270 from home:fbui:branches:Base:System
- Introduce %service_del_postun_without_restart This is another step to make the SUSE rpm macros closer to their upstream counterparts. Introduce %service_del_postun_without_restart which should help in getting rid of '-f' and '-n' switches of %service_del_postun. OBS-URL: https://build.opensuse.org/request/show/678270 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=32
This commit is contained in:
parent
283ce5b854
commit
e5d6d1a3e5
@ -18,6 +18,7 @@
|
||||
#
|
||||
# %postun
|
||||
# %service_del_postun demo.service
|
||||
# %service_del_postun_without_restart demo.service
|
||||
#
|
||||
|
||||
%_unitdir /usr/lib/systemd/system
|
||||
@ -157,34 +158,46 @@ if [ "$FIRST_ARG" -eq 0 -a -x /usr/bin/systemctl ]; then \
|
||||
fi \
|
||||
%{nil}
|
||||
|
||||
# On uninstall, tell systemd to reload its unit files
|
||||
# On uninstall, tell systemd to reload its unit files.
|
||||
# On update, tell systemd to reload its unit files but don't restart service.
|
||||
#
|
||||
# Options used if not in an installation systems
|
||||
# -f that is fore service restart in removal
|
||||
# -n that do not touch active service
|
||||
# the default is to check for DISABLE_RESTART_ON_UPDATE environment
|
||||
# variable if not found use the value read from /etc/sysconfig/services
|
||||
#
|
||||
|
||||
%service_del_postun(fn) \
|
||||
%service_del_postun_without_restart() \
|
||||
test -n "$FIRST_ARG" || FIRST_ARG="$1" \
|
||||
if [ "$FIRST_ARG" -ge 1 ]; then \
|
||||
# Package upgrade, not uninstall \
|
||||
if [ -x /usr/bin/systemctl ]; then \
|
||||
/usr/bin/systemctl daemon-reload || : \
|
||||
%{expand:%%_restart_on_update%{-f:_force}%{!-f:%{-n:_never}} %{?*}} \
|
||||
fi \
|
||||
else # package uninstall \
|
||||
if [ "$FIRST_ARG" -eq 0 ]; then \
|
||||
# Package removal \
|
||||
for service in %{?*} ; do \
|
||||
sysv_service="${service%.*}" \
|
||||
rm -f "/var/lib/systemd/migrated/$sysv_service" || : \
|
||||
done \
|
||||
fi \
|
||||
if [ -x /usr/bin/systemctl ]; then \
|
||||
/usr/bin/systemctl daemon-reload || : \
|
||||
fi \
|
||||
%{nil}
|
||||
|
||||
# On uninstall, tell systemd to reload its unit files
|
||||
#
|
||||
# Options used if not in an installation systems
|
||||
# -f that is force service restart in removal (deprecated)
|
||||
# -n that do not touch active service (depredacted)
|
||||
# the default is to check for DISABLE_RESTART_ON_UPDATE environment
|
||||
# variable if not found use the value read from /etc/sysconfig/services
|
||||
#
|
||||
%service_del_postun(fn) \
|
||||
test -n "$FIRST_ARG" || FIRST_ARG="$1" \
|
||||
%service_del_postun_without_restart %{?*} \
|
||||
if [ "$FIRST_ARG" -ge 1 ]; then \
|
||||
# Package upgrade, not uninstall \
|
||||
if [ -x /usr/bin/systemctl ]; then \
|
||||
/usr/bin/systemctl daemon-reload || : \
|
||||
%{expand:%%_restart_on_update%{-f:_force}%{!-f:%{-n:_never}} %{?*}} \
|
||||
fi \
|
||||
fi \
|
||||
%{nil}
|
||||
|
||||
#
|
||||
# Upstream variants
|
||||
#
|
||||
|
||||
%systemd_post() \
|
||||
if [ $1 -eq 1 -a -x /usr/bin/systemctl ] ; then \
|
||||
# Initial installation \
|
||||
|
@ -1,3 +1,14 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Feb 22 13:00:18 UTC 2019 - Franck Bui <fbui@suse.com>
|
||||
|
||||
- Introduce %service_del_postun_without_restart
|
||||
|
||||
This is another step to make the SUSE rpm macros closer to their
|
||||
upstream counterparts.
|
||||
|
||||
Introduce %service_del_postun_without_restart which should help in
|
||||
getting rid of '-f' and '-n' switches of %service_del_postun.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Feb 21 17:53:18 UTC 2019 - Franck Bui <fbui@suse.com>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user