rc revision 1.162
11.149Slukem#!/bin/sh
21.149Slukem#
31.162Slukem# $NetBSD: rc,v 1.162 2003/01/04 15:27:43 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.162Slukem_rc_conf_loaded=true
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.160Slukem	rc_fast=yes	# run_rc_command(): do fast booting
281.50Sthorpejfi
291.107Stron
301.149Slukemstty status '^T'
311.1Scgd
321.158Slukem#	Set shell to ignore SIGINT, but not children;
331.158Slukem#	shell catches SIGQUIT and returns to single user.
341.149Slukem#
351.158Slukemtrap : INT
361.158Slukemtrap "echo 'Boot interrupted.'; exit 1" QUIT
371.1Scgd
381.156Slukemdate
391.156Slukem
401.161Slukemfiles=$(rcorder -s nostart ${rc_rcorder_flags} /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