Comment 2 for bug 922677

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

> * dhclient hook: Only trigger if /etc/resolv.conf is a symlink.
> * Make resolvconf exit 0 when /etc/resolv.conf isn't a symlink

In the Debian version of resolvconf, interface-configurer hook scripts always run /sbin/resolvconf if it's present, whether or not /etc/resolv.conf is a symlink. That way resolvconf is always provided with all available information. It's also important to keep in mind that resolvconf may have "subscribers" other than libc. Thus even if the admin --- for whatever reason --- has decided to put a static file at /etc/resolv.conf or to link /etc/resolv.conf to some other target generated by some other tool, /sbin/resolvconf still gets run and it, in turn, still calls its hook scripts so that its subscribers (perhaps dnsmasq, perhaps...) are made aware that there is new information.

Some time ago some Ubuntu developer added

    [ -L /etc/resolv.conf ] || exit 1

to the beginning of Ubuntu /sbin/resolvconf so that Ubuntu resolvconf does nothing if /etc/resolv.conf isn't a symlink, the consequence of the nonzero exit code being that NetworkManager will fall back to another way of updating /etc/resolv.conf. (That wasn't a clean solution from my point of view, as author of resolvconf. The clean solution would have been (1) not to change /sbin/resolvconf, but (2) to change NetworkManager so that it both calls resolvconf and writes /etc/resolv.conf if the latter isn't a symlink. But the Ubuntu broth has enough other cooks.)

If /sbin/resolvconf exits with 0 when /etc/resolv.conf isn't a symlink then, in that case, NetworkManager will no longer write /etc/resolv.conf. Is this what was intended?
--
Thomas Hood