1 1.149 lukem #!/bin/sh 2 1.149 lukem # 3 1.162 lukem # $NetBSD: rc,v 1.162 2003/01/04 15:27:43 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.157 lukem umask 022 15 1.1 cgd 16 1.149 lukem . /etc/rc.subr 17 1.149 lukem . /etc/rc.conf 18 1.162 lukem _rc_conf_loaded=true 19 1.150 enami 20 1.150 enami if ! checkyesno rc_configured; then 21 1.150 enami echo "/etc/rc.conf is not configured. Multiuser boot aborted." 22 1.150 enami exit 1 23 1.150 enami fi 24 1.50 thorpej 25 1.149 lukem if [ "$1" = autoboot ]; then 26 1.149 lukem autoboot=yes 27 1.160 lukem rc_fast=yes # run_rc_command(): do fast booting 28 1.50 thorpej fi 29 1.107 tron 30 1.149 lukem stty status '^T' 31 1.1 cgd 32 1.158 lukem # Set shell to ignore SIGINT, but not children; 33 1.158 lukem # shell catches SIGQUIT and returns to single user. 34 1.149 lukem # 35 1.158 lukem trap : INT 36 1.158 lukem trap "echo 'Boot interrupted.'; exit 1" QUIT 37 1.1 cgd 38 1.156 lukem date 39 1.156 lukem 40 1.161 lukem files=$(rcorder -s nostart ${rc_rcorder_flags} /etc/rc.d/*) 41 1.155 lukem 42 1.155 lukem for _rc_elem in $files; do 43 1.155 lukem run_rc_script $_rc_elem start 44 1.149 lukem done 45 1.1 cgd 46 1.1 cgd date 47 1.1 cgd exit 0 48