Date: Sat, 20 Mar 1999 17:47:43 -0600 From: "Scot W. Hetzel" <hetzels@westbend.net> To: <freebsd-stable@FreeBSD.ORG> Subject: Re: Out of file descriptors Message-ID: <003a01be732c$0cea75c0$8dfee0d1@westbend.net> References: <XFMail.990320141056.aheffner@lakefield.net>
next in thread | previous in thread | raw e-mail | index | archive | help
From: Mike Heffner <aheffner@lakefield.net> > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?003a01be732c$0cea75c0$8dfee0d1>