1993-06-20 13:41:45 +00:00
|
|
|
#!/bin/sh -
|
|
|
|
#
|
1995-08-23 07:12:16 +00:00
|
|
|
# $Id: netstart,v 1.33 1995/06/25 09:35:56 asami 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-05-11 21:11:17 +00:00
|
|
|
# Note that almost all the user-configurable behavior is no longer in
|
|
|
|
# this file, but rather in /etc/sysconfig. Please check this file
|
1995-05-17 04:46:57 +00:00
|
|
|
# first before contemplating any changes here. If you do need to change
|
|
|
|
# this file for some reason, we would like to know about it.
|
1995-05-11 21:11:17 +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
|
1995-04-24 23:52:16 +00:00
|
|
|
if [ -n "$defaultdomainname" -a "x$defaultdomainname" != "xNO" ] ; then
|
|
|
|
domainname $defaultdomainname
|
1995-02-03 23:54:07 +00:00
|
|
|
fi
|
|
|
|
|
1995-05-11 19:08:37 +00:00
|
|
|
#
|
|
|
|
# XXX This is known to cause an error if /usr is nfs mounted since it
|
|
|
|
# will not be avaliable until after the network is up :-(. Once the
|
|
|
|
# relocation of sysctl to /sbin is done that problem will go away.
|
|
|
|
#
|
|
|
|
if [ -n "$tcp_extensions" -a "x$tcp_extensions" = "xNO" ] ; then
|
1995-06-25 09:35:56 +00:00
|
|
|
sysctl -w net.inet.tcp.rfc1323=0
|
|
|
|
sysctl -w net.inet.tcp.rfc1644=0
|
1995-05-11 19:08:37 +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
|
|
|
|
1994-09-15 01:19:43 +00:00
|
|
|
if [ -n "$defaultrouter" -a "x$defaultrouter" != "xNO" ] ; then
|
1995-05-17 04:46:57 +00:00
|
|
|
static_routes="default ${static_routes}"
|
|
|
|
route_default="default ${defaultrouter}"
|
1994-09-15 01:19:43 +00:00
|
|
|
fi
|
|
|
|
|
1995-05-17 04:46:57 +00:00
|
|
|
# Set up any static routes. This should be done before router discovery.
|
|
|
|
for i in ${static_routes}; do
|
|
|
|
eval route_args=\$route_${i}
|
|
|
|
route add ${route_args}
|
|
|
|
done
|
1995-03-29 03:28:08 +00:00
|
|
|
|
1995-08-23 07:12:16 +00:00
|
|
|
if [ "x$gateway" != "xNO ]; then
|
|
|
|
echo 'configuring host as a gateway.'
|
|
|
|
sysctl -w net.inet.ip.forwarding=1
|
|
|
|
fi
|
|
|
|
|
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
|
1995-04-12 16:58:06 +00:00
|
|
|
echo -n ' gated'; /usr/local/sbin/gated $gatedflags
|
1995-04-09 09:54:51 +00:00
|
|
|
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
|