From owner-freebsd-arch Sun Nov 28 1:21:59 1999 Delivered-To: freebsd-arch@freebsd.org Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (Postfix) with ESMTP id 2F07014A15 for ; Sun, 28 Nov 1999 01:21:53 -0800 (PST) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.3/8.9.3) with ESMTP id KAA19442 for ; Sun, 28 Nov 1999 10:21:50 +0100 (CET) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id KAA56800 for freebsd-arch@freebsd.org; Sun, 28 Nov 1999 10:21:48 +0100 (MET) Received: from peach.ocn.ne.jp (peach.ocn.ne.jp [210.145.254.87]) by hub.freebsd.org (Postfix) with ESMTP id 1F799155EA; Sun, 28 Nov 1999 01:20:11 -0800 (PST) (envelope-from dcs@newsguy.com) Received: from daniel.sobral (root@p17-dn03kiryunisiki.gunma.ocn.ne.jp [210.232.224.146]) by peach.ocn.ne.jp (8.9.1a/OCN) with ESMTP id SAA22043; Sun, 28 Nov 1999 18:20:05 +0900 (JST) Received: (from dcs@localhost) by daniel.sobral (8.9.1/8.9.3) id SAA00334; Sun, 28 Nov 1999 18:17:33 +0900 (JST) (envelope-from dcs) From: "Daniel C. Sobral" Message-Id: <199911280917.SAA00334@daniel.sobral> Subject: rc.conf To: jkh@freebsd.org Date: Sun, 28 Nov 1999 18:17:33 +0900 (JST) Cc: freebsd-arch@freebsd.org Disclaimer: Klaatu Barada Nikto! X-Mailer: ELM [version 2.4ME+ PL43 (25)] 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 [on an afterthough, I decided to cc this to -arch -- it concerns a library that handles reading/modification of rc.conf-like files] I'm thinking about the library. Right now, I have a readconf() function that the application must use for each file (as per the libconf.h I sent you :), and the app must provide the logic for multiple files itself. Ie, if it must read /etc/defaults/rc.conf first, and then read the files in one of it's variables in turn, the app should know that itself. So I was thinking in providing a readrcconf() and readloaderconf() functions that would have this logic builtin. On the plus side, if we change the logic, we don't need to change any other application, just the library (well, and all other script-type applications that source it :( ). On the negative side, if we changed the logic, and the person made world but not updated /etc, the library would be working with the new logic and the rc files would be working with the old one, with possible adverse effects. That's one thing, and it led me to consider another thing. Right now, the logic for reading rc.conf files is inside /etc/defaults/rc.conf, with some of it on each script sourcing it to allow for no /etc/defaults/rc.conf (we should remove this allowance now in 4.0, just like phk is removing all legacy garbage, btw). I was thinking in writing a small script containing that logic. Eg: #!/bin/sh if [ x$1 == xv ]; then echo /etc/defaults/rc.conf fi . /etc/defaults/rc.conf for i in ${rc_conf_files}; do if [ -f $i ]; then if [ x$1 == xv ]; then echo $i fi . $i fi done So instead of . /etc/defaults/rc.conf, one would do . /etc/sourcercconf instead. Also, applications that need to do their own sourcing could exec /etc/sourcercconf -v, and get the list of files they need to source. Any change in the logic would be restricted to that. How's that? -- Daniel C. Sobral (8-DCS) dcs@newsguy.com dcs@freebsd.org Udall's Fourth Law: Any change or reform you make is going to have consequences you don't like. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message