aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Borzenkov <arvidjaar@mandriva.org>2011-03-07 18:03:22 +0000
committerAndrey Borzenkov <arvidjaar@mandriva.org>2011-03-07 18:03:22 +0000
commit7246df347ef8533b35723b1da4c288dece7ff467 (patch)
tree46d17a4f0f29f0a9bc1ba27b023eeb4d5db62eb5
parentea89dde8cdd836e010383efda56de5b9b800f662 (diff)
downloadrpm-helper-7246df347ef8533b35723b1da4c288dece7ff467.tar
rpm-helper-7246df347ef8533b35723b1da4c288dece7ff467.tar.gz
rpm-helper-7246df347ef8533b35723b1da4c288dece7ff467.tar.bz2
rpm-helper-7246df347ef8533b35723b1da4c288dece7ff467.tar.xz
rpm-helper-7246df347ef8533b35723b1da4c288dece7ff467.zip
do not reload systemd, new chkconfig does it for us
-rw-r--r--Makefile2
-rw-r--r--NEWS3
-rwxr-xr-xadd-service20
-rwxr-xr-xdel-service11
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 <arvidjaar@gmail.com> 0.23.7
+ * avoid reloading systemd twice with new chkconfig
+
2011-01-25 Eugeni Dodonov <eugeni@mandriva.com 0.23.6
* Fix typo in del-service which made scriplet fail
diff --git a/add-service b/add-service
index c05ad5c..e7255e6 100755
--- a/add-service
+++ b/add-service
@@ -19,16 +19,20 @@ 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
+
add_chkconfig_service() {
srv=$1
- /sbin/chkconfig --add $srv
- # support for systemd
- if [ -x /bin/systemctl ]; then
- /bin/systemctl enable ${srv}.service > /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