rc revision 7259
1709Swollman#!/bin/sh
27259Sjkh#	$Id: rc,v 1.50 1995/03/22 03:29:52 ache Exp $
3709Swollman#	From: @(#)rc	5.27 (Berkeley) 6/5/91
437Srgrimes
537Srgrimes# System startup script run by init on autoboot
637Srgrimes# or after single-user.
737Srgrimes# Output and error are redirected to console by init,
837Srgrimes# and the console is the controlling terminal.
937Srgrimes
1037Srgrimesstty status '^T'
1137Srgrimes
1237Srgrimes# Set shell to ignore SIGINT (2), but not children;
1337Srgrimes# shell catches SIGQUIT (3) and returns to single user after fsck.
1437Srgrimestrap : 2
1537Srgrimestrap : 3	# shouldn't be needed
1637Srgrimes
1737SrgrimesHOME=/; export HOME
1837SrgrimesPATH=/sbin:/bin:/usr/sbin:/usr/bin
1937Srgrimesexport PATH
2037Srgrimes
213843Sdgswapon -a
223843Sdg
232164Sdgif [ $1x = autobootx ]
2437Srgrimesthen
2537Srgrimes	echo Automatic reboot in progress...
2637Srgrimes	fsck -p
2737Srgrimes	case $? in
2837Srgrimes	0)
2937Srgrimes		;;
3037Srgrimes	2)
3137Srgrimes		exit 1
3237Srgrimes		;;
3337Srgrimes	4)
3437Srgrimes		reboot
3537Srgrimes		echo "reboot failed... help!"
3637Srgrimes		exit 1
3737Srgrimes		;;
3837Srgrimes	8)
3937Srgrimes		echo "Automatic file system check failed... help!"
4037Srgrimes		exit 1
4137Srgrimes		;;
4237Srgrimes	12)
4337Srgrimes		echo "Reboot interrupted"
4437Srgrimes		exit 1
4537Srgrimes		;;
4637Srgrimes	130)
4737Srgrimes		# interrupt before catcher installed
4837Srgrimes		exit 1
4937Srgrimes		;;
5037Srgrimes	*)
5137Srgrimes		echo "Unknown error in reboot"
5237Srgrimes		exit 1
5337Srgrimes		;;
5437Srgrimes	esac
552164Sdgelse
562164Sdg	echo Skipping disk checks ...
5737Srgrimesfi
5837Srgrimes
5937Srgrimestrap "echo 'Reboot interrupted'; exit 1" 3
6037Srgrimes
613036Sdg# root must be read/write both for NFS diskless and for VFS LKMs before
623036Sdg# proceeding any further.
633036Sdgmount -u -o rw /
641692Sphk
6537Srgrimesumount -a >/dev/null 2>&1
6637Srgrimesmount -a -t nonfs
6737Srgrimes
68872Sache# If the machine runs wall CMOS clock (compatible with MSDOS),
69872Sache# activate following line by creating empty file /etc/wall_cmos_clock
70872Sache# If this file not exist, following line does nothing (assumed
71872Sache# the machine runs UTC CMOS clock). See adjkerntz(8) for details.
724091Sacheadjkerntz -i
73872Sache
747219Sjkh# If there is a global system configuration file, suck it in.
757219Sjkhif [ -f /etc/sysconfig ]; then
767219Sjkh	. /etc/sysconfig
777219Sjkhfi
787219Sjkh
791675Sache# configure serial devices
807219Sjkhif [ -f /etc/rc.serial ]; then
811675Sache	sh /etc/rc.serial
821675Sachefi
831675Sache
847259Sjkh# start up the network
857259Sjkhif [ -f /etc/rc.netstart ]; then
867259Sjkh	sh /etc/rc.netstart
8737Srgrimesfi
8837Srgrimes
897259Sjkh# Do system maintainance functions.
907259Sjkhif [ -f /etc/rc.maint ]; then
917259Sjkh	sh /etc/rc.maint
9237Srgrimesfi
9337Srgrimes
947259Sjkh# Now start up miscellaneous daemons that don't belong anywhere else
957259Sjkh#
9637Srgrimesecho -n standard daemons:
971001Sguidoecho -n ' cron';		cron
987259Sjkhif [ "X${xtend}" != X"NO" -a -x /usr/libexec/xtend ]; then
997259Sjkh 	echo -n ' xtend';   /usr/libexec/xtend
100857Sdgfi
1017259Sjkhecho -n ' printer';             lpd
10237Srgrimesecho '.'
10337Srgrimes
104958Sachemount -a -t nfs >/dev/null 2>&1 &	# XXX shouldn't need background
105958Sache
1061186Srgrimes# Make shared lib searching a little faster.  Leave /usr/lib first if you
1071186Srgrimes# add your own entries or you may come to grief.
1081186Srgrimesif [ -x /sbin/ldconfig ]; then
1091186Srgrimes	_LDC=/usr/lib
1101308Srich	if [ -d /usr/X11R6/lib ]; then _LDC="${_LDC} /usr/X11R6/lib" ; fi
1111186Srgrimes	if [ -d /usr/X386/lib ]; then _LDC="${_LDC} /usr/X386/lib" ; fi
1121186Srgrimes	if [ -d /usr/local/lib ]; then _LDC="${_LDC} /usr/local/lib" ; fi
1131186Srgrimes	if [ -d /usr/gnu/lib ]; then _LDC="${_LDC} /usr/gnu/lib" ; fi
1141186Srgrimes	echo 'setting ldconfig path:' ${_LDC}
1151186Srgrimes	ldconfig ${_LDC}
1161186Srgrimesfi
1171186Srgrimes
1187238Sache######################### Start Of Syscons Section #######################
1197219Sjkh
1207238Sachekbdadjust=NO
1217238Sache[ "X${keymap}" != X"NO" -o "X${keyrate}" != X"NO" ] && kbdadjust=YES
1227238Sachevidadjust=NO
1237238Sache[ "X${scrnmap}" != X"NO" -o "X${font8x16}" != X"NO" -o \
1247238Sache	"X${font8x14}" != X"NO" -o "X${font8x8}" != X"NO" -o \
1257238Sache	"X${blanktime}" != X"NO" ] && vidadjust=YES
1267238Sache
1277238Sache[ "X${kbdajust}" != X"NO" -o "X${vidajust}" != X"NO" -o \
1287238Sache	"X${saver}" != X"NO" ] && echo "starting syscons:"
1297238Sache
1307238Sache[ "X${kbdajust}" != X"NO" ] && echo "kbdcontrol: "
1317238Sache
1327238Sache# keymap
1337219Sjkhif [ "X${keymap}" != X"NO" ]; then
1347238Sache	echo -n "keymap "
1357238Sache	kbdcontrol -l ${keymap}
1367219Sjkhfi
1377219Sjkh
1387238Sache# keyrate
1397238Sacheif [ "X${keyrate}" != X"NO" ]; then
1407238Sache	echo -n "keyrate "
1417238Sache	kbdcontrol -r ${keyrate}
1427238Sachefi
1437238Sache
1447238Sache[ "X${kbdajust}" != X"NO" ] && echo
1457238Sache[ "X${vidajust}" != X"NO" ] && echo "vidcontrol: "
1467238Sache
1477238Sache# screen mapping
1487238Sacheif [ "X${scrnmap}" != X"NO" ]; then
1497238Sache	echo -n "screen_map "
1507238Sache	vidcontrol -l ${scrnmap}
1517238Sachefi
1527238Sache
1537238Sache# font 8x16
1547238Sacheif [ "X${font8x16}" != X"NO" ]; then
1557238Sache	echo -n "font8x16 "
1567238Sache	vidcontrol -f 8x16 ${font8x16}
1577238Sachefi
1587238Sache
1597238Sache# font 8x14
1607238Sacheif [ "X${font8x14}" != X"NO" ]; then
1617238Sache	echo -n "font8x14 "
1627238Sache	vidcontrol -f 8x14 ${font8x14}
1637238Sachefi
1647238Sache
1657238Sache# font 8x8
1667238Sacheif [ "X${font8x8}" != X"NO" ]; then
1677238Sache	echo -n "font8x8 "
1687238Sache	vidcontrol -f 8x8 ${font8x8}
1697238Sachefi
1707238Sache
1717238Sache# blank time
1727238Sacheif [ "X${blanktime}" != X"NO" ]; then
1737238Sache	echo -n "blank_time "
1747238Sache	vidcontrol -t ${blanktime}
1757238Sachefi
1767238Sache
1777238Sache[ "X${vidajust}" != X"NO" ] && echo
1787238Sache
1797238Sache# screen saver
1807238Sacheif [ "X${saver}" != X"NO" ] ; then
1817238Sache	echo -n "screensaver: "
1827238Sache	modstat | grep _saver || modload -u -o /tmp/saver_mod -e \
1837238Sache				 saver_init -q /lkm/${saver}_saver_mod.o
1847238Sachefi
1857238Sache
1867238Sache######################### End Of Syscons Section #######################
1877238Sache
1887259Sjkh# Do traditional (but rather obsolete) rc.local file if it exists.
1897259Sjkhif [ -f /etc/rc.local ]; then
1907259Sjkh	sh /etc/rc.local
1917259Sjkhfi
19237Srgrimes
19337Srgrimesdate
19437Srgrimesexit 0
195