From owner-freebsd-stable Wed Sep 22 12:31:38 1999 Delivered-To: freebsd-stable@freebsd.org Received: from axl.noc.iafrica.com (axl.noc.iafrica.com [196.31.1.175]) by hub.freebsd.org (Postfix) with ESMTP id 585F214C9C for ; Wed, 22 Sep 1999 12:31:24 -0700 (PDT) (envelope-from sheldonh@axl.noc.iafrica.com) Received: from sheldonh (helo=axl.noc.iafrica.com) by axl.noc.iafrica.com with local-esmtp (Exim 3.02 #1) id 11Ts5Q-0000S4-00; Wed, 22 Sep 1999 21:29:52 +0200 From: Sheldon Hearn To: John Reynolds~ Cc: Lev Serebryakov , stable@FreeBSD.ORG Subject: Re: New 3.3-STABLE: out of file descriptors In-reply-to: Your message of "Wed, 22 Sep 1999 12:14:30 MST." <14313.10902.471184.356967@hip186.ch.intel.com> Date: Wed, 22 Sep 1999 21:29:52 +0200 Message-ID: <1739.938028592@axl.noc.iafrica.com> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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. Ciao, Sheldon. Index: rc.conf =================================================================== RCS file: /home/ncvs/src/etc/defaults/rc.conf,v retrieving revision 1.37 diff -u -d -2 -r1.37 rc.conf --- rc.conf 1999/09/22 06:31:32 1.37 +++ rc.conf 1999/09/22 09:59:45 @@ -8,4 +8,9 @@ # spamming your local configuration information. # +# A common mistake is to copy the contents of this file into one of the +# ${rc_conf_files} files (e.g. /etc/rc.conf). That does not work, because +# this file ends up recursing on itself. The ${rc_conf_files} files should +# only contain values which override values set in this file. +# # All arguments must be in double or single quotes. # @@ -233,8 +238,17 @@ # +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 - To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message