summaryrefslogtreecommitdiffstats
path: root/etc/rc
diff options
context:
space:
mode:
authorrgrimes <rgrimes@FreeBSD.org>1995-03-30 06:26:19 +0000
committerrgrimes <rgrimes@FreeBSD.org>1995-03-30 06:26:19 +0000
commit01cb869dd82d6a110d6dea4aacdbded66d1145d9 (patch)
tree0af61dec31ff81daaab11ec279899a09ce277e98 /etc/rc
parentad43fa83a6410dd430b4d048943c2f0ab0a82174 (diff)
downloadFreeBSD-src-01cb869dd82d6a110d6dea4aacdbded66d1145d9.zip
FreeBSD-src-01cb869dd82d6a110d6dea4aacdbded66d1145d9.tar.gz
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
Diffstat (limited to 'etc/rc')
-rw-r--r--etc/rc237
1 files changed, 150 insertions, 87 deletions
diff --git a/etc/rc b/etc/rc
index cd602a6..3256f85 100644
--- a/etc/rc
+++ b/etc/rc
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: rc,v 1.58 1995/03/29 03:42:16 jkh Exp $
+# $Id: rc,v 1.59 1995/03/30 00:01:08 ache Exp $
# From: @(#)rc 5.27 (Berkeley) 6/5/91
# System startup script run by init on autoboot
@@ -81,126 +81,189 @@ if [ -f /etc/rc.serial ]; then
. /etc/rc.serial
fi
-# Do system maintainance functions.
-if [ -f /etc/rc.maint ]; then
- . /etc/rc.maint
-fi
-
-# Start up the network
+# start up the network
if [ -f /etc/netstart ]; then
. /etc/netstart
fi
-# Now start up miscellaneous daemons that don't belong anywhere else
-#
-echo -n standard daemons:
-echo -n ' cron'; cron
-if [ "X${xtend}" != X"NO" -a -x /usr/libexec/xtend ]; then
- echo -n ' xtend'; /usr/libexec/xtend
+mount -a -t nfs >/dev/null 2>&1 & # XXX shouldn't need background
+
+# Whack the pty perms back into shape.
+chmod 666 /dev/tty[pqrs]*
+
+# clean up left-over files
+rm -f /etc/nologin
+rm -f /var/spool/lock/*
+rm -f /var/spool/uucp/.Temp/*
+rm -f /dev/log
+(cd /var/run && { rm -rf -- *; cp /dev/null utmp; chmod 644 utmp; })
+
+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 -- {} \;)
+
+# /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 -n checking for core dump...
+ savecore /var/crash
fi
-echo -n ' printer'; lpd
-echo '.'
-mount -a -t nfs >/dev/null 2>&1 & # XXX shouldn't need background
+# snapshot any kernel -c changes back to disk
+echo 'recording kernel -c changes'
+/sbin/dset -q
-# Make shared lib searching a little faster. Leave /usr/lib first if you
-# add your own entries or you may come to grief.
-if [ -x /sbin/ldconfig ]; then
- _LDC=/usr/lib
- if [ -d /usr/X11R6/lib ]; then _LDC="${_LDC} /usr/X11R6/lib" ; fi
- if [ -d /usr/X386/lib ]; then _LDC="${_LDC} /usr/X386/lib" ; fi
- if [ -d /usr/local/lib ]; then _LDC="${_LDC} /usr/local/lib" ; fi
- if [ -d /usr/gnu/lib ]; then _LDC="${_LDC} /usr/gnu/lib" ; fi
- echo 'setting ldconfig path:' ${_LDC}
- ldconfig ${_LDC}
+# Check the quotas
+if [ "X${check_quotas}" = X"YES" ]; then
+ echo 'checking quotas:'
+ quotacheck -a
+ echo ' done.'
+ quotaon -a
fi
-######################### Start Of Syscons Section #######################
+# start system logging and name service (named needs to start before syslogd
+# if you don't have a /etc/resolv.conf)
+#
+echo -n starting system daemons:
-kbdadjust=NO
-[ "X${keymap}" != X"NO" -o "X${keyrate}" != X"NO" \
- -o "X${keychange}" != X"NO" ] && kbdadjust=YES
-vidadjust=NO
-[ "X${scrnmap}" != X"NO" -o "X${font8x16}" != X"NO" -o \
- "X${font8x14}" != X"NO" -o "X${font8x8}" != X"NO" -o \
- "X${blanktime}" != X"NO" ] && vidadjust=YES
+echo ' syslogd.'; syslogd
-[ "X${kbdadjust}" != X"NO" -o "X${vidadjust}" != X"NO" -o \
- "X${saver}" != X"NO" ] && echo "starting syscons:"
+echo -n starting network daemons:
-[ "X${kbdadjust}" != X"NO" ] && echo -n " kbdcontrol:"
+# $namedflags is imported from /etc/sysconfig
+if [ "X${namedflags}" != "XNO" ]; then
+ echo -n ' named'; named $namedflags
+fi
-# keymap
-if [ "X${keymap}" != X"NO" ]; then
- echo -n " keymap"
- kbdcontrol -l ${keymap}
+# $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} >/dev/null 2>&1
+ fi
+
+ if [ "X${xntpdflags}" != X"NO" ]; then
+ echo -n ' xntpd'; xntpd ${xntpdflags}
+ fi
fi
-# keyrate
-if [ "X${keyrate}" != X"NO" ]; then
- echo -n " keyrate"
- kbdcontrol -r ${keyrate}
+# $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
-# change function keys
-if [ "X${keychange}" != X"NO" ]; then
- echo -n " keychange"
- set - ${keychange}
- while [ $# -gt 0 ]
- do
- kbdcontrol -f "$1" "$2"
- shift; shift
- done
+# Portmapper should always be run, to provide RPC services for inetd.
+if [ -x /usr/sbin/portmap ]; then
+ echo -n ' portmap'; portmap
fi
-[ "X${kbdadjust}" != X"NO" ] && echo
-[ "X${vidadjust}" != X"NO" ] && echo -n " vidcontrol:"
+# 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}
-# screen mapping
-if [ "X${scrnmap}" != X"NO" ]; then
- echo -n " screen_map"
- vidcontrol -l ${scrnmap}
+ if [ "X${yppasswddflags}" != X"NO" ]; then
+ echo -n ' yppasswdd'; yppasswdd ${yppasswddflags}
+ fi
fi
-# font 8x16
-if [ "X${font8x16}" != X"NO" ]; then
- echo -n " font8x16"
- vidcontrol -f 8x16 ${font8x16}
+# Start ypbind if we're an NIS client
+if [ "X${nis_clientflags}" != X"NO" ]; then
+ echo -n ' ypbind'; ypbind ${nis_clientflags}
fi
-# font 8x14
-if [ "X${font8x14}" != X"NO" ]; then
- echo -n " font8x14"
- vidcontrol -f 8x14 ${font8x14}
+# $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
-# font 8x8
-if [ "X${font8x8}" != X"NO" ]; then
- echo -n " font8x8"
- vidcontrol -f 8x8 ${font8x8}
+if [ "X${nfs_server}" = X"YES" -a -r /etc/exports ]; then
+ echo -n ' mountd'; mountd
+ echo -n ' nfsd'; nfsd -u -t 4
fi
-# blank time
-if [ "X${blanktime}" != X"NO" ]; then
- echo -n " blank_time"
- vidcontrol -t ${blanktime}
+if [ "X${nfs_client}" = X"YES" ]; then
+ echo -n ' nfsiod'; nfsiod -n 4
fi
-[ "X${vidadjust}" != X"NO" ] && echo "."
+if [ "X${amdflags}" != X"NO" ]; then
+ echo -n ' amd'; amd ${amdflags}
+fi
-# screen saver
-if [ "X${saver}" != X"NO" ] ; then
- echo -n "screensaver: "
- modstat | grep _saver || modload -u -o /tmp/saver_mod -e \
- saver_init -q /lkm/${saver}_saver_mod.o
+# 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
-######################### End Of Syscons Section #######################
+echo -n ' inetd'; inetd
+echo '.'
+
+# build ps databases
+kvm_mkdb
+dev_mkdb
+
+# 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
+
+if [ "X${accounting}" = X"YES" -a -d /var/account ]; then
+ echo 'turning on accounting'; accton /var/account/acct
+fi
+
+# Now start up miscellaneous daemons that don't belong anywhere else
+#
+echo -n standard daemons:
+echo -n ' cron'; cron
+echo -n ' printer'; lpd
+
+# $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
+
+echo '.'
+
+# Make shared lib searching a little faster. Leave /usr/lib first if you
+# add your own entries or you may come to grief.
+if [ -x /sbin/ldconfig ]; then
+ _LDC=/usr/lib
+ if [ -d /usr/X11R6/lib ]; then _LDC="${_LDC} /usr/X11R6/lib" ; fi
+ if [ -d /usr/X386/lib ]; then _LDC="${_LDC} /usr/X386/lib" ; fi
+ if [ -d /usr/local/lib ]; then _LDC="${_LDC} /usr/local/lib" ; fi
+ if [ -d /usr/gnu/lib ]; then _LDC="${_LDC} /usr/gnu/lib" ; fi
+ echo 'setting ldconfig path:' ${_LDC}
+ ldconfig ${_LDC}
+fi
-# Start the SCO binary emulation if requested.
-if [ "X${ibcs2}" = X"YES" ]; then
- echo "Enabling ibcs2 emulation."
- ibcs2
+# configure implementation specific stuff
+arch=`uname -m`
+if [ -f /etc/rc.$arch ]; then
+ . /etc/rc.$arch
fi
# Do traditional (but rather obsolete) rc.local file if it exists.
OpenPOWER on IntegriCloud