Comment 30 for bug 324233

Revision history for this message
Thomas Hood (jdthood) wrote :

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.