From owner-freebsd-bugs Sat Mar 25 2:40: 7 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id E057E37B658 for ; Sat, 25 Mar 2000 02:40:03 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id CAA47238; Sat, 25 Mar 2000 02:40:04 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from ewok.creative.net.au (ewok.creative.net.au [203.30.44.41]) by hub.freebsd.org (Postfix) with SMTP id 3718D37B52F for ; Sat, 25 Mar 2000 02:38:28 -0800 (PST) (envelope-from adrian@creative.net.au) Received: (qmail 10129 invoked by uid 1001); 25 Mar 2000 10:37:55 -0000 Message-Id: <20000325103755.10128.qmail@ewok.creative.net.au> Date: 25 Mar 2000 10:37:55 -0000 From: adrian@creative.net.au Reply-To: adrian@creative.net.au To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: conf/17595: Preventing cp /etc/defaults/rc.conf /etc/rc.conf from looping Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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