forked from pool/systemd-rpm-macros
.
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=14
This commit is contained in:
parent
34f074503f
commit
35441a3b44
@ -50,19 +50,33 @@ Requires(postun): systemd \
|
|||||||
%_ntpunitsdir /usr/lib/systemd/ntp-units.d
|
%_ntpunitsdir /usr/lib/systemd/ntp-units.d
|
||||||
%_binfmtdir /usr/lib/binfmt.d
|
%_binfmtdir /usr/lib/binfmt.d
|
||||||
|
|
||||||
%_restart_check_systemctl \
|
%_restart_on_update_force() (\
|
||||||
test "$DISABLE_RESTART_ON_UPDATE" = yes && exit 0 \
|
test "$YAST_IS_RUNNING" = instsys && exit 0 \
|
||||||
test -f /etc/sysconfig/services && . /etc/sysconfig/services \
|
%{?*:/usr/bin/systemctl try-restart %{*}} \
|
||||||
test "$YAST_IS_RUNNING" = instsys && exit 0 \
|
) || : %{nil}
|
||||||
test "$DISABLE_RESTART_ON_UPDATE" = yes && exit 0 \
|
%_restart_on_update_never() %{?*:# Restart of %{*} skipped} %{nil}
|
||||||
/usr/bin/systemctl try-restart %{nil}
|
%_restart_on_update() (\
|
||||||
|
test "$YAST_IS_RUNNING" = instsys && exit 0\
|
||||||
|
test -f /etc/sysconfig/services -a \\\
|
||||||
|
-z "$DISABLE_RESTART_ON_UPDATE" && . /etc/sysconfig/services\
|
||||||
|
test "$DISABLE_RESTART_ON_UPDATE" = yes -o \\\
|
||||||
|
"$DISABLE_RESTART_ON_UPDATE" = 1 && exit 0\
|
||||||
|
%{?*:/usr/bin/systemctl try-restart %{*}}\
|
||||||
|
) || : %{nil}
|
||||||
|
|
||||||
%_stop_check_systemctl \
|
%_stop_on_removal_force() ( \
|
||||||
test "$DISABLE_STOP_ON_REMOVAL" = yes && exit 0 \
|
test "$YAST_IS_RUNNING" = instsys && exit 0\
|
||||||
test -f /etc/sysconfig/services && . /etc/sysconfig/services \
|
%{?*:/usr/bin/systemctl stop %{*}}\
|
||||||
test "$YAST_IS_RUNNING" = instsys && exit 0 \
|
) || : %{nil}
|
||||||
test "$DISABLE_STOP_ON_REMOVAL" = yes && exit 0 \
|
%_stop_on_removal_never() %{?*:# Stop of %{*} skipped} %{nil}
|
||||||
/usr/bin/systemctl stop %{nil}
|
%_stop_on_removal() (\
|
||||||
|
test "$YAST_IS_RUNNING" = instsys && exit 0\
|
||||||
|
test -f /etc/sysconfig/services -a \\\
|
||||||
|
-z "$DISABLE_STOP_ON_REMOVAL" && . /etc/sysconfig/services\
|
||||||
|
test "$DISABLE_STOP_ON_REMOVAL" = yes -o \\\
|
||||||
|
"$DISABLE_STOP_ON_REMOVAL" = 1 && exit 0\
|
||||||
|
%{?*:/usr/bin/systemctl stop %{*}}\
|
||||||
|
) || : %{nil}
|
||||||
|
|
||||||
%service_add_pre() \
|
%service_add_pre() \
|
||||||
test -n "$FIRST_ARG" || FIRST_ARG="$1" \
|
test -n "$FIRST_ARG" || FIRST_ARG="$1" \
|
||||||
@ -130,23 +144,38 @@ fi \
|
|||||||
%{nil}
|
%{nil}
|
||||||
|
|
||||||
# On uninstall, disable and stop services
|
# On uninstall, disable and stop services
|
||||||
%service_del_preun() \
|
#
|
||||||
|
# Options used if not in an installation systems
|
||||||
|
# -f that is fore service stop in removal
|
||||||
|
# -n that do not touch active service
|
||||||
|
# the default is to check for DISABLE_STOP_ON_REMOVAL environment
|
||||||
|
# variable if not found use the value read from /etc/sysconfig/services
|
||||||
|
#
|
||||||
|
%service_del_preun(fn) \
|
||||||
test -n "$FIRST_ARG" || FIRST_ARG="$1" \
|
test -n "$FIRST_ARG" || FIRST_ARG="$1" \
|
||||||
if [ "$FIRST_ARG" -eq 0 -a -x /usr/bin/systemctl ]; then \
|
if [ "$FIRST_ARG" -eq 0 -a -x /usr/bin/systemctl ]; then \
|
||||||
# Package removal, not upgrade \
|
# Package removal, not upgrade \
|
||||||
/usr/bin/systemctl --no-reload disable %{?*} || : \
|
/usr/bin/systemctl --no-reload disable %{?*} || : \
|
||||||
( %_stop_check_systemctl %{?*} || : ) \
|
%{expand:%%_stop_on_removal%{-f:_force}%{!-f:%{-n:_never}} %{?*}} \
|
||||||
fi \
|
fi \
|
||||||
%{nil}
|
%{nil}
|
||||||
|
|
||||||
# On uninstall, tell systemd to reload its unit files
|
# On uninstall, tell systemd to reload its unit files
|
||||||
%service_del_postun() \
|
#
|
||||||
|
# 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) \
|
||||||
test -n "$FIRST_ARG" || FIRST_ARG="$1" \
|
test -n "$FIRST_ARG" || FIRST_ARG="$1" \
|
||||||
if [ "$FIRST_ARG" -ge 1 ]; then \
|
if [ "$FIRST_ARG" -ge 1 ]; then \
|
||||||
# Package upgrade, not uninstall \
|
# Package upgrade, not uninstall \
|
||||||
if [ -x /usr/bin/systemctl ]; then \
|
if [ -x /usr/bin/systemctl ]; then \
|
||||||
/usr/bin/systemctl daemon-reload || : \
|
/usr/bin/systemctl daemon-reload || : \
|
||||||
( %_restart_check_systemctl %{?*} || : ) \
|
%{expand:%%_restart_on_update%{-f:_force}%{!-f:%{-n:_never}} %{?*}} \
|
||||||
fi \
|
fi \
|
||||||
else # package uninstall \
|
else # package uninstall \
|
||||||
for service in %{?*} ; do \
|
for service in %{?*} ; do \
|
||||||
@ -159,21 +188,35 @@ else # package uninstall \
|
|||||||
fi \
|
fi \
|
||||||
%{nil}
|
%{nil}
|
||||||
|
|
||||||
%systemd_post() \
|
#
|
||||||
|
# Options used if not in an installation systems
|
||||||
|
# -f that is fore service stop in removal
|
||||||
|
# -n that do not touch active service
|
||||||
|
# the default is to check for DISABLE_STOP_ON_REMOVAL environment
|
||||||
|
# variable if not found use the value read from /etc/sysconfig/services
|
||||||
|
#
|
||||||
|
%systemd_post(fn) \
|
||||||
if [ "$1" -eq 0 -a -x /usr/bin/systemctl ]; then \
|
if [ "$1" -eq 0 -a -x /usr/bin/systemctl ]; then \
|
||||||
# Package removal, not upgrade \
|
# Package removal, not upgrade \
|
||||||
/usr/bin/systemctl --no-reload disable %{?*} || : \
|
/usr/bin/systemctl --no-reload disable %{?*} || : \
|
||||||
( %_stop_check_systemctl %{?*} || : ) \
|
%{expand:%%_stop_on_removal%{-f:_force}%{!-f:%{-n:_never}} %{?*}} \
|
||||||
fi \
|
fi \
|
||||||
%{nil}
|
%{nil}
|
||||||
|
|
||||||
%systemd_user_post() %systemd_post --user --global %{?*}
|
%systemd_user_post() %systemd_post --user --global %{?*}
|
||||||
|
|
||||||
%systemd_preun() \
|
#
|
||||||
|
# Options used if not in an installation systems
|
||||||
|
# -f that is fore service stop in removal
|
||||||
|
# -n that do not touch active service
|
||||||
|
# the default is to check for DISABLE_STOP_ON_REMOVAL environment
|
||||||
|
# variable if not found use the value read from /etc/sysconfig/services
|
||||||
|
#
|
||||||
|
%systemd_preun(fn) \
|
||||||
if [ "$1" -eq 0 -a -x /usr/bin/systemctl ]; then \
|
if [ "$1" -eq 0 -a -x /usr/bin/systemctl ]; then \
|
||||||
# Package removal, not upgrade \
|
# Package removal, not upgrade \
|
||||||
/usr/bin/systemctl --no-reload disable %{?*} || : \
|
/usr/bin/systemctl --no-reload disable %{?*} || : \
|
||||||
( %_stop_check_systemctl %{?*} || : ) \
|
%{expand:%%_stop_on_removal%{-f:_force}%{!-f:%{-n:_never}} %{?*}} \
|
||||||
fi \
|
fi \
|
||||||
%{nil}
|
%{nil}
|
||||||
|
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Mar 3 10:01:52 UTC 2016 - werner@suse.de
|
||||||
|
|
||||||
|
- Allow the packagers to specify the options -f and -n on the
|
||||||
|
macros %service_del_preun(), %service_del_postun(), %systemd_post(),
|
||||||
|
and %systemd_preun() (boo#968405)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sat Feb 27 10:18:55 UTC 2016 - dimstar@opensuse.org
|
Sat Feb 27 10:18:55 UTC 2016 - dimstar@opensuse.org
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user