Accepting request 345465 from Base:System

- Support of DISABLE_STOP_ON_REMOVAL and DISABLE_RESTART_ON_UPDATE 
  from /etc/sysconfig/service (bsc#955996)

OBS-URL: https://build.opensuse.org/request/show/345465
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd-rpm-macros?expand=0&rev=14
This commit is contained in:
Dominique Leuenberger 2015-11-26 16:00:40 +00:00 committed by Git OBS Bridge
commit 8547095cde
2 changed files with 26 additions and 9 deletions

View File

@ -50,13 +50,25 @@ Requires(postun): systemd \
%_ntpunitsdir /usr/lib/systemd/ntp-units.d
%_binfmtdir /usr/lib/binfmt.d
%_restart_check_systemctl \
test -f /etc/sysconfig/services && . /etc/sysconfig/services \
test "$YAST_IS_RUNNING" = instsys && exit 0 \
test "$DISABLE_RESTART_ON_UPDATE" = yes && exit 0 \
/usr/bin/systemctl try-restart %{nil}
%_stop_check_systemctl \
test -f /etc/sysconfig/services && . /etc/sysconfig/services \
test "$YAST_IS_RUNNING" = instsys && exit 0 \
test "$DISABLE_STOP_ON_REMOVAL" = yes && exit 0 \
/usr/bin/systemctl stop %{nil}
%service_add_pre() \
test -n "$FIRST_ARG" || FIRST_ARG="$1" \
# disable migration if initial install under systemd \
[ -d /var/lib/systemd/migrated ] || mkdir -p /var/lib/systemd/migrated || : \
if [ "$FIRST_ARG" -eq 1 ]; then \
for service in %{?*} ; do \
sysv_service="${service%.*}" \
sysv_service="${service%%.*}" \
touch "/var/lib/systemd/migrated/$sysv_service" || : \
done \
else \
@ -68,7 +80,7 @@ else \
done \
fi \
for service in %{?*} ; do \
sysv_service="${service%.*}" \
sysv_service="${service%%.*}" \
if [ ! -e "/var/lib/systemd/migrated/$sysv_service" ]; then \
services_to_migrate="$services_to_migrate $sysv_service" \
fi \
@ -84,7 +96,7 @@ fi \
test -n "$FIRST_ARG" || FIRST_ARG="$1" \
[ -d /var/lib/systemd/migrated ] || mkdir -p /var/lib/systemd/migrated || : \
for service in %{?*} ; do \
sysv_service="${service%.*}" \
sysv_service="${service%%.*}" \
if [ ! -e "/var/lib/systemd/migrated/$sysv_service" ]; then \
services_to_migrate="$services_to_migrate $sysv_service" \
touch "/var/lib/systemd/migrated/$sysv_service" || : \
@ -121,7 +133,7 @@ test -n "$FIRST_ARG" || FIRST_ARG="$1" \
if [ "$FIRST_ARG" -eq 0 -a -x /usr/bin/systemctl ]; then \
# Package removal, not upgrade \
/usr/bin/systemctl --no-reload disable %{?*} || : \
/usr/bin/systemctl stop %{?*} || : \
( %_stop_check_systemctl %{?*} || : ) \
fi \
%{nil}
@ -130,10 +142,9 @@ fi \
test -n "$FIRST_ARG" || FIRST_ARG="$1" \
if [ "$FIRST_ARG" -ge 1 ]; then \
# Package upgrade, not uninstall \
if test "$YAST_IS_RUNNING" != "instsys" && \
test "$DISABLE_RESTART_ON_UPDATE" != yes -a -x /usr/bin/systemctl; then \
if [ -x /usr/bin/systemctl ]; then \
/usr/bin/systemctl daemon-reload || : \
/usr/bin/systemctl try-restart %{?*} || : \
( %_restart_check_systemctl %{?*} || : ) \
fi \
else # package uninstall \
for service in %{?*} ; do \
@ -150,7 +161,7 @@ fi \
if [ "$1" -eq 0 -a -x /usr/bin/systemctl ]; then \
# Package removal, not upgrade \
/usr/bin/systemctl --no-reload disable %{?*} || : \
/usr/bin/systemctl stop %{?*} || : \
( %_stop_check_systemctl %{?*} || : ) \
fi \
%{nil}
@ -160,7 +171,7 @@ fi \
if [ "$1" -eq 0 -a -x /usr/bin/systemctl ]; then \
# Package removal, not upgrade \
/usr/bin/systemctl --no-reload disable %{?*} || : \
/usr/bin/systemctl stop %{?*} || : \
( %_stop_check_systemctl %{?*} || : ) \
fi \
%{nil}

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Nov 20 16:53:23 UTC 2015 - werner@suse.de
- Support of DISABLE_STOP_ON_REMOVAL and DISABLE_RESTART_ON_UPDATE
from /etc/sysconfig/service (bsc#955996)
-------------------------------------------------------------------
Fri Sep 18 15:27:04 CEST 2015 - sbrabec@suse.com