rc revision 1.157
11.149Slukem#!/bin/sh
21.149Slukem#
31.157Slukem# $NetBSD: rc,v 1.157 2001/05/09 16:53:45 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.157Slukemumask 022
151.1Scgd
161.149Slukem. /etc/rc.subr
171.149Slukem. /etc/rc.conf
181.155Slukem_rc_conf_loaded=YES
191.150Senami
201.150Senamiif ! checkyesno rc_configured; then
211.150Senami	echo "/etc/rc.conf is not configured.  Multiuser boot aborted."
221.150Senami	exit 1
231.150Senamifi
241.50Sthorpej
251.149Slukemif [ "$1" = autoboot ]; then
261.149Slukem	autoboot=yes
271.149Slukem	_rc_fast_run=yes	# run_rc_command(): do fast booting
281.50Sthorpejfi
291.107Stron
301.149Slukemstty status '^T'
311.1Scgd
321.149Slukem#	Set shell to ignore SIGINT (2), but not children;
331.149Slukem#	shell catches SIGQUIT (3) and returns to single user.
341.149Slukem#
351.149Slukemtrap : 2
361.38Scgdtrap "echo 'Boot interrupted.'; exit 1" 3
371.1Scgd
381.156Slukemdate
391.156Slukem
401.153Slukemfiles=`rcorder -s nostart /etc/rc.d/*`
411.155Slukem
421.155Slukemfor _rc_elem in $files; do
431.155Slukem	run_rc_script $_rc_elem start
441.149Slukemdone
451.1Scgd
461.1Scgddate
471.1Scgdexit 0
48