I've tried to capture the discussions we've had today about how to handle
nameservice discovery. The two central problems we hit today were:
* if there are multiple interfaces up, from which one should we get the
name service configuration data?
* when/how do we get name service config parameters from dhcp on interfaces
that aren't using dhcp for ip addressing?
Apologies to those who haven't been in on the conversations; this is
pretty terse. But comments are welcome. Improvements would be especially
appreciated. :-)
-renee
name service related properties:
* nameservice_discover/boolean: if true, nwam should apply ns config learned
via dhcp
* nameservices/enum list: identifies name service(s) that should be configured.
If discover is true, will only configure services that appear on this list,
even if others have config info available. If nothing is specified, and
discover is true, only one nameservice will be configured: whichever of nis,
dns has info available via dhcp (in that priority order).
* nameservices_ifs/string list (NEW): identifies (in priority order)
interfaces from which ns config should be learned. If only one interface
is active, that one will be used; if more than one is active, this list
will be used to decide which one to look at.
* nameservices_config_file/string: specifies the file to be used for
nsswitch.conf. Must be specified if nameservices includes more than one
service.
(the following are unchanged, and are used in the !nameservice_discover case)
* domainname
* [dns|nis|ldap]_nameservice_servers
* dns_nameservice_search
the plan:
When an interface (ip ncu) is being plumbed, nwamd will do a DHCPINFORM
transaction for all the ns properties (DNSdmain, DNSserv, NISdmain, NISservs).
dhcpagent will cache this info.
On location activation, if nameservice_discover is true, net-loc will:
* if only one if is active, get ns info associated with that interface;
else if nameservices_ifs is non-empty, try to get ns info from each if on
that list in turn; else fail
* if nameservices specified, configure everything that's both on the list
and we have info for; else if we have nis info, configure it; else if we
have dns info, configure it.
pseudo-code:
if (nameservice_discover) {
get active if ncu count
if (count == 1) {
get dhcp ns info from that interface
} else {
if nameservices_ifs specified {
for if in nameservices_ifs {
get dhcp ns info
if found, break
}
if no ns info
fail
} else {
fail
}
}
if nameservices specified {
for ns in nameservices {
if we have dhcp info for ns
configure ns
}
if no ns configured
fail
} else {
if we have dhcp info for nis
configure nis
else if we have dhcp info for dns
configure dns
else
fail
}
}