Subject: Re: Not quite sure where to send this
To: Martin Husemann <martin@duskware.de>
From: Greywolf <greywolf@starwolf.com>
List: tech-userlevel
Date: 08/16/2002 11:27:07
Martin, danke!
I'm going over the problem, and it seems there are several other
scripts in /etc/rc which could trigger this behaviour. I'm not so
sure that doing this going forward is such a hot idea. It's prone
to frailty (downinterfaces is a perfect example of this).
I have a question:
rc_fast_and_loose's purpose is to avoid spawning a subshell for each
script. Is this measure done in order to avoid the overhead associated
with the fork(), or is it to avoid the constant re-reading of rc.conf?
If it's not done already (I'm going to go look), why not just surround
the ". /etc/rc.conf" with
+ set -a
. /etc/rc.conf
+ set +a
in order to make the variables from rc.conf visible to the subshells?
This will eliminate much of the overhead which was dreaded. It won't
help with the overhead of fork()/exec(), but considering what gets run
inside the scripts anyway, I think one fork()/exec() extra per script
isn't going to kill us, even on a slow machine.
The idea, as I understand it, was that rc.conf should only ever need
to be read once.
On Fri, 16 Aug 2002, Martin Husemann wrote:
# Date: Fri, 16 Aug 2002 20:05:59 +0200
# From: Martin Husemann <martin@duskware.de>
# To: Greywolf <greywolf@starwolf.com>
# Cc: tech-userlevel@netbsd.org
# Subject: Re: Not quite sure where to send this
#
# > FIX #1:
# > Somehow fix /etc/rc.d/downinterfaces to handle this more
# > gracefully.
#
# Done.
#
--*greywolf;
--
NetBSD: Get Over It.