about summary refs log tree commit diff
path: root/debian/network-manager.postinst
diff options
context:
space:
mode:
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