← Back to team overview

desktop-packages team mailing list archive

[Bug 324233] Re: Network Manager 0.7 doesn't use resolvconf to remove nameserver info if it didn't use resolvconf for adding its nameserver info - wipes /etc/resolv.conf link

 

Thanks to Paul Smith for explaining (#27) how resolvconf is supposed to
work.  For a more detailed explanation please read the README file in
the resolvconf package.

When resolvconf and NM are both installed the current behavior is this:

The Ubuntu version of resolvconf immediately returns an error if /etc/resolv.conf is not a symbolic link;
otherwise resolvconf runs and then may or may not return an error depending on how things go.
If resolvconf returns an error (for any reason) then NM writes information directly to /etc/resolv.conf.

This behavior is incorrect for the following reasons.

* Resolvconf should not abort if /etc/resolv.conf is not a symlink.  Resolvconf does other useful things besides writing /etc/resolvconf/run/resolv.conf.  For example, it writes /var/run/dnsmasq/resolv.conf if the dnsmasq package is installed.
* NM does not distinguish between /etc/resolv.conf failing to be a symlink and resolvconf returning a non-zero exit code for some other reason.  If resolvconf is just returning an error condition that was returned by a hook script then it may not be appropriate to stomp on resolv.conf.

The correct behavior is as follows.

NM runs resolvconf if it is present.
Resolvconf runs whether or not /etc/resolv.conf is a symlink.

Furthermore:

If /etc/resolv.conf is not a symlink then NM writes resolver
configuration information to /etc/resolv.conf.

Consistently with the preceding description, the resolvconf program in
the upcoming release of the Ubuntu resolvconf package, version
1.63ubuntu1, does not abort if /etc/resolv.conf is not a symlink.

Attached is a untested patch indicating how NM should be changed to
behave according to the preceding description.  Other variants of the
patch are possible.  With this patch NM writes /etc/resolv.conf if and
only if the latter is not a symlink.  Another possibility is for NM to
write /etc/resolv.conf if and only if the latter is not a symlink, or is
a symlink to /run/network-manager/resolv.conf or something like that.

I invite interested parties to test a pre-release version of the new
Ubuntu resolvconf package which is now available in my PPA:
ppa:jdthood/resolvconf
(https://launchpad.net/~jdthood/+archive/resolvconf).  Please let me
know whether or not this package works for you!

Who am I?  I am one of the maintainers of resolvconf in Debian.   I
would prefer to leave this work up to Ubuntu folks, but these issues
have been left unresolved for years.  Something has to be done.

** Patch added: "nm-correct-resolvconf-handling.patch"
   https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/324233/+attachment/2617538/+files/nm-correct-resolvconf-handling.patch

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to network-manager in Ubuntu.
https://bugs.launchpad.net/bugs/324233

Title:
  Network Manager 0.7 doesn't use resolvconf to remove nameserver info
  if it didn't use resolvconf for adding its nameserver info - wipes
  /etc/resolv.conf link

Status in “network-manager” package in Ubuntu:
  Triaged

Bug description:
  Binary package hint: network-manager-kde

  I use vpnc and have resolvconf package loaded to allow vpnc to update
  dns.   Network manager is replacing the symbolic link /etc/resolv.conf
  -> /etc/resolvconf/run/resolv.conf with a new (non-symbolic linked)
  /etc/resolv.conf this prevents resolvconf from updating DNS settings
  as it requires resolv.conf to be symbolic-link file.   if I delete the
  /etc/resolv.conf file and symbolic link it to
  /etc/resolvconf/run/resolv.conf my vpn works fine and updates dns as
  expected, however if I reboot my machine the symbolic file is replaced
  by a new file that isn't symbolically linked to
  resolvconf/run/resolv.conf file.

  network manager should update the resolv.conf file not replace it.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/324233/+subscriptions