diff options
| author | Laurent Bigonville <bigon@bigon.be> | 2014-04-03 20:48:15 +0200 |
|---|---|---|
| committer | Laurent Bigonville <bigon@bigon.be> | 2014-04-04 01:43:16 +0200 |
| commit | d7fc4e779a6ad704def2f942b1af0d3ecffb26ea (patch) | |
| tree | acd970c82fd4528f338fc4584e4bd401755eb97b | |
| parent | 4f8f6ddb7167d6ccfa8329e4f3fdde447847c8b3 (diff) | |
Rework the fix for #734460, kill NetworkManager in the postinst script instead of the preinst one to minimize downtime on big upgrades
| -rw-r--r-- | debian/changelog | 7 | ||||
| -rw-r--r-- | debian/network-manager.postinst | 11 | ||||
| -rw-r--r-- | 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 <bigon@debian.org> 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 |