From owner-freebsd-current Sun Mar 21 19:12:29 1999 Delivered-To: freebsd-current@freebsd.org Received: from quackerjack.cc.vt.edu (quackerjack.cc.vt.edu [198.82.160.250]) by hub.freebsd.org (Postfix) with ESMTP id 61FEC14C24 for ; Sun, 21 Mar 1999 19:12:23 -0800 (PST) (envelope-from jobaldwi@vt.edu) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id WAA18587; Sun, 21 Mar 1999 22:12:03 -0500 (EST) Received: from john.baldwin.cx (jobaldwi.campus.vt.edu [198.82.67.63]) by sable.cc.vt.edu (8.8.8/8.8.8) with ESMTP id WAA23015; Sun, 21 Mar 1999 22:12:02 -0500 (EST) Message-ID: X-Mailer: XFMail 1.3 [p0] on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <39218.922068401@zippy.cdrom.com> Date: Sun, 21 Mar 1999 22:12:03 -0500 (EST) From: John Baldwin To: "Jordan K. Hubbard" Subject: RE: /etc/rc.conf, take 46! Cc: freebsd-current@freebsd.org Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 22-Mar-99 Jordan K. Hubbard wrote: > OK, so it seems everyone's found something to like and dislike about > the new scheme. In that regard, it seems pretty much equivalent to > the previous layout when that was first introduced. :) If it makes you feel any better, I kind of like the new system with the default setup in /etc/defaults and the customizations/overrides in /etc. Makes perfect sense to me and works well. I don't really care where the functionality of sucking in the configuration files is, but the obvious point seems to be that having the code duplicated in about six different places will make maintaining it a pain. Maybe a compromise would be to include a function in /etc/defaults/rc.conf that is called everywhere else so that at least you only have to change one function. IOW, /etc/defaults/rc.conf have: suck_in_files() { for i in ${rc_conf_files}; do if [ -f $i ]; then . $i fi done } And just have all the various files you had to patch below do the following: if [ -f /etc/defaults/rc.conf ]; then . /etc/defaults/rc.conf suck_in_files fi I guess it's still including "code" in /etc/rc.conf, but it doesn't execute it. So, if Joe Schmoe copies /etc/defaults/rc.conf to /etc/rc.conf it will still work. Actually, after some testing, this can be broken. If suck_in_files() is redefined in the included files there are weird side effects, ranging from seg faults to working properly to the function changing mid-stream. Then you could I suppose define _another_ file in /etc or /etc/defaults that defined suck_in_files() and other similar functions so that the if-statement above would become: if [ -f /etc/defaults/rc.conf ]; then . /etc/defaults/rc.conf . /etc/defaults/rc.functions suck_in_files fi Bleah.. Why can't we assume users can read and hold them accountable to that? At the very beginning of /etc/defaults/rc.conf it tells them that they shouldn't copy it to /etc/rc.conf. If they are too stubborn to do as they are told, they should either a) be using /stand/sysinstall, or b) be willing to accept the consequences. --- John Baldwin -- http://members.freedomnet.com/~jbaldwin/ PGP Key: http://members.freedomnet.com/~jbaldwin/pgpkey.asc To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message