about summary refs log tree commit diff
path: root/debian
diff options
context:
space:
mode:
authorLaurent Bigonville <bigon@bigon.be>2014-01-11 23:58:27 +0100
committerLaurent Bigonville <bigon@bigon.be>2014-01-12 01:07:57 +0100
commit4e94cae8e49adebcac0d4247e59bb53db7fcb56c (patch)
tree97943da57c98b7efed7f8e71f771c055d51aea49 /debian
parent9d74bc4476063d2f54277a1f2eae21a0b2677d5e (diff)
debian/network-manager.preinst: Stop network-manager before upgrading if we are running systemd and the unit is not enabled (Closes: #734460)
Diffstat (limited to 'debian')
-rw-r--r--debian/changelog7
-rw-r--r--debian/network-manager.preinst14
2 files changed, 21 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index ad59f971..4c146445 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+network-manager (0.9.8.8-3) UNRELEASED; urgency=medium
+
+  * debian/network-manager.preinst: Stop network-manager before upgrading if
+    we are running systemd and the unit is not enabled (Closes: #734460)
+
+ -- Laurent Bigonville <bigon@debian.org>  Sat, 11 Jan 2014 23:43:01 +0100
+
 network-manager (0.9.8.8-2) experimental; urgency=medium
 
   * Team upload.
diff --git a/debian/network-manager.preinst b/debian/network-manager.preinst
index 3d522ef1..973ffdcb 100644
--- a/debian/network-manager.preinst
+++ b/debian/network-manager.preinst
@@ -19,6 +19,20 @@ set -e
 
 case "$1" in
     install|upgrade)
+	# When upgrading from a version that was using an Alias= instead of
+	# symlink to mask the LSB initscript, stop NetworkManager before
+	# upgrading if we are running systemd and the NetworkManager.service is
+	# not enabled. This will ensure that NM can properly be stopped and
+	# then started again after the upgrade (See: #734460)
+	if dpkg --compare-versions "$2" lt-nl "0.9.8.8-2~"; then
+	    if [ -d /run/systemd/system ] && \
+	      ! systemctl is-enabled NetworkManager.service > /dev/null 2>&1; then
+	        if [ -x "/etc/init.d/network-manager" ]; then
+	            invoke-rc.d network-manager stop || exit $?
+	        fi
+	    fi
+	fi
+
 	# Upgrade from previous versions
 	if dpkg --compare-versions "$2" lt "0.9.7.997-2"; then
 	    # Move old pid file to /var/run/NetworkManager so the init script