From b147129f0ba40e800e97a51f841e7fa3eb294090 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sun, 27 Jul 2014 19:42:37 +0100 Subject: Drop systemd migration scripts we never used. --- Makefile | 3 +-- NEWS | 2 ++ migrate-service | 53 ---------------------------------------------------- postun-unit | 40 --------------------------------------- rpm-helper.macros.in | 10 ---------- 5 files changed, 3 insertions(+), 105 deletions(-) delete mode 100755 migrate-service delete mode 100755 postun-unit diff --git a/Makefile b/Makefile index 1d9422a..33235ea 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,7 @@ SCRIPT_FILES = add-user del-user create-file \ add-service del-service reread-services \ add-group del-group add-shell del-shell verify-shell \ add-syslog del-syslog add-webapp del-webapp \ - get-password create-ssl-certificate \ - migrate-service postun-unit + get-password create-ssl-certificate MACROS_FILES = rpm-helper.macros CONF_FILES = ssl TEST_FILES = t/*.t diff --git a/NEWS b/NEWS index 1199224..cf85649 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ + * drop systemd migration scripts we never used + 2012-09-30 Colin Guthrie 0.24.11 * mark a systemd-only service as "migrated" on install to avoid checking for sysvinit migration when next upgraded. diff --git a/migrate-service b/migrate-service deleted file mode 100755 index de08435..0000000 --- a/migrate-service +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -#--------------------------------------------------------------- -# Project : Mandriva Linux -# Module : rpm-helper -# File : migrate-service -# Version : $Id$ -# Authors : Andrey Borzenkov -# Created On : Sat Mar 12 18:37:00 2011 -# Purpose : helper script for rpm scriptlets to migrate -# from SysV script to systemd unit. -#--------------------------------------------------------------- - -if [ $# -lt 3 ]; then - echo "usage: $0 {pre|post} ..." 1>&2 - exit 1 -fi - -phase=$1 # pre/post -srv=$2 # name of the SysV script -shift 2 # systemd units - -if [ $phase = pre ]; then - # create flag that service was active and stop it - # As we are booted under systemd, we can just as well ask it ... - /bin/rm -f /tmp/systemd-migrate-active-$srv - if /bin/mountpoint -q /sys/fs/cgroup/systemd; then - active=$(/bin/systemctl show --no-pager -p ActiveState $srv.service 2> /dev/null) - if [ "${active#ActiveState=}" = active ]; then - /bin/touch /tmp/systemd-migrate-active-$srv - /bin/systemctl stop $srv.service - fi - fi - - # enable units if service was active in run-levels 3 or 5. - # This loosely corresponds to systemctl is-enabled. We assume, that - # units do include correct [Install] entries. - if /sbin/chkconfig --no-redirect --level=3 $srv || \ - /sbin/chkconfig --no-redirect --level=5 $srv; then - /bin/systemctl --no-reload --quiet enable "$@" || : - fi -else - # Reload daemon after old package was removed - # Restart new units if old SysV script was started. - if /bin/mountpoint -q /sys/fs/cgroup/systemd; then - /bin/systemctl daemon-reload - if [ -f /tmp/systemd-migrate-active-$srv ]; then - /bin/systemctl start "$@" - fi - fi - /bin/rm -f /tmp/systemd-migrate-active-$srv -fi - -# migrate-service ends here diff --git a/postun-unit b/postun-unit deleted file mode 100755 index dfc4b82..0000000 --- a/postun-unit +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -#--------------------------------------------------------------- -# Project : Mandriva Linux -# Module : rpm-helper -# File : postun-unit -# Version : $Id$ -# Authors : Andrey Borzenkov -# Created On : Sat Mar 12 18:05:00 2011 -# Purpose : helper script for rpm scriptlets to remove a -# systemd unit. -#--------------------------------------------------------------- - -# Reload systemd configuration and try to restart units -# It has to be done in postun because package removal may delete -# some links and we need to inform systemd about it - -/bin/mountpoint -q /sys/fs/cgroup/systemd || exit 0 - -if [ $# -lt 3 ]; then - echo "usage: $0 ..." 1>&2 - exit 1 -fi - -pkg=$1 # name of the package -num=$2 # number of packages installed -shift 2 # systemd units - -/bin/systemctl daemon-reload - -if [ $num -ge 1 ]; then - if [ -z "$DURING_INSTALL" ]; then - # New package may have removed some units so restart will - # fail for them; catch it. - # TODO find a way to pass parameters from current packages - # into script installed by previous version - /bin/systemctl try-restart "$@" || : - fi -fi - -# postun-unit ends here diff --git a/rpm-helper.macros.in b/rpm-helper.macros.in index 2c88716..1703bc4 100644 --- a/rpm-helper.macros.in +++ b/rpm-helper.macros.in @@ -70,18 +70,8 @@ %{nil} # systemd support -%_migrate_service_helper %_rpm_helper_dir/migrate-service -%_systemd_migrate_service_pre() %_migrate_service_helper pre %{*} \ -%{nil} -%_systemd_migrate_service_post() %_migrate_service_helper post %{*} \ -%{nil} - %_post_unit() %_add_service_helper --no-sysv %{name} $1 %{*} \ %{nil} %_preun_unit() %_del_service_helper --no-sysv %{name} $1 %{*} \ %{nil} - -%_postun_unit_helper %_rpm_helper_dir/postun-unit -%_postun_unit() %_postun_unit_helper %{name} $1 %{*} \ -%{nil} -- cgit v1.2.1