From 7246df347ef8533b35723b1da4c288dece7ff467 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Mon, 7 Mar 2011 18:03:22 +0000 Subject: do not reload systemd, new chkconfig does it for us --- Makefile | 2 +- NEWS | 3 +++ add-service | 20 ++++++++++++-------- del-service | 11 +++++++---- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 68574e4..550aab2 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ PACKAGE = rpm-helper -VERSION = 0.23.6 +VERSION = 0.23.7 SVNPATH = svn+ssh://svn.mandriva.com/svn/soft/rpm/$(PACKAGE) SCRIPT_FILES = add-user del-user add-service del-service create-file \ diff --git a/NEWS b/NEWS index 7db740d..d282624 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +2011-03-07 Andrey Borzenkov 0.23.7 + * avoid reloading systemd twice with new chkconfig + 2011-01-25 Eugeni Dodonov /dev/null 2>&1 + # support for systemd. chkconfig will do daemon-reload for us + if [ $systemd = yes ]; then + /bin/systemctl --quiet --no-reload enable ${srv}.service fi + /sbin/chkconfig --add $srv + if [ -r /etc/sysconfig/system ]; then . /etc/sysconfig/system fi @@ -75,17 +79,17 @@ else # Upgrade mode # if the service is activated, add it again to be able to handle - # changes in start/stop levels + # changes in start/stop levels and enable systemd unit as well set -- /etc/rc3.d/S??$srv if [ $# -gt 1 ]; then echo 1>&2 "add-service: Error: $srv appears multiple times: $*" fi if [ -f "$1" ]; then - /sbin/chkconfig --add $srv - if [ -x /bin/systemctl ]; then - /bin/systemctl --enable ${srv}.service + if [ $systemd = yes ]; then + /bin/systemctl --quiet --no-reload enable ${srv}.service fi + /sbin/chkconfig --add $srv fi # restart the service if already running diff --git a/del-service b/del-service index fa38e88..096d717 100755 --- a/del-service +++ b/del-service @@ -19,14 +19,17 @@ pkg=$1 # name of the package num=$2 # number of packages installed srv=$3 # name of the service +systemd=no +[ -x /bin/systemctl -a -r /lib/systemd/system/${srv}.service ] && systemd=yes + if [ $num = 0 ]; then if [ -z "$DURING_INSTALL" ]; then /sbin/service $srv stop > /dev/null || : fi - # support for systemd - if [ -x /bin/systemctl ]; then - /bin/systemctl disable ${srv}.service > /dev/null 2>&1 - /bin/systemctl daemon-reload + + # support for systemd. chkconfig will do daemon-reload for us + if [ $systemd = yes ]; then + /bin/systemctl --quiet --no-reload disable ${srv}.service fi /sbin/chkconfig --del $srv fi -- cgit v1.2.1