1993-06-20 13:41:45 +00:00
|
|
|
#!/bin/sh -
|
|
|
|
#
|
1995-04-11 01:22:24 +00:00
|
|
|
# $Id: netstart,v 1.26 1995/04/09 09:54:41 rgrimes Exp $
|
1993-11-07 01:19:06 +00:00
|
|
|
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
|
1993-06-20 13:41:45 +00:00
|
|
|
|
1995-04-11 01:22:24 +00:00
|
|
|
# If there is a global system configuration file, suck it in.
|
|
|
|
if [ -f /etc/sysconfig ]; then
|
|
|
|
. /etc/sysconfig
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Set the host name if it is not already set
|
1994-11-02 23:50:54 +00:00
|
|
|
if [ -z "`hostname -s`" ] ; then
|
|
|
|
hostname $hostname
|
|
|
|
fi
|
1993-07-19 19:14:45 +00:00
|
|
|
|
1995-02-03 23:54:07 +00:00
|
|
|
# Set the domainname if we're using NIS
|
|
|
|
if [ -z "`domainname`" -a -e "/etc/defaultdomain" ] ; then
|
1995-04-09 09:54:51 +00:00
|
|
|
domainname=`cat /etc/defaultdomain`
|
|
|
|
domainname $domainname
|
1995-02-03 23:54:07 +00:00
|
|
|
fi
|
|
|
|
|
1995-04-11 01:22:24 +00:00
|
|
|
# Set up all the network interfaces, calling startup scripts if needed
|
|
|
|
for ifn in ${network_interfaces}; do
|
|
|
|
if [ -e /etc/start_if.${ifn} ]; then
|
|
|
|
. /etc/start_if.${ifn} ${ifn}
|
1994-09-15 01:19:43 +00:00
|
|
|
fi
|
1995-04-11 01:22:24 +00:00
|
|
|
eval ifconfig_args=\$ifconfig_${ifn}
|
|
|
|
ifconfig ${ifn} ${ifconfig_args}
|
|
|
|
ifconfig ${ifn}
|
1994-09-15 01:19:43 +00:00
|
|
|
done
|
1993-06-20 13:41:45 +00:00
|
|
|
|
|
|
|
# set the address for the loopback interface
|
1993-07-19 19:14:45 +00:00
|
|
|
ifconfig lo0 inet localhost
|
1993-06-20 13:41:45 +00:00
|
|
|
|
1994-10-06 20:52:00 +00:00
|
|
|
# set interface for multicasts to default interface
|
|
|
|
# this needs to happen before router discovery
|
|
|
|
route add 224.0.0.0 -netmask 0xf0000000 -interface $hostname
|
|
|
|
|
1994-09-15 01:19:43 +00:00
|
|
|
if [ -n "$defaultrouter" -a "x$defaultrouter" != "xNO" ] ; then
|
|
|
|
route add default $defaultrouter
|
|
|
|
fi
|
|
|
|
|
1993-06-20 13:41:45 +00:00
|
|
|
# use loopback, not the wire
|
1993-07-19 21:08:53 +00:00
|
|
|
# route add $hostname localhost
|
1995-03-29 03:28:08 +00:00
|
|
|
|
This is the rc work as provided by pts, I will me makeing some additional
changes to it based upon other outstanding bug reports and commits made
after his work.
Comments:
(a) sysconfig is still used to do all configuration. I was not going to
change that out from under you.... a user never need edit netstart
or rc* unless they're being very weird.
(b) rc.maint has been folded back into rc. It is just unworkable as
a separate chunk because of ordering bogosities
(c) netstart does what it says... it starts up enough of the network to
get up, it doesn't start every bloody daemon that might talk to a
socket... netstart ifconfig's the devices and sets up routing if
configured to do so.
(d) nfs disks are mounted immediately after netstart completes
(e) syslog is started as early as possible (right after nfs) so that error
messages can get logged to remote syslog servers properly
(f) named is started (there is an argument that says that named should be
started before syslogd because if you are the dns server for your domain,
you'd like named to resolve remote hosts in syslog.conf, but this is
a minority case and the trivial workarround is to put the syslog host
in /etc/hosts or use an /etc/resolv.conf -- why? because you want syslog
to catch named errors, which is a MUCH more important and likely occurance)
(g) NOW all of the rest of the network daemons such as the time stuff, RPC,
NIS, NFS, Kerberos and inetd are started
(h) the rest of the generic stuff is done (cron/printer/sendmail)
(i) shared libraries are set
(j) /etc/rc.i386 is run (this does FreeBSD/386 specific stuff like ibcs2,
xtend, and all of the syscons stuff
(this is actually started as /etc/rc.`uname -m`
(k) the syscons stuff has gotten a serious cleaning to make it consistent
with rc conventions
(l) rc.local has had the comments about syscons removed (they are not relevant
to this file now) and the full name of the kernel has been restored to
/etc/motd
Submitted by: pts
1995-03-30 06:26:19 +00:00
|
|
|
if [ "x$gated" != "xNO" -o "x$routedflags" != "xNO" ] ; then
|
1995-04-09 09:54:51 +00:00
|
|
|
echo -n starting routing daemons:
|
1995-03-29 03:33:55 +00:00
|
|
|
|
1995-04-09 09:54:51 +00:00
|
|
|
# $gated and $routedflags are imported from /etc/sysconfig.
|
|
|
|
# If $gated == YES, gated is used; otherwise routed.
|
|
|
|
# If $routedflags == NO, routed isn't run.
|
1995-03-29 03:28:08 +00:00
|
|
|
|
1995-04-09 09:54:51 +00:00
|
|
|
if [ "X${gated}" = X"YES" -a -r /etc/gated.conf ]; then
|
|
|
|
echo -n ' gated'; gated $gatedflags
|
|
|
|
elif [ "X${routedflags}" != X"NO" ]; then
|
|
|
|
echo -n ' routed'; routed $routedflags
|
|
|
|
fi
|
1995-03-29 03:33:55 +00:00
|
|
|
|
1995-04-09 09:54:51 +00:00
|
|
|
echo '.'
|
1995-03-29 03:28:08 +00:00
|
|
|
fi
|