From owner-freebsd-stable Sat Mar 20 15:48:17 1999 Delivered-To: freebsd-stable@freebsd.org Received: from mail.westbend.net (ns1.westbend.net [209.224.254.131]) by hub.freebsd.org (Postfix) with ESMTP id EF16314E21 for ; Sat, 20 Mar 1999 15:48:03 -0800 (PST) (envelope-from hetzels@westbend.net) Received: from admin (admin.westbend.net [209.224.254.141]) by mail.westbend.net (8.8.8/8.8.8) with SMTP id RAA04876 for ; Sat, 20 Mar 1999 17:47:44 -0600 (CST) (envelope-from hetzels@westbend.net) Message-ID: <003a01be732c$0cea75c0$8dfee0d1@westbend.net> From: "Scot W. Hetzel" To: References: Subject: Re: Out of file descriptors Date: Sat, 20 Mar 1999 17:47:43 -0600 Organization: West Bend Internet MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2014.211 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG From: Mike Heffner > for i in ${rc_conf_files}; do > if [ -f $i ]; then > . $i > fi > done > > this causes a loop of reloading the same rc.conf file, which causes your > machine to soon run out of file descriptors once it's loaded several hundred > copies of itself. so if you copy your /etc/defaults/rc.conf file to > /etc/rc.conf, make sure you remove those lines. > And the fix is to put in a test that checks if we are trying to read the file that we were called from: for i in ${rc_conf_files}; do if [ $0 != $i ]; then if [ -f $i ]; then . $i fi else echo "Error: $0 isn't allowed to re-load $i." echo "Error: Please do not copy /etc/defaults/rc.conf to /etc/rc.conf" fi done When someone does copy /etc/defaults/rc.conf to /etc/rc.conf, /etc/rc.conf will detect that it is calling another copy of it's self and not load it. It will re-load all the other ${rc_conf_files}. Scot To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message