Skip site navigation (1)Skip section navigation (2)
Date:      25 Mar 2000 10:37:55 -0000
From:      adrian@creative.net.au
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   conf/17595: Preventing cp /etc/defaults/rc.conf /etc/rc.conf from looping
Message-ID:  <20000325103755.10128.qmail@ewok.creative.net.au>

next in thread | raw e-mail | index | archive | help

>Number:         17595
>Category:       conf
>Synopsis:       Preventing cp /etc/defaults/rc.conf /etc/rc.conf from looping
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 25 02:40:02 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Adrian Chadd
>Release:        FreeBSD 3.4-STABLE i386
>Organization:
>Environment:

a 3.4-STABLE and 5.0-CURRENT box

>Description:


I'm sick of people cp /etc/defaults/rc.conf /etc/rc.conf and
complaining about being out of file descriptors during boot.
This will let people do that silly thing, and it will stop
them from trashing their box.

>How-To-Repeat:

cp /etc/defaults/rc.conf /etc/rc.conf
reboot

>Fix:
	


Here's a patch against v1.53 of rc.conf . It might
be a good idea to insert an echo or two to give the
user a big warning.


--- /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
 

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000325103755.10128.qmail>