Another pass through our rc files in an attempt to eliminate historical

crufy and generally make all of this easier to understand and modify.
This commit is contained in:
Jordan K. Hubbard 1995-03-23 01:25:19 +00:00
parent 9531ca9353
commit 89341fe2a5
3 changed files with 167 additions and 167 deletions

183
etc/rc
View File

@ -1,5 +1,5 @@
#!/bin/sh
# $Id: rc,v 1.49 1995/03/21 16:44:03 wollman Exp $
# $Id: rc,v 1.50 1995/03/22 03:29:52 ache Exp $
# From: @(#)rc 5.27 (Berkeley) 6/5/91
# System startup script run by init on autoboot
@ -81,178 +81,27 @@ if [ -f /etc/rc.serial ]; then
sh /etc/rc.serial
fi
# set hostname, turn on network
echo 'starting network'
. /etc/netstart
# clean up left-over files
rm -f /etc/nologin
rm -f /var/spool/lock/*
rm -f /var/spool/uucp/.Temp/*
(cd /var/run && { rm -rf -- *; cp /dev/null utmp; chmod 644 utmp; })
echo -n ' system logger'
rm -f /dev/log
syslogd
# $timedflags is imported from /etc/sysconfig;
# if $timedflags == NO, timed isn't run.
if [ "X${timedflags}" != X"NO" ]; then
echo -n ' time daemon'; timed $timedflags
fi
echo '.'
# /var/crash should be a directory or a symbolic link
# to the crash directory if core dumps are to be saved.
if [ "X${savecore}" = X"YES" -a -d /var/crash ]; then
echo; echo -n checking for core dump...
savecore /var/crash
echo done.
# start up the network
if [ -f /etc/rc.netstart ]; then
sh /etc/rc.netstart
fi
if [ "X${check_quotas}" = X"YES" ]; then
echo ' checking quotas:'
quotacheck -a
echo ' done.'
quotaon -a
fi
# build ps databases
kvm_mkdb
dev_mkdb
# snapshot any kernel -c changes back to disk
/sbin/dset -q
chmod 666 /dev/tty[pqrs]*
# check the password temp/lock file
if [ -f /etc/ptmp ]
then
logger -s -p auth.err \
'password file may be incorrect -- /etc/ptmp exists'
fi
# Recover vi editor files.
virecovery=/var/tmp/vi.recover/recover.*
if [ "$virecovery" != "/var/tmp/vi.recover/recover.*" ]; then
echo 'Recovering vi editor sessions'
for i in $virecovery; do
sendmail -t < $i
done
fi
echo clearing /tmp
# prune quickly with one rm, then use find to clean up /tmp/[lq]*
# (not needed with mfs /tmp, but doesn't hurt there...)
(cd /tmp && rm -rf [a-km-pr-zA-Z]* &&
find -d . ! -name . ! -name lost+found ! -name quotas -exec rm -rf -- {} \;)
if [ "X${accounting}" = X"YES" -a -d /var/account ]; then
echo 'turning on accounting'; accton /var/account/acct
# Do system maintainance functions.
if [ -f /etc/rc.maint ]; then
sh /etc/rc.maint
fi
# Now start up miscellaneous daemons that don't belong anywhere else
#
echo -n standard daemons:
echo -n ' cron'; cron
echo '.'
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
# $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
# $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
echo -n ' printer'; lpd
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
# 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
echo -n ' inetd'; inetd
echo '.'
mount -a -t nfs >/dev/null 2>&1 & # XXX shouldn't need background
if [ "X${xtend}" != X"NO" -a -x /usr/libexec/xtend ]; then
echo -n ' xtend'; /usr/libexec/xtend
fi
echo -n ' printer'; lpd
echo '.'
mount -a -t nfs >/dev/null 2>&1 & # XXX shouldn't need background
# Make shared lib searching a little faster. Leave /usr/lib first if you
# add your own entries or you may come to grief.
@ -336,8 +185,10 @@ fi
######################### End Of Syscons Section #######################
. /etc/rc.local
# Do traditional (but rather obsolete) rc.local file if it exists.
if [ -f /etc/rc.local ]; then
sh /etc/rc.local
fi
date
exit 0

141
etc/rc.netstart Normal file
View File

@ -0,0 +1,141 @@
#!/bin/sh -
#
# $Id: netstart,v 1.23 1995/03/22 18:00:35 jkh 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
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
# $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
# 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
echo -n ' inetd'; inetd
echo '.'

View File

@ -4,7 +4,7 @@
# This is sysconfig - a file full of useful variables that you can set
# to change the default startup behavior of your system.
#
# $Id: sysconfig,v 1.3 1995/03/22 03:29:55 ache Exp $
# $Id: sysconfig,v 1.4 1995/03/22 18:00:36 jkh Exp $
######################### Start Of Syscons Section #######################
@ -130,3 +130,11 @@ accounting=NO
# Uncomment next line to activate italian locale
# LANG=it_IT.ISO8859-1; export LANG
# For full list of locales, check /usr/share/locale/*
######################### End Of Netconfig Section #######################
######################### Start Of Misc Section #######################
# Set to YES if you want ibcs2 emulation loaded at startup
ibcs2=NO