Subject: Re: Updating /etc...
To: Michael Graff <explorer@flame.org>
From: Luke Mewburn <lukem@telstra.com.au>
List: current-users
Date: 12/19/1995 19:01:30
Michael Graff writes:
> I know this issue was brought up about 6 months ago, and I have read
> through the logs, but I believe it is time to discuss it again.
> What do people think about an /etc/init.d/ file, either with or
> without run levels? I think run levels are mostly useless, but others
> will certainly disagree. I would consider writing an /etc/init.d
> startup method if there was interest. I really think the
> /etc/rc.local method is just plain archaic, and each package SHOULD
> have its own startup/shutdown script.
Another similar issue - variety of different files to configure your
system.
The current way under netbsd that you have to edit the following files
under /etc/ to modify networking is ludicrious:
myname, defaultdomain, mygate, netstart, hostname.*
Under ULTRIX we use a file, /etc/rc.conf, which has a lot of environment
variables defined (e.g, DOMAINNAME, HOSTNAME, etc.etc.) The various
rc* files then setup stuff from there. I think that OSF/1 has a
similar system.
For example, you could replace /etc/hostname.*, myname, defaultdomain,
mygate, etc with the following variables in rc.conf:
---
HOSTNAME=shelob
DOMAINNAME=lair.werj.com.au
DEFAULT_ROUTER=192.168.4.1
INTERFACES="ed0 lo1"
INTERFACE_ed0="inet shelob 0xffffffc0"
INTERFACE_lo1="inet 127.0.0.2"
---
Then with something like the following in /etc/rc:
---
. rc.conf
if [ "$HOSTNAME" != "" ] ; then
hostname $HOSTNAME
fi
if [ "$DOMAINNAME" != "" ] ; then
domainname $DOMAINNAME
fi
if [ "$INTERFACES" != "" ] ; then
for i in $INTERFACES ; do
eval `echo 'j=$INTERFACE_'$i`
if [ "$j" != "" ] ; then
echo "Setting up $i as $j"
#
# XXX fill in stuff here
#
fi
done
fi
if [ "$DEFAULT_ROUTER" != "" ] ; then
route add default $DEFAULT_ROUTER
fi
---
/etc/ifaliases could probably be replaced with a similar method as
INTERFACES && INTERFACE_xxx
How do other people like this concept? I'm willing to go through and
fix up /etc/rc* et. al if this sounds usable by enough people.
Luke.