1 1.149 lukem #!/bin/sh 2 1.149 lukem # 3 1.156 lukem # $NetBSD: rc,v 1.156 2001/03/12 15:56:39 lukem Exp $ 4 1.149 lukem # 5 1.154 lukem # rc -- 6 1.149 lukem # Run the scripts in /etc/rc.d with rcorder. 7 1.149 lukem 8 1.154 lukem # System startup script run by init(8) on autoboot or after single-user. 9 1.149 lukem # Output and error are redirected to console by init, and the console 10 1.149 lukem # is the controlling terminal. 11 1.1 cgd 12 1.149 lukem export HOME=/ 13 1.149 lukem export PATH=/sbin:/bin:/usr/sbin:/usr/bin 14 1.1 cgd 15 1.149 lukem . /etc/rc.subr 16 1.149 lukem . /etc/rc.conf 17 1.155 lukem _rc_conf_loaded=YES 18 1.150 enami 19 1.150 enami if ! checkyesno rc_configured; then 20 1.150 enami echo "/etc/rc.conf is not configured. Multiuser boot aborted." 21 1.150 enami exit 1 22 1.150 enami fi 23 1.50 thorpej 24 1.149 lukem if [ "$1" = autoboot ]; then 25 1.149 lukem autoboot=yes 26 1.149 lukem _rc_fast_run=yes # run_rc_command(): do fast booting 27 1.50 thorpej fi 28 1.107 tron 29 1.149 lukem stty status '^T' 30 1.1 cgd 31 1.149 lukem # Set shell to ignore SIGINT (2), but not children; 32 1.149 lukem # shell catches SIGQUIT (3) and returns to single user. 33 1.149 lukem # 34 1.149 lukem trap : 2 35 1.38 cgd trap "echo 'Boot interrupted.'; exit 1" 3 36 1.1 cgd 37 1.156 lukem date 38 1.156 lukem 39 1.153 lukem files=`rcorder -s nostart /etc/rc.d/*` 40 1.155 lukem 41 1.155 lukem for _rc_elem in $files; do 42 1.155 lukem run_rc_script $_rc_elem start 43 1.149 lukem done 44 1.1 cgd 45 1.1 cgd date 46 1.1 cgd exit 0 47