Date: Sun, 21 Mar 1999 22:12:03 -0500 (EST) From: John Baldwin <jobaldwi@vt.edu> To: "Jordan K. Hubbard" <jkh@zippy.cdrom.com> Cc: freebsd-current@freebsd.org Subject: RE: /etc/rc.conf, take 46! Message-ID: <XFMail.990321221203.jobaldwi@vt.edu> In-Reply-To: <39218.922068401@zippy.cdrom.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <jobaldwi@vt.edu> -- 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.990321221203.jobaldwi>