rc revision 1.163
1#!/bin/sh
2#
3# $NetBSD: rc,v 1.163 2009/04/10 16:18:04 joerg Exp $
4#
5# rc --
6#	Run the scripts in /etc/rc.d with rcorder.
7
8#	System startup script run by init(8) on autoboot or after single-user.
9#	Output and error are redirected to console by init, and the console
10#	is the controlling terminal.
11
12export HOME=/
13export PATH=/sbin:/bin:/usr/sbin:/usr/bin
14umask 022
15
16. /etc/rc.subr
17. /etc/rc.conf
18_rc_conf_loaded=true
19
20if ! checkyesno rc_configured; then
21	echo "/etc/rc.conf is not configured.  Multiuser boot aborted."
22	exit 1
23fi
24
25if [ "$1" = autoboot ]; then
26	autoboot=yes
27	rc_fast=yes	# run_rc_command(): do fast booting
28fi
29
30stty status '^T'
31
32#	Set shell to ignore SIGINT, but not children;
33#	shell catches SIGQUIT and returns to single user.
34#
35trap : INT
36trap "echo 'Boot interrupted.'; exit 1" QUIT
37
38date
39
40scripts=$(for rcd in ${rc_directories:-/etc/rc.d}; do
41	test -d ${rcd} && echo ${rcd}/*;
42done)
43files=$(rcorder -s nostart ${rc_rcorder_flags} ${scripts})
44
45for _rc_elem in $files; do
46	run_rc_script $_rc_elem start
47done
48
49date
50exit 0
51