freebsd-dev/etc/netstart
rgrimes b50547561f History merge after repository restore of netstart,v:
date: 1995/03/26 18:18:59;  author: wpaul;  state: Exp;  lines: +23 -17
Make syslogd work again: in needs to be started in netstart right
before the rest of the system daemons are brought up and *after* the
network interfaces have been configured.

Also fix one other potential problem: the NIS services need to be started
relavively early since some of the other daemons might need them. The
automounter is a good example: if you use amd with NIS-based maps, you'd
better have NIS running before you start it. :) I think mountd might
need it too, now that netgroups can be read via NIS as well.
1995-03-29 03:33:55 +00:00

148 lines
3.9 KiB
Bash
Executable File

#!/bin/sh -
#
# $Id: netstart,v 1.23 1995/03/29 03:28:08 rgrimes Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# my-name is my symbolic name
# my-netmask is specified in /etc/networks
#
if [ -z "`hostname -s`" ] ; then
hostname $hostname
fi
# Set the domainname if we're using NIS
if [ -z "`domainname`" -a -e "/etc/defaultdomain" ] ; then
domainname=`cat /etc/defaultdomain`
domainname $domainname
fi
for i in /etc/hostname.*
do
ifn=`expr $i : '/etc/hostname\.\(.*\)'`
if [ -e /etc/hostname.$ifn ]; then
if [ -e /etc/start_if.$ifn ]; then
sh /etc/start_if.$ifn $ifn
fi
ifconfig $ifn `cat /etc/hostname.$ifn`
ifconfig $ifn
fi
done
# set the address for the loopback interface
ifconfig lo0 inet localhost
# set interface for multicasts to default interface
# this needs to happen before router discovery
route add 224.0.0.0 -netmask 0xf0000000 -interface $hostname
if [ -n "$defaultrouter" -a "x$defaultrouter" != "xNO" ] ; then
route add default $defaultrouter
elif [ -f /etc/defaultrouter ] ; then
route add default `cat /etc/defaultrouter`
fi
# use loopback, not the wire
# route add $hostname localhost
# The syslog daemon needs to be started as soon as possible in order
# to capture any messages generated by the other system daemons.
echo -n Starting system logger:
rm -f /dev/log
echo ' syslogd.'; syslogd
echo -n starting network daemons:
# Portmapper should always be run, to provide RPC services for inetd.
if [ -x /usr/sbin/portmap ]; then
echo -n ' portmap'; portmap
fi
# $gated and $routedflags are imported from /etc/sysconfig.
# If $gated == YES, gated is used; otherwise routed.
# If $routedflags == NO, routed isn't run.
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
# $namedflags is imported from /etc/sysconfig
if [ "X${namedflags}" != "XNO" ]; then
echo -n ' named'; named $namedflags
fi
# Start ypserv if we're an NIS server.
# Run yppasswdd only on the NIS master server
if [ "X${nis_serverflags}" != X"NO" ]; then
echo -n ' ypserv'; ypserv ${nis_serverflags}
if [ "X${yppasswddflags}" != X"NO" ]; then
echo -n ' yppasswdd'; yppasswdd ${yppasswddflags}
fi
fi
# Start ypbind if we're an NIS client
if [ "X${nis_clientflags}" != X"NO" ]; then
echo -n ' ypbind'; ypbind ${nis_clientflags}
fi
# $ntpdate and $xntpdflags are imported from /etc/sysconfig.
# If $ntpdate != NO, run ntpdate $ntpdate to set the date correctly.
# If $xntpdflags != NO, start xntpd.
if [ "X${ntpdate}" != X"NO" -o "X${xntpdflags}" != X"NO" ]; then
if [ "X${tickadjflags}" != X"NO" ]; then
echo -n ' tickadj'; tickadj ${tickadjflags--Aq}
fi
if [ "X${ntpdate}" != X"NO" ]; then
echo -n ' ntpdate'; ntpdate ${ntpdate}
fi
if [ "X${xntpdflags}" != X"NO" ]; then
echo -n ' xntpd'; xntpd ${xntpdflags}
fi
fi
# $timedflags is imported from /etc/sysconfig;
# if $timedflags == NO, timed isn't run.
if [ "X${timedflags}" != X"NO" ]; then
echo -n ' timed'; timed $timedflags
fi
# $rwhod is imported from /etc/sysconfig;
# if $rwhod is set to YES, rwhod is run.
if [ "X${rwhod}" = X"YES" ]; then
echo -n ' rwhod'; rwhod
fi
if [ "X${nfs_server}" = X"YES" -a -r /etc/exports ]; then
echo -n ' mountd'; mountd
echo -n ' nfsd'; nfsd -u -t 4
fi
if [ "X${nfs_client}" = X"YES" ]; then
echo -n ' nfsiod'; nfsiod -n 4
fi
if [ "X${amdflags}" != X"NO" ]; then
echo -n ' amd'; amd ${amdflags}
fi
# $sendmail_flags is imported from /etc/sysconfig;
# if $sendmail_flags is something other than NO, sendmail is run.
if [ "X${sendmail_flags}" != X"NO" -a -r /etc/sendmail.cf ]; then
echo -n ' sendmail'; sendmail ${sendmail_flags}
fi
# Kerberos runs ONLY on the Kerberos server machine
if [ "X${kerberos_server}" = X"YES" ]; then
echo -n ' kerberos'; kerberos >> /var/log/kerberos.log &
echo -n ' kadmind'; \
(sleep 20; /usr/sbin/kadmind -n >/dev/null 2>&1 &) &
fi
echo -n ' inetd'; inetd
echo '.'