Subject: Re: Updating /etc...
To: Luke Mewburn <lukem@telstra.com.au>
From: Michael Graff <explorer@flame.org>
List: current-users
Date: 12/19/1995 02:19:03
>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.

This is the method I use on my NetBSD machine.  It does not address
two issues, which my /etc/config/pkg/ method does:

1)  adding, removing, and upgrading packages.
2)  disaster recovery

Adding something new is trivial.  Upgrading or removing a package is
much easier with seperate, per package files.

I propose using this method, where my suggestion of
/etc/config/network/config would be the Ultrix /etc/rc.conf (network
specific) and /etc/config/network/start would ne the /etc/rc.local
part for network startup.

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

I've done it several years ago.  Here is what I use now.  Note that
this is what each DIRECTORY in my proposed method would be like, more
or less, with some sort of scheme to order what starts when.

/etc/rc.conf:

#  This file is sourced by /etc/rc to set various shell variables for local
#  machine configuration.  This is specific to a machine, while the other
#  rc.* files should be written in such a way to allow them to be shared and
#  automatically updated by rdist or sup where appropriate.
#
#  Michael Graff <explorer@flame.org>

# These set the hostname and ip address for the primary ethernet.  If you have
# more than one internet interface, this section of this file and /etc/rc
# should be rewritten to use a different scheme for configuration.
HOSTIF=ed0
HOSTNAME=darkwatch.flame.org
HOSTIP=129.186.82.10
NETMASK=0xffffff00
NETLINKOPTS=link0
MYGATE=129.186.82.254
DOMAINNAME=flame.org

#  Set this to ``YES'' if you want the /etc/motd file on the machine to be
#  fiddled with in a rather disgusting way.  (see /etc/rc.vorpal)
MUNGEMOTD=YES

#  Standard printer, name, rwho, rwall, and time daemons.
LPD=YES
NAMED=NO
RWHOD=NO
RWALLD=NO
TIMED=NO
TIMEDFLAGS=""

#  Do we run a Zephyr stuff?  Do we have a specific Zephyr host to use?
ZEPHYRD=NO
ZHM=YES
ZEPHYRHOST=vs-2.iastate.edu

#  Run a Kerberos server
KERBEROS=NO

#  The mailhubs run a popd, unless kpop is used.  kpop is started from inetd.
POPD=NO

#  If GATED is set, then gated is run.  Otherwise, if routed is set, then it
#  is used.
GATED=NO
GATEDFLAGS=
ROUTED=NO
ROUTEDFLAGS=-q

#  Are we a NFS server, client, or both?
NFSSERVER=YES
NFSCLIENT=YES
#NFSHOME=penguin:/home
#NFSHOME=
#NFSUSR=packrat.vorpal.com:/usr

# AMD stuff.  Needs work still...
AMD=YES

#  Not sure what the hell this does, but I don't think we want it.
YPBIND=NO

# SUP stuff.  do we want to run supfilesrv?
SUPSERVE=NO

# INN, for the NetNews Thang
INND=NO

# HTTPD: run a WWW server
HTTPD=YES

# CallerID: run experimental CallerID daemon
CALLERID=NO

RARPD=NO
BOOTPARAMD=NO

# AFS:  start afs daemons
AFS=YES

# Samba services
SAMBA=YES

And here is /etc/rc.local

#
# domain-specific startup actions, daemons
#

[ "$MUNGEMOTD" = "YES" ] && {
	T=/tmp/_motd
	rm -f $T
	if [ -f /kern/version ]; then
		head -1 /kern/version > $T
	else
		echo "NetBSD (UNKNOWN)" > $T
	fi
	echo "" >> $T
	sed '1,/^$/d' < /etc/motd >> $T
	cp $T /etc/motd
	chmod 666 /etc/motd
	rm -f $T
}

[ "$AFS" = "YES" -a /usr/vice/etc/rc.local.afs ] && {
	/usr/vice/etc/rc.local.afs
}

echo -n 'Starting Vorpal daemons:'

[ "$KERBEROS" = "YES" -a -f /etc/kerberosIV/principal.ok ] && {
	echo -n " kerberos";	kerberos -n > /var/log/kerberos.log 2>&1 &
#	echo -n " kpasswdd";	/usr/libexec/kpasswdd
}

[ "$ZEPHYRD" = "YES" -a -f /usr/athena/etc/zephyrd ] && {
	echo -n " zephyrd";	/usr/athena/etc/zephyrd &
}

[ "$ZHM" = "YES" -a -f /etc/athena/zhm ] && {
	rm -f /etc/athena/zhm.pid
	echo -n " zhm";		/etc/athena/zhm $ZEPHYRHOST
}

[ "$POPD" = "YES" -a -f /usr/local/lib/mh/popd ] && {
	echo -n " popd";	/usr/local/lib/mh/popd > /dev/null 2>&1
}

[ "$AMD" = "YES" -a -f /usr/sbin/amd ] && {
	echo -n " amd";		amd -x error,noinfo,nostats /home /etc/amd.home
}

[ "$SUPSERVE" = "YES" ] && {
	echo -n " supfilesrv";	/usr/local/sbin/supfilesrv > /dev/null 2>&1
}

[ "$INND" = "YES" ] && {
	echo -n " innd"; 	/usr/local/etc/rc.news
}

[ "$HTTPD" = "YES" ] && {
	echo -n " httpd";	/home/www/bin/httpd -f /home/www/conf/httpd.conf >> /home/www/logs/httpd.errors 2>&1 
}

[ "$CALLERID" = "YES" ] && {
	echo -n " callerid";	/root/bin/callerid 2>&1 &
}

[ "$BOOTPARAMD" = "YES" ] && {
	echo -n " bootparamd"; 	/usr/sbin/rpc.bootparamd ed0
}

[ "$RARPD" = "YES" ] && {
	echo -n " rarpd";	/usr/sbin/rarpd ed0
}

[ "$SAMBA" = "YES" ] && {
	echo -n " samba";	/usr/local/samba/bin/Samba.sh
}

echo '.'


--Michael

--
Michael Graff <explorer@flame.org>        NetBSD is the way to go!
PGP key on a key-server near you!         Rayshade the world!