about summary refs log tree commit diff
path: root/debian/network-manager.postinst
diff options
context:
space:
mode:
authorLaurent Bigonville <bigon@bigon.be>2014-04-03 20:48:15 +0200
committerLaurent Bigonville <bigon@bigon.be>2014-04-04 01:43:16 +0200
commitd7fc4e779a6ad704def2f942b1af0d3ecffb26ea (patch)
treeacd970c82fd4528f338fc4584e4bd401755eb97b /debian/network-manager.postinst
parent4f8f6ddb7167d6ccfa8329e4f3fdde447847c8b3 (diff)
Rework the fix for #734460, kill NetworkManager in the postinst script instead of the preinst one to minimize downtime on big upgrades
Diffstat (limited to 'debian/network-manager.postinst')
-rw-r--r--debian/network-manager.postinst11
1 files changed, 11 insertions, 0 deletions
diff --git a/debian/network-manager.postinst b/debian/network-manager.postinst
index e93ee3af..8021d9e7 100644
--- a/debian/network-manager.postinst
+++ b/debian/network-manager.postinst
@@ -20,6 +20,17 @@ set -e
 
 case "$1" in
     configure)
+	# When upgrading from a version that was using an Alias= instead of
+	# symlink to mask the LSB initscript, if we are running systemd and
+	# NetworkManager has been started by the LSB script, kill the process
+	# before we are restarting it. (See: #734460)
+	if dpkg --compare-versions "$2" lt-nl "0.9.8.8-2~"; then
+	    if [ -d /run/systemd/system ] && \
+	      [ -f /var/run/NetworkManager/NetworkManager.pid ]; then
+	        start-stop-daemon --stop --retry 5 --quiet --exec /usr/sbin/NetworkManager \
+		  --pidfile /var/run/NetworkManager/NetworkManager.pid || true
+	    fi
+	fi
 
         # Create netdev group that is used in the D-Bus policy file
         addgroup --quiet --system netdev