about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2016-08-07 13:36:56 +0200
committerMichael Biebl <biebl@debian.org>2016-08-07 13:39:26 +0200
commit31bf695cc438fa57869ed7fe5b6199b7fd4ce71c (patch)
tree5a234e683c8d25918dfab93ff3a162d5875c383b
parent027b2fa9f46599125a01b0d52359eed1a8c23667 (diff)
Replace /etc/resolv.conf symlink with an empty file on package removal
Removing the symlink is a hint to other packages that NetworkManager is
no longer controlling the file.

Closes: #826366
-rw-r--r--debian/changelog3
-rw-r--r--debian/network-manager.postrm9
2 files changed, 10 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index 14bef944..928115bb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,9 @@ network-manager (1.2.4-1) UNRELEASED; urgency=medium
   * New upstream release.
   * Rebase patches.
   * Update symbols file for libnm0.
+  * Replace /etc/resolv.conf symlink with an empty file on package removal
+    to signal other packages that NetworkManager is no longer controlling the
+    file. (Closes: #826366)
 
  -- Michael Biebl <biebl@debian.org>  Wed, 03 Aug 2016 23:01:13 +0200
 
diff --git a/debian/network-manager.postrm b/debian/network-manager.postrm
index ff5c49e7..f0d9188f 100644
--- a/debian/network-manager.postrm
+++ b/debian/network-manager.postrm
@@ -22,8 +22,13 @@ case "$1" in
         rm -rf /var/lib/NetworkManager
         ;;
     remove)
-        # Since we no longer run the ifblacklist_migrate.sh script
-        # we also don't need to clean up anymore afterwards.
+        # Replace /etc/resolv.conf symlink with an empty file on package
+        # removal to signal other packages that NetworkManager is no longer
+        # controlling the file. (See: #826366)
+        if [ "$(readlink /etc/resolv.conf)" = /var/run/NetworkManager/resolv.conf ] ; then
+            rm -f /etc/resolv.conf
+            touch /etc/resolv.conf
+        fi
         ;;
     upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
         ;;