rc revision 7296
1#!/bin/sh
2#	$Id: rc,v 1.54 1995/03/24 00:11:02 jkh Exp $
3#	From: @(#)rc	5.27 (Berkeley) 6/5/91
4
5# System startup script run by init on autoboot
6# or after single-user.
7# Output and error are redirected to console by init,
8# and the console is the controlling terminal.
9
10stty status '^T'
11
12# Set shell to ignore SIGINT (2), but not children;
13# shell catches SIGQUIT (3) and returns to single user after fsck.
14trap : 2
15trap : 3	# shouldn't be needed
16
17HOME=/; export HOME
18PATH=/sbin:/bin:/usr/sbin:/usr/bin
19export PATH
20
21swapon -a
22
23if [ $1x = autobootx ]
24then
25	echo Automatic reboot in progress...
26	fsck -p
27	case $? in
28	0)
29		;;
30	2)
31		exit 1
32		;;
33	4)
34		reboot
35		echo "reboot failed... help!"
36		exit 1
37		;;
38	8)
39		echo "Automatic file system check failed... help!"
40		exit 1
41		;;
42	12)
43		echo "Reboot interrupted"
44		exit 1
45		;;
46	130)
47		# interrupt before catcher installed
48		exit 1
49		;;
50	*)
51		echo "Unknown error in reboot"
52		exit 1
53		;;
54	esac
55else
56	echo Skipping disk checks ...
57fi
58
59trap "echo 'Reboot interrupted'; exit 1" 3
60
61# root must be read/write both for NFS diskless and for VFS LKMs before
62# proceeding any further.
63mount -u -o rw /
64
65umount -a >/dev/null 2>&1
66mount -a -t nonfs
67
68# If the machine runs wall CMOS clock (compatible with MSDOS),
69# activate following line by creating empty file /etc/wall_cmos_clock
70# If this file not exist, following line does nothing (assumed
71# the machine runs UTC CMOS clock). See adjkerntz(8) for details.
72adjkerntz -i
73
74echo 'system logger'
75rm -f /dev/log
76syslogd
77
78# If there is a global system configuration file, suck it in.
79if [ -f /etc/sysconfig ]; then
80	. /etc/sysconfig
81fi
82
83# configure serial devices
84if [ -f /etc/rc.serial ]; then
85	. /etc/rc.serial
86fi
87
88# start up the network
89if [ -f /etc/netstart ]; then
90	. /etc/netstart
91fi
92
93# Do system maintainance functions.
94if [ -f /etc/rc.maint ]; then
95	. /etc/rc.maint
96fi
97
98# Now start up miscellaneous daemons that don't belong anywhere else
99#
100echo -n standard daemons:
101echo -n ' cron';		cron
102if [ "X${xtend}" != X"NO" -a -x /usr/libexec/xtend ]; then
103 	echo -n ' xtend';   /usr/libexec/xtend
104fi
105echo -n ' printer';             lpd
106echo '.'
107
108mount -a -t nfs >/dev/null 2>&1 &	# XXX shouldn't need background
109
110# Make shared lib searching a little faster.  Leave /usr/lib first if you
111# add your own entries or you may come to grief.
112if [ -x /sbin/ldconfig ]; then
113	_LDC=/usr/lib
114	if [ -d /usr/X11R6/lib ]; then _LDC="${_LDC} /usr/X11R6/lib" ; fi
115	if [ -d /usr/X386/lib ]; then _LDC="${_LDC} /usr/X386/lib" ; fi
116	if [ -d /usr/local/lib ]; then _LDC="${_LDC} /usr/local/lib" ; fi
117	if [ -d /usr/gnu/lib ]; then _LDC="${_LDC} /usr/gnu/lib" ; fi
118	echo 'setting ldconfig path:' ${_LDC}
119	ldconfig ${_LDC}
120fi
121
122######################### Start Of Syscons Section #######################
123
124kbdadjust=NO
125[ "X${keymap}" != X"NO" -o "X${keyrate}" != X"NO" ] && kbdadjust=YES
126vidadjust=NO
127[ "X${scrnmap}" != X"NO" -o "X${font8x16}" != X"NO" -o \
128	"X${font8x14}" != X"NO" -o "X${font8x8}" != X"NO" -o \
129	"X${blanktime}" != X"NO" ] && vidadjust=YES
130
131[ "X${kbdadjust}" != X"NO" -o "X${vidadjust}" != X"NO" -o \
132	"X${saver}" != X"NO" ] && echo "starting syscons:"
133
134[ "X${kbdadjust}" != X"NO" ] && echo "kbdcontrol: "
135
136# keymap
137if [ "X${keymap}" != X"NO" ]; then
138	echo -n "keymap "
139	kbdcontrol -l ${keymap}
140fi
141
142# keyrate
143if [ "X${keyrate}" != X"NO" ]; then
144	echo -n "keyrate "
145	kbdcontrol -r ${keyrate}
146fi
147
148[ "X${kbdadjust}" != X"NO" ] && echo
149[ "X${vidadjust}" != X"NO" ] && echo "vidcontrol: "
150
151# screen mapping
152if [ "X${scrnmap}" != X"NO" ]; then
153	echo -n "screen_map "
154	vidcontrol -l ${scrnmap}
155fi
156
157# font 8x16
158if [ "X${font8x16}" != X"NO" ]; then
159	echo -n "font8x16 "
160	vidcontrol -f 8x16 ${font8x16}
161fi
162
163# font 8x14
164if [ "X${font8x14}" != X"NO" ]; then
165	echo -n "font8x14 "
166	vidcontrol -f 8x14 ${font8x14}
167fi
168
169# font 8x8
170if [ "X${font8x8}" != X"NO" ]; then
171	echo -n "font8x8 "
172	vidcontrol -f 8x8 ${font8x8}
173fi
174
175# blank time
176if [ "X${blanktime}" != X"NO" ]; then
177	echo -n "blank_time "
178	vidcontrol -t ${blanktime}
179fi
180
181[ "X${vidadjust}" != X"NO" ] && echo
182
183# screen saver
184if [ "X${saver}" != X"NO" ] ; then
185	echo -n "screensaver: "
186	modstat | grep _saver || modload -u -o /tmp/saver_mod -e \
187				 saver_init -q /lkm/${saver}_saver_mod.o
188fi
189
190######################### End Of Syscons Section #######################
191
192# Start the SCO binary emulation if requested.
193if [ "X${ibcs2}" = X"YES" ]; then
194	ibcs2
195fi
196
197# Do traditional (but rather obsolete) rc.local file if it exists.
198if [ -f /etc/rc.local ]; then
199	sh /etc/rc.local
200fi
201
202date
203exit 0
204