From owner-freebsd-bugs Sat Mar 25 3:40:14 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 801AF37B702 for ; Sat, 25 Mar 2000 03:40:08 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id DAA67735; Sat, 25 Mar 2000 03:40:08 -0800 (PST) (envelope-from gnats@FreeBSD.org) Date: Sat, 25 Mar 2000 03:40:08 -0800 (PST) Message-Id: <200003251140.DAA67735@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Doug Barton Subject: Re: conf/17595: Preventing cp /etc/defaults/rc.conf /etc/rc.conf from looping Reply-To: Doug Barton Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR conf/17595; it has been noted by GNATS. From: Doug Barton To: adrian@creative.net.au Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: conf/17595: Preventing cp /etc/defaults/rc.conf /etc/rc.conf from looping Date: Sat, 25 Mar 2000 03:30:14 -0800 adrian@creative.net.au wrote: > --- /usr/src/etc/defaults/rc.conf Thu Mar 16 10:15:20 2000 > +++ rc.conf Sat Mar 25 10:33:06 2000 > @@ -291,9 +291,13 @@ > # > # > > -for i in ${rc_conf_files}; do > - if [ -f $i ]; then > - . $i > - fi > -done > +# Anti-loop detection > +if [ "x$self_rcconf" != "xyes" ]; then > + self_rcconf="yes" > + for i in ${rc_conf_files}; do > + if [ -f $i ]; then > + . $i > + fi > + done > +fi Here's the problem with this approach. More than one script in /etc/rc* sources the rc.conf files in the process of booting. Using this approach those scripts (like rc.firewall, rc.network*, etc.) only source /etc/defaults/rc.conf when they are started, and never source the user's customizations. I have been giving this a lot of thought, and I think the correct approach would be to put a function that knows how to source the various combos of rc.conf* files (similar to the current code, or maybe exactly like it, I haven't tested it yet) at the end of /etc/defaults/rc.conf and then make each script that sources the conf files responsible for running the recursive source itself. This is a slightly less elegant solution, but it will solve this problem once and for all. I'll try to work up some patches tomorrow... Doug -- "So, the cows were part of a dream that dreamed itself into existence? Is that possible?" asked the student incredulously. The master simply replied, "Mu." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message