1 #!/bin/sh 2 # 3 # $NetBSD: rc,v 1.162.42.1 2009/05/13 19:18:02 jym 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 12 export HOME=/ 13 export PATH=/sbin:/bin:/usr/sbin:/usr/bin 14 umask 022 15 16 . /etc/rc.subr 17 . /etc/rc.conf 18 _rc_conf_loaded=true 19 20 if ! checkyesno rc_configured; then 21 echo "/etc/rc.conf is not configured. Multiuser boot aborted." 22 exit 1 23 fi 24 25 if [ "$1" = autoboot ]; then 26 autoboot=yes 27 rc_fast=yes # run_rc_command(): do fast booting 28 fi 29 30 stty status '^T' 31 32 # Set shell to ignore SIGINT, but not children; 33 # shell catches SIGQUIT and returns to single user. 34 # 35 trap : INT 36 trap "echo 'Boot interrupted.'; exit 1" QUIT 37 38 date 39 40 scripts=$(for rcd in ${rc_directories:-/etc/rc.d}; do 41 test -d ${rcd} && echo ${rcd}/*; 42 done) 43 files=$(rcorder -s nostart ${rc_rcorder_flags} ${scripts}) 44 45 for _rc_elem in $files; do 46 run_rc_script $_rc_elem start 47 done 48 49 date 50 exit 0 51