[Pkg-utopia-maintainers] NM 0.7 and resolvconf

Michael Biebl biebl at debian.org
Wed Jun 25 16:32:34 UTC 2008


Hi everyone,

I thought I should this discussion I had with Dan on #nm. It's about 
integration NM and resolvconf with NM 0.7. In 0.6, we simply don't write 
/etc/resolv.conf and let resolvconf manage /etc/resolv.conf.
Sjoerd added a patch to call /sbin/dhclient-script to basically do the 
same under 0.7. The problem is, that in 0.7, the user can override the 
DNS settings.
Anyways, here is the IRC log:

[17:46] <mbiebl> well, resolvconf hooks into dhclient, using it's hook 
mechanism
[17:46] <mbiebl> /sbin/dhclient calls the hooks, but NM's custom 
dhclient script doesn't
[17:46] <mbiebl> hrm, /sbin/dhclient-script, I mean
[17:46] <dcbw> mbiebl: right
[17:47] <dcbw> mbiebl: resolvconf should be treating NM like any other 
regular user of resolv.conf, right?
[17:48] <dcbw> mbiebl: I mean, it shouldn't matter to resolvconf whether 
the stuff gets done in dhclient-script or via NM
[17:49] <mbiebl> What do you mean by "regular user of resolv.conf"
[17:49] <mbiebl> The point is, that resolvconf manages what is written 
to /etc/resolv.conf
[17:49] <mbiebl> so does NM
[17:50] <dcbw> mbiebl: well, if some random process, whether it's 
dhclient-script, pppd, or whatever, needs to update DNS info...
[17:50] <dcbw> mbiebl: right, so instead of writing stuff to resolv.conf 
directly on debian, I guess you want the NM stuff to be given to 
resolv.conf instead
[17:51] <dcbw> mbiebl: there were some patches for that on the mailing 
list about a month ago but they weren't quite complete
[17:51] <mbiebl> Well, the way we currently handle it, is to not write 
/etc/resolv.conf in NM if resolvconf is installed.
[17:52] <mbiebl> In addition, we added a patch to call dhclient-script, 
so the hooks are run, and resolvconf can do it's work.
[17:52] <mbiebl> The information is passed to resolvconf via the 
dchlient hook
[17:52] <mbiebl> (information, i.e. dns server, dns search etc)
[17:53] <dcbw> mbiebl: the problem with that is that NM combines the 
info you get from DHCP with any of the user's overrides, so if you do 
stuff from dhclient hooks you wont' get the actual DNS info that NM 
wants to set
[17:53] <dcbw> mbiebl: we should be having NM talk to resolvconf
[17:53] <mbiebl> Yeah, that would be the best solution
[17:53] <mbiebl> But what about other hooks.
[17:53] <mbiebl> atm they are completely ignored when NM is used.
[17:54] <dcbw> mbiebl: what other hooks do we need?
[17:54] <dcbw> mbiebl: you're talking about general dhclient hooks, right?
[17:54] <mbiebl> yeah
[17:55] <mbiebl> e.g. in Debian samba installs a dhclient hook
[17:55] <dcbw> mbiebl: what the heck for?
[17:55] <mbiebl> or ntpdate
[17:55] <dcbw> mbiebl: lots of this stuff should be done from dispatcher 
scripts insteda
[17:55] <dcbw> mbiebl: like ntpdate or whatever
[17:55] <dcbw> mbiebl: because if not, it'll ignore the custom stuff the 
user might set
[17:56] <mbiebl> http://pastebin.ca/1055807
[17:56] <dcbw> mbiebl: but to enable that completely, we do need to have 
NM provide the info that DHCP sent back
[17:56] <mbiebl> that is the samba dhclient-enter hook
[17:58] <dcbw> mbiebl: yeah, that just looks like it updates the samba 
wins servers and such
[17:58] <dcbw> mbiebl: better done from a dispatcher script once the 
interface is completely brought up
[17:59] <mbiebl> what about other events, like rebind, expire.
[17:59] <mbiebl> such stuff won't be available via the dispatcher, right?
[18:01] <dcbw> mbiebl: depends on what the stuff is that needs 
rebind/expire, though NM will send out signals when the DHCP information 
changes via the DHCP interface that will provide all the rest of the 
info DHCP sent back
[18:06] <mbiebl> how would you hook up resolvconf then?
[18:06] <mbiebl> at the places within NM, where we write/update resolv.conf
[18:07] <dcbw> mbiebl: resolvconf just handles /etc/resolv.conf
[18:07] <mbiebl> pass the information to resolvconf directly (via env 
variables)
[18:07] <dcbw> mbiebl: that's pretty easy to hook up into NM
[18:07] <mbiebl> and don't write /etc/resolv.conf within NM
[18:07] <dcbw> mbiebl: I don't know how resolvconf works, really, but 
whatever way that other stuff ends up giving info to resolvconf
[18:07] <dcbw> mbiebl: yeah
[18:07] <dcbw> lets pile on the scripthacks
[18:10] <mbiebl> well, the dhcp info is passed to resolvconf via the 
dhclient hook resp. an ifupdown hook (for static ip config)
[18:11] <dcbw> mbiebl: I don't really see an issue with that... whenever 
NM needs to update resolv.conf it would pass the DNS servers and search 
domains to resolvconf
[18:13] <mbiebl> what about the configuration that is set within resolvconf?
[18:13] <mbiebl> we would somehow have to pass this info back to NM
[18:14] <dcbw> mbiebl: what gets set within resolvconf?
[18:14] <mbiebl> e.g. you can set a search domain or dns server in the 
resolvconf config files.
[18:15] <dcbw> mbiebl: I choose to ignore that :)
[18:15] <mbiebl> this info is e.g. merged with the information provided 
by the dhcp server
[18:16] <dcbw> mbiebl: basically, there's 50 places to set the same 
stuff (resolvconf config, dhclient hooks, dhclient.conf) and some of 
them just won't be used because we can't make everything update 
everything else
[18:16] <dcbw> mbiebl: in that case, resolvconf and NM will simply have 
different ideas; you can pick to either set the stuff in NM's config, or 
ignore NM's config and set the stuff in resolvconf config
[18:18] <dcbw> mbiebl: if resolvconf is going to insist on being the 
bottom layer, there's not much NM can do about that
[18:18] <dcbw> mbiebl: same problem with dhclient hooks right now, if 
you override the DHCP stuff from dhclient hooks or dhclient.conf, 
resolvconf will just override it again
[18:19] <dcbw> too many places for the same config, but welcome to Linux
[18:22] <mbiebl> Well, the problem is, that NM and resolvconf overlap in 
functionality  (at least in 0.7)
connection).
[18:22] <dcbw> mbiebl: yup
[18:23] <mbiebl> another possibility would be, to not call resolvconf 
directly
[18:23] <mbiebl> but only use it's configuration
[18:24] <mbiebl> (a bit like the nm-system-settings service)
[18:24] <dcbw> mbiebl: the system settings plugin for debian could 
certainly parse the resolvconf config and use that to override whatever 
it wanted to
[18:24] <dcbw> mbiebl: it would just replace the stuff in each system 
connection with the resolvconf info, but that wouldn't affect user 
connections
[18:25] <mbiebl> hm
[18:25] <mbiebl> would be a possibilty



Cheers,
Michael

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-utopia-maintainers/attachments/20080625/2971b4b7/attachment.pgp 


More information about the Pkg-utopia-maintainers mailing list