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/changelog | 7 +++++++ debian/network-manager.postinst | 11 +++++++++++ debian/network-manager.preinst | 13 ------------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/debian/changelog b/debian/changelog index 431207f9..f0690fdc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +network-manager (0.9.8.8-6) UNRELEASED; urgency=medium + + * Rework the fix for #734460, kill NetworkManager in the postinst script + instead of the preinst one to minimize downtime on big upgrades + + -- Laurent Bigonville Fri, 04 Apr 2014 01:42:47 +0200 + network-manager (0.9.8.8-5) unstable; urgency=medium * Bump debhelper compatibility level to 9. 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 diff --git a/debian/network-manager.preinst b/debian/network-manager.preinst index a4c4737b..62aadf1e 100644 --- a/debian/network-manager.preinst +++ b/debian/network-manager.preinst @@ -19,19 +19,6 @@ 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 if dpkg --compare-versions "$2" lt "0.9.8.8-4"; then if [ -L /etc/systemd/system/network-manager.service ]; then rm -f /etc/systemd/system/network-manager.service -- cgit 1.3.0-6-gf8a5