From owner-freebsd-arch Mon Feb 19 17:23:10 2001 Delivered-To: freebsd-arch@freebsd.org Received: from smtp05.primenet.com (smtp05.primenet.com [206.165.6.135]) by hub.freebsd.org (Postfix) with ESMTP id 7754337B4EC for ; Mon, 19 Feb 2001 17:23:06 -0800 (PST) Received: (from daemon@localhost) by smtp05.primenet.com (8.9.3/8.9.3) id SAA29852; Mon, 19 Feb 2001 18:18:01 -0700 (MST) Received: from usr05.primenet.com(206.165.6.205) via SMTP by smtp05.primenet.com, id smtpdAAA85a4q6; Mon Feb 19 18:17:54 2001 Received: (from tlambert@localhost) by usr05.primenet.com (8.8.5/8.8.5) id SAA04466; Mon, 19 Feb 2001 18:22:54 -0700 (MST) From: Terry Lambert Message-Id: <200102200122.SAA04466@usr05.primenet.com> Subject: Re: DJBDNS vs. BIND To: dillon@earth.backplane.com (Matt Dillon) Date: Tue, 20 Feb 2001 01:22:53 +0000 (GMT) Cc: bright@wintelcom.net (Alfred Perlstein), tlambert@primenet.com (Terry Lambert), josb@cncdsl.com, arch@FreeBSD.ORG In-Reply-To: <200102191829.f1JIT6l37371@earth.backplane.com> from "Matt Dillon" at Feb 19, 2001 10:29:06 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > :> cached state data is inherently bad everywhere, not just in DNS > :> servers. > : > :You scare me, I was thinking just the same thing about mountd > :earlier today. Only problem is that it violates POLA(* heh), one > :could offer an command line option to have it watch the file. > > I was thinking just having a 'mountd -reload'. I don't like the > idea of programs polling configuration files. I actually used a > similar mechanism in Diablo and wound up having to add hacks to, > for example, try to avoid catching a configuration file in the middle > of being written out by an editor. > > A better way would be to take the 'vipw' concept and write a general > system utility to edit configuration files that does the right thing > when you write the config file out (heh heh... based on.... another > config file!). You could close the file in between polls, and reopen it O_EXCL; or your vipw suggestion would also work, using a two stage commit to ensure that it was all or nothing for changes. Really, the program wants to sit on the file as part of its select loop, and when the file is closed so that it's the sole opener again, get an "exceptional condition" flagged in the select. Barring that, the next best thing is a signal, and the next best after that is a poll. The problem that needs to be addressed is the cached state which is no longer valid, but which has been cached on the basis of having read the configuration file. Sendmail has areas where there are similar problems on configuration changes (for example, it caches the name that it believes it is on startup, so if you change the host name in the DNS, it claims to be the old name, until it is restarted; similarly, it must be HUP'ed for a number of configuration file changes. Some of these can be worked around by using text files instead of databases, some can't). The inetd problem isn't isolated, it's just pretty glaring; the mountd one is too, but it's really hard to deal with, since there are ugly hooks for the FS exporting down in the VFS code, and managed per FS in the per FS mount code. This is really broken in BSD; SunOS, a long time ago, fixed this with the "exportfs" utility, and communicated the data to the kernel NFS server directly. In an ideal system, you would change the host name one place (for an example of commonly cached information), and everything would "just know" and "just do the right thing". Having an external program watching the configuration file changes is really a very poor approach, since it doesn't address the underlying problem very well. Windows tried to handle this for the most part by putting their registry interface into their kernel (the registry, the cache, and the dynamic portion of the registry tree are all wrapped up in a VXD). Unfortunately, they ended up doing a vast thing in a half-vast way (8-)), and still kept config.sys, autoexec.bat, and a bunch of .INI files, at the same time. A registry-like configuration store, which was cached by the OS, and was referenced directly each time the data was needed, instead of allowing the programs to cache data which might change would really be the best approach, but I rather think that it would be rejected because Microsoft had the idea. Heh. A new way to screw over your competitors: make them so hateful that they refuse to learn from your good ideas, and have to come up with something gratuitously different (and probably more complicated) just to be able to say that they aren't like you... Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message