When is resolv.conf written?



On a new ubuntu 8.10 virtual machine with network-manager
0.7~~svn20081018t105859-0ubuntu1 installed, I have added
a /etc/NetworkManager/dispatcher.d/ script.

The purpose of this script is to edit the /etc/resolv.conf
and add items to the search directive when an interface
comes up. [I'd love to add the proper search directive to
the DHCP server, but the dhcp protocol doesn't support
search list info].

The script is indeed invoked (I added commands to log args
and environment to a file). It also successfully edits the
/etc/resolv.conf file to produce exactly what I want.

Then, out of the blue, sometimes as much as two or three
minutes later, the /etc/resolv.conf file gets written
again and reverted to the original contents with no
extra domains in the search directive. The dispatcher
script is NOT invoked for this overwrite.

Is NetworkManager re-writing resolv.conf every time
the lease is renewed or something? Can we get a dispatch
event for that?

Am I going to have to write a daemon that uses inotify
to wakeup when resolve.conf gets written and fix it
again?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]