rc revision 1.150
11.149Slukem#!/bin/sh
21.149Slukem#
31.150Senami# $NetBSD: rc,v 1.150 2000/03/29 02:13:51 enami Exp $
41.149Slukem#
51.149Slukem# rc.sh --
61.149Slukem#	Run the scripts in /etc/rc.d with rcorder.
71.149Slukem
81.149Slukem#	System startup script run by init on autoboot or after single-user.
91.149Slukem#	Output and error are redirected to console by init, and the console
101.149Slukem#	is the controlling terminal.
111.1Scgd
121.149Slukemexport HOME=/
131.149Slukemexport PATH=/sbin:/bin:/usr/sbin:/usr/bin
141.1Scgd
151.149Slukem. /etc/rc.subr
161.149Slukem. /etc/rc.conf
171.150Senami
181.150Senamiif ! checkyesno rc_configured; then
191.150Senami	echo "/etc/rc.conf is not configured.  Multiuser boot aborted."
201.150Senami	exit 1
211.150Senamifi
221.50Sthorpej
231.149Slukemif [ "$1" = autoboot ]; then
241.149Slukem	autoboot=yes
251.149Slukem	_rc_fast_run=yes	# run_rc_command(): do fast booting
261.50Sthorpejfi
271.107Stron
281.149Slukemstty status '^T'
291.1Scgd
301.149Slukem#	Set shell to ignore SIGINT (2), but not children;
311.149Slukem#	shell catches SIGQUIT (3) and returns to single user.
321.149Slukem#
331.149Slukemtrap : 2
341.38Scgdtrap "echo 'Boot interrupted.'; exit 1" 3
351.1Scgd
361.149Slukemfiles=`rcorder /etc/rc.d/*`
371.40Scgd
381.149Slukemfor i in $files; do
391.149Slukem	run_rc_script $i start
401.149Slukemdone
411.1Scgd
421.1Scgddate
431.1Scgdexit 0
44