rc revision 1.155
11.149Slukem#!/bin/sh
21.149Slukem#
31.155Slukem# $NetBSD: rc,v 1.155 2001/02/28 16:49:18 lukem Exp $
41.149Slukem#
51.154Slukem# rc --
61.149Slukem#	Run the scripts in /etc/rc.d with rcorder.
71.149Slukem
81.154Slukem#	System startup script run by init(8) 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.155Slukem_rc_conf_loaded=YES
181.150Senami
191.150Senamiif ! checkyesno rc_configured; then
201.150Senami	echo "/etc/rc.conf is not configured.  Multiuser boot aborted."
211.150Senami	exit 1
221.150Senamifi
231.50Sthorpej
241.149Slukemif [ "$1" = autoboot ]; then
251.149Slukem	autoboot=yes
261.149Slukem	_rc_fast_run=yes	# run_rc_command(): do fast booting
271.50Sthorpejfi
281.107Stron
291.149Slukemstty status '^T'
301.1Scgd
311.149Slukem#	Set shell to ignore SIGINT (2), but not children;
321.149Slukem#	shell catches SIGQUIT (3) and returns to single user.
331.149Slukem#
341.149Slukemtrap : 2
351.38Scgdtrap "echo 'Boot interrupted.'; exit 1" 3
361.1Scgd
371.153Slukemfiles=`rcorder -s nostart /etc/rc.d/*`
381.40Scgd
391.155Slukemdate
401.155Slukem
411.155Slukemfor _rc_elem in $files; do
421.155Slukem	run_rc_script $_rc_elem start
431.149Slukemdone
441.1Scgd
451.1Scgddate
461.1Scgdexit 0
47