[Resolvconf-devel] Bug#783596: Not a bug
jdthood at gmail.com
Wed Apr 29 13:56:24 UTC 2015
On 28 April 2015 at 16:28, Andrew Shadura <andrew at shadura.me> wrote:
> That isn't true: ifupdown calls all hook scripts for every entry that
> many times as is the number of entries.
Ah, sorry, I didn't know that. (I thought that ifupdown would combine
the information and call the hook scripts only once.)
> It's a bug in resolvconf's hook scripts, they shouldn't override
> interface settings if no recognised option is specified.
The hook scripts were written for a world in which ifupdown configures
a "physical" interface as exactly one "logical" interface and calls
each hook script exactly once, supplying it via environment variables
with complete information about the configured physical interface.
Then, in particular, if IF_DNS_NAMESERVER and IF_DNS_NAMESERVERS are
empty then no nameserver addresses are specified for that interface.
The world has changed so that sometimes ifupdown configures a physical
interface simultaneously as two or more homonymous logical interfaces
and calls each hook script that many times (i.e., once per logical
interface). Thus it supplies each hook script process with only
partial information about the configured physical interface. In
particular, in the new world, IF_DNS_NAMESERVER and IF_DNS_NAMESERVERS
being empty does not imply that no nameserver addresses are specified
for the interface.
I understand that the desired behavior is that one should be able to
put dns-* options in any of the homonymous logical interface
definitions. However, I don't immediately see an easy way to implement
One way to implement it is for the resolvconf hook script to write out
a distinct record for each logical interface. These records would get
combined as usual. The difficulty is in naming this record. Distinct
logical interfaces no longer have distinct names, so the logical
interface name no longer suffices to distinguish the records. Perhaps
the IP address could also be used? But is it not legal to have two
logical interface definitions with the same name *and* IP address?
The other way to implement it is for resolvconf to accumulate
information in a single record across hook script runs. The difficulty
then is in reliably distinguishing between (1) information left by one
of the earlier hook script processes for this "run" (which should be
preserved) and (2) stale information from an earlier run (which should
More information about the Resolvconf-devel