Date: Fri, 8 Oct 1999 13:50:01 -0700 (PDT) From: netch@lucky.net (Valentin Nechayev) To: freebsd-bugs@FreeBSD.org Subject: Re: Re: conf/13724: Prevent ".: Out of file descriptors" error on system bootup Message-ID: <199910082050.NAA25449@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR conf/13724; it has been noted by GNATS.
From: netch@lucky.net (Valentin Nechayev)
To: freebsd-gnats-submit@freebsd.org
Cc:
Subject: Re: Re: conf/13724: Prevent ".: Out of file descriptors" error on system bootup
Date: Fri, 8 Oct 1999 23:40:53 +0300 (EEST)
Imho the following variant is an example of rather more reasonable
configuration. Including file with "defaults" in name/path as full
configuration is some brain-damaged. Also, there is no reason to take
list of rc.conf files as definition in one of them.
diff -rNu src/etc.orig/defaults/rc.conf src/etc/defaults/rc.conf
--- src/etc.orig/defaults/rc.conf Sun Sep 19 16:41:30 1999
+++ src/etc/defaults/rc.conf Fri Oct 8 23:01:47 1999
@@ -1,11 +1,12 @@
#!/bin/sh
#
-# This is rc.conf - a file full of useful variables that you can set
-# to change the default startup behavior of your system. You should
-# not edit this file! Put any overrides into one of the ${rc_conf_files}
-# instead and you will be able to update these defaults later without
-# spamming your local configuration information.
+# This is /etc/defaults/rc.conf -
+# a file full of useful variables that you can set to change the default
+# startup behavior of your system. You should not edit this file!
+# Put any overrides into /etc/rc.conf or /etc/rc.conf.local instead
+# and you will be able to update these defaults later without spamming
+# your local configuration information.
#
# All arguments must be in double or single quotes.
#
@@ -25,7 +26,6 @@
pccardd_flags="" # Additional flags for pccardd.
local_startup="/usr/local/etc/rc.d /usr/X11R6/etc/rc.d" # startup script dirs.
local_periodic="/usr/local/etc/periodic /usr/X11R6/etc/periodic" # periodic script dirs
-rc_conf_files="/etc/rc.conf /etc/rc.conf.local"
##############################################################
### Network configuration sub-section ######################
@@ -219,16 +219,3 @@
start_vinum="" # set to YES to start vinum
vinum_drives="" # put in names of disks containing vinum drives
# to start vinum on only specific disks.
-
-##############################################################
-### Allow local configuration override at the very end here ##
-##############################################################
-#
-#
-
-for i in ${rc_conf_files}; do
- if [ -f $i ]; then
- . $i
- fi
-done
-
diff -rNu src/etc.orig/netstart src/etc/netstart
--- src/etc.orig/netstart Sun Sep 5 11:27:23 1999
+++ src/etc/netstart Fri Oct 8 22:37:11 1999
@@ -9,12 +9,7 @@
# the network by hand, this script will do it for you).
#
-# If there is a global system configuration file, suck it in.
-if [ -f /etc/defaults/rc.conf ]; then
- . /etc/defaults/rc.conf
-elif [ -f /etc/rc.conf ]; then
- . /etc/rc.conf
-fi
+. /etc/rc.getconf
if [ -f /etc/rc.network ]; then
. /etc/rc.network
diff -rNu src/etc.orig/pccard_ether src/etc/pccard_ether
--- src/etc.orig/pccard_ether Sun Sep 5 11:27:23 1999
+++ src/etc/pccard_ether Fri Oct 8 22:37:40 1999
@@ -7,12 +7,7 @@
# example: pccard_ether ep0 -link0
#
-# Suck in the configuration variables
-if [ -f /etc/defaults/rc.conf ]; then
- . /etc/defaults/rc.conf
-elif [ -f /etc/rc.conf ]; then
- . /etc/rc.conf
-fi
+. /etc/rc.getconf
if [ "x$pccard_ifconfig" != "xNO" ] ; then
if [ "x$pccard_ifconfig" = "xDHCP" ] ; then
diff -rNu src/etc.orig/rc src/etc/rc
--- src/etc.orig/rc Tue Sep 14 12:09:46 1999
+++ src/etc/rc Fri Oct 8 23:08:10 1999
@@ -7,9 +7,8 @@
# Output and error are redirected to console by init,
# and the console is the controlling terminal.
-# Note that almost all the user-configurable behavior is no longer in
-# this file, but rather in /etc/defaults/rc.conf. Please check this file
-# first before contemplating any changes here.
+# Check /etc/defaults/rc.conf, /etc/rc.conf and /etc/rc.conf.local
+# before contemplating any changes here.
stty status '^T'
@@ -34,11 +33,7 @@
# If there is a global system configuration file, suck it in.
#
-if [ -f /etc/defaults/rc.conf ]; then
- . /etc/defaults/rc.conf
-elif [ -f /etc/rc.conf ]; then
- . /etc/rc.conf
-fi
+. /etc/rc.getconf
# Configure ccd devices.
if [ -f /etc/ccd.conf ]; then
@@ -375,7 +370,8 @@
# Else send mail to the user.
recfile=`awk '/^X-vi-recover-path:/{print $2}' < $i`
if test -n "$recfile" -a -s "$recfile"; then
- sendmail -t < $i
+ "${sendmail_program:-/usr/sbin/sendmail}" \
+ -oi -t < $i
else
rm -f $i
fi
@@ -414,22 +410,21 @@
[ -f /etc/rc.devfs ] && sh /etc/rc.devfs
# Do traditional (but rather obsolete) rc.local file if it exists. If you
-# use this file and want to make it programmatic, source /etc/defaults/rc.conf
-# in /etc/rc.local and add your custom variables to /etc/rc.conf, as
+# use this file and want to make it programmatic, source /etc/rc.getconf
+# in /etc/rc.local and add your custom variables to /etc/rc.conf.local, as
# shown below. Please do not put local extensions into /etc/rc itself.
# Use /etc/rc.local
#
# ---- rc.local ----
-# if [ -f /etc/defaults/rc.conf ]; then
-# . /etc/defaults/rc.conf
-# fi
+# . /etc/rc.getconf
#
# ... additional startup conditionals ...
# ---- rc.local ----
#
-if [ -f /etc/rc.local ]; then
- echo -n 'starting local daemons:'
- sh /etc/rc.local
+if [ -f /etc/rc.local -o -f /usr/local/etc/rc.local ]; then
+ echo -n 'starting local daemons: '
+ [ -f /etc/rc.local ] && sh /etc/rc.local
+ [ -f /usr/local/etc/rc.local ] && sh /usr/local/etc/rc.local
echo '.'
fi
diff -rNu src/etc.orig/rc.devfs src/etc/rc.devfs
--- src/etc.orig/rc.devfs Sun Sep 5 11:27:25 1999
+++ src/etc/rc.devfs Fri Oct 8 22:47:14 1999
@@ -1,12 +1,8 @@
#
# $FreeBSD: src/etc/rc.devfs,v 1.3.2.2 1999/08/29 14:18:55 peter Exp $
#
-# If there is a global system configuration file, suck it in.
-if [ -f /etc/defaults/rc.conf ]; then
- . /etc/defaults/rc.conf
-elif [ -f /etc/rc.conf ]; then
- . /etc/rc.conf
-fi
+
+. /etc/rc.getconf
# Setup DEVFS, ie permisisons, links etc.
diff -rNu src/etc.orig/rc.diskless2 src/etc/rc.diskless2
--- src/etc.orig/rc.diskless2 Tue Mar 9 19:04:40 1999
+++ src/etc/rc.diskless2 Fri Oct 8 22:48:46 1999
@@ -1,13 +1,7 @@
# rc.diskless2
#
-# If there is a global system configuration file, suck it in.
-#
-if [ -f /etc/defaults/rc.conf ]; then
- . /etc/defaults/rc.conf
-elif [ -f /etc/rc.conf ]; then
- . /etc/rc.conf
-fi
+. /etc/rc.getconf
mount_mfs -s ${varsize:=65536} -T qp120at dummy /var
var_dirs="run dev db msgs tmp spool spool/mqueue spool/lpd spool/output \
diff -rNu src/etc.orig/rc.firewall src/etc/rc.firewall
--- src/etc.orig/rc.firewall Sun Oct 3 12:12:27 1999
+++ src/etc/rc.firewall Fri Oct 8 22:49:41 1999
@@ -2,15 +2,11 @@
# Setup system for firewall service.
# $FreeBSD: src/etc/rc.firewall,v 1.19.2.3 1999/09/30 04:56:27 mpp Exp $
-# Suck in the configuration variables.
-if [ -f /etc/defaults/rc.conf ]; then
- . /etc/defaults/rc.conf
-elif [ -f /etc/rc.conf ]; then
- . /etc/rc.conf
-fi
+. /etc/rc.getconf
############
-# Define the firewall type in /etc/rc.conf. Valid values are:
+# Define the firewall type in /etc/rc.conf or /etc/rc.conf.local.
+# Valid values are:
# open - will allow anyone in
# client - will try to protect just this machine
# simple - will try to protect a whole network
diff -rNu src/etc.orig/rc.getconf src/etc/rc.getconf
--- src/etc.orig/rc.getconf Thu Jan 1 03:00:00 1970
+++ src/etc/rc.getconf Fri Oct 8 23:06:51 1999
@@ -0,0 +1,14 @@
+# rc.getconf - compose configuration from defaults, central and local file.
+# $Id$
+
+for FILE in \
+ /etc/defaults/rc.conf \
+ /etc/rc.conf \
+ /etc/rc.conf.local \
+ /usr/local/etc/rc.conf \
+ /usr/local/etc/rc.conf.local
+do
+ if [ -f "$FILE" ] ; then
+ . "$FILE"
+ fi
+done
diff -rNu src/etc.orig/rc.network src/etc/rc.network
--- src/etc.orig/rc.network Sat Sep 25 23:23:24 1999
+++ src/etc/rc.network Fri Oct 8 22:50:20 1999
@@ -4,7 +4,7 @@
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# Note that almost all the user-configurable behavior is no longer in
-# this file, but rather in /etc/rc.conf. Please check that file
+# this file, but rather in /etc/[defaults/]rc.conf.*. Please check that file
# first before contemplating any changes here. If you do need to change
# this file for some reason, we would like to know about it.
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?199910082050.NAA25449>
