From d7fc4e779a6ad704def2f942b1af0d3ecffb26ea Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Thu, 3 Apr 2014 20:48:15 +0200 Subject: Rework the fix for #734460, kill NetworkManager in the postinst script instead of the preinst one to minimize downtime on big upgrades --- debian/network-manager.postinst | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'debian/network-manager.postinst') 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 -- cgit 1.3.0-6-gf8a5