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

Re: RFC: new network config



Christian Hammers <ch@lathspell.westend.com> writes:

> Anyway I would propose to make it stable as it is now, release it
> and then wait for comments. Of course, if someone has a really good
> idea, he can either implement it himself or tell me how he done it
> before and I think about how to do it with the new scripts.

One thing that I noticed no one mentioned that can be somewhat a pain
for ppp users, or worse yet, people who are sometimes ppp, and
sometimes PCMCIA connected (i.e. laptop at home and at work), is DNS.

Dialup/ppp users can usually benefit from running bind (caching only)
to speedup name lookups, but if you configure bind to run, then when
the machine first starts up, many of the daemons (ntpdate, nfs
possibly, etc.) and everything else, until you actually connect to the
net, will hang while waiting on bind which (for some reason) can't
figure out that it has no interfaces and return immediately.

So what I did (when this used to be an issue for me) was to have two
resolv.confs:

  0$ cat /etc/host.conf.connected 
  order hosts,bind
  multi on

  0$ cat /etc/host.conf.disconnected
  order hosts
  multi on

And have /etc/init.d/bind set up like this:

    start)
        if [ ! -e /var/run/bind.ok ]
        then
          echo "Not starting DNS server (disconnected)."
          exit 0
        fi
        echo -n "Starting domain name service: named"
        start-stop-daemon --start --quiet --exec /usr/sbin/named
        echo "."        
    ;;

My (dis)connection scripts (ip-down/up) would call a script that would
symlink to the correct host.conf and either create or remove
/var/run/bind.ok depending on the situation.  I also made sure to run
that script at bootup to reset things to the disconnected state (in
case the machine had crashed or whatever).  (You don't really have to
kill bind as long as you swap the resolv.confs, but you may not want
it lying around when you're not using it.  OTOH, if you disconnect and
reconnect frequently, I suppose it might be a win to leave it up so
that it doesn't lose its cache...

Now I don't think I had a particularly elegant solution, but it might
be nice to come up with something (hopefully better) during this
network config rework.

Thanks

-- 
Rob Browning <rlb@cs.utexas.edu> PGP=E80E0D04F521A094 532B97F5D64E3930


Reply to: