Date: Wed, 22 Sep 1999 15:04:05 -0700 (PDT) From: Doug <Doug@gorean.org> To: Sheldon Hearn <sheldonh@uunet.co.za> Cc: John Reynolds~ <jreynold@sedona.ch.intel.com>, Lev Serebryakov <lev@imc.macro.ru>, stable@FreeBSD.ORG Subject: Re: New 3.3-STABLE: out of file descriptors Message-ID: <Pine.BSF.4.10.9909221500270.30698-100000@dt014nb6.san.rr.com> In-Reply-To: <1739.938028592@axl.noc.iafrica.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 22 Sep 1999, Sheldon Hearn wrote: > On Wed, 22 Sep 1999 12:14:30 MST, John Reynolds~ wrote: > > > didn't I see something a few weeks (months?) ago on this list > > regarding about the same thing--and the cause was a recursive include > > of /etc/rc.conf ? > > Yes. While it _is_ pilot error, we could do a little more to protect > folks against this common mistake. > > I'd love feedback on whether the following works "out in the field". I > haven't tested it too thoroughly. DON'T do this. As I told you when I sent you this code snippet it causes a lot of problems. Namely, numerous places in the rc files where /etc/defaults/rc.conf gets re-source'd, causing the code below to not look at your overrides again. There are a couple of other problems, but that's the biggest one. This problem is solvable, but it will require some reexamination of how the default and overrides files are sourced. > +rc_conf_files_done=${rc_conf_files_done:-:} > for i in ${rc_conf_files}; do > - if [ -f $i ]; then > - . $i > - fi > + case ${rc_conf_files_done} in > + *:${i}:*) > + echo WARNING: ${i} recurses on itself. > + echo Read the comments at the top of the /etc/defaults/rc.conf file. > + ;; > + *) > + rc_conf_files_done="${rc_conf_files_done}${i}:" > + if [ -r "${i}" ]; then > + . ${i} > + fi > + ;; > + esac > done -- "My mama told me, my mama said, 'don't cry.' She said, 'you're too young a man to have as many women you got.' I looked at my mother dear and didn't even crack a smile. I said, 'If women kill me, I don't mind dyin!'" - John Belushi as "Joliet" Jake Blues, "I Don't Know" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.9909221500270.30698-100000>