Re: /run and read-only /etc
Emile's design looks good. One great thing about it is
that it puts an end the insanity of all and sundry programs
overwriting /etc/resolv.conf!
An example
=---------
/run/resolvers/eth0 Created by the DHCP client process that
has configured interface eth0.
"resolv.conf"-formatted info for eth0
/run/resolvers/ppp0 Created by the pppd process that has
created ppp0.
"resolv.conf"-formatted info for ppp0
...
/etc/resolvers/default Included in base-files
Generates /run/resolv.conf which is a
composite of the above files. The local
admin can link /etc/resolv.conf to that file
if s/he doesn't run a local DNS cache.
/etc/resolvers/named Included in bind package
Generates /run/bind/named.conf.forwarders
which is a "forwarders { ... }" statement
listing all nameserver addresses listed in
in the files above. Then reloads named.
The admin can include this file inside the
"options { ... }" statement in named.conf.
/etc/resolvers/dnscache Included in djbdns package
Does appropriate stuff to configure and
notify dnscache.
...
/sbin/update-resolvers Does a run-parts on /etc/resolvers
Is called by ifup/ifdown, pon/poff.
Notes
=----
* DHCP clients would have to be modified to write files under /run.
Pump, for example, currently writes to /etc/resolv.conf.
* Question: Must this stuff be in /run or could it be elsewhere?
On Tue, 2003-04-08 at 09:27, Emile van Bergen wrote:
> Hi,
>
> On Tue, Apr 08, 2003 at 08:36:01AM +0200, Thomas Hood wrote:
>
> > However, allowing programs to write bits of named's
> > configuration file and to restart named still seems kludgy.
> > It would be better if there were a standard way for programs
> > to inform named of appearing and disappearing forwarders.
>
> Definitely, or even better, to inform any local cache of appearing and
> disappearing forwarders.
>
> The only thing that's to know about a set of forwarders is its IP
> addresses. /etc/resolv.conf provides a widely used, simple and easy to
> parse format for that.
>
> If we'd have a /run/resolvers/ directory in which each network
> interface could have a file with its own name (eth0, eth1, ppp0) in
> full resolv.conf format, then pump, dhcpcd, pppd and ifup/down (in case of
> static information from network/interfaces) could create such a file for
> the interface they are controlling.
>
> A update-resolvers script that gets called as soon as new resolver
> information becomes available then merges the information from the files
> in /run/resolvers (creating a longer suffix search path and a long list
> of ip addresses), and either writes a new /run/resolv.conf to which
> /etc/resolv.conf can be a symlink, or writes a piece of named
> configuration, or a piece of djbdns configuration, or whatever, and
> possibly sends a signal, or does anything else that's needed.
>
> Then, every DNS cache can do this in its own way and provide its own
> version of the update-resolvers script; if you're not running one, you
> could have a simple package that contains the simple script to merge the
> files into /run/resolv.conf. Or a yet simpler version that always
> symlinks /etc/resolv.conf to /run/resolvers/eth0, if it's not desired
> that other interfaces add to the list.
>
> How about that?
>
> Cheers,
>
>
> Emile.
--
Thomas Hood <jdthood0@yahoo.co.uk>
Reply to: