NetBSD/etc/rc
2001-03-12 15:56:39 +00:00

47 lines
921 B
Bash

#!/bin/sh
#
# $NetBSD: rc,v 1.156 2001/03/12 15:56:39 lukem Exp $
#
# rc --
# Run the scripts in /etc/rc.d with rcorder.
# System startup script run by init(8) on autoboot or after single-user.
# Output and error are redirected to console by init, and the console
# is the controlling terminal.
export HOME=/
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
. /etc/rc.subr
. /etc/rc.conf
_rc_conf_loaded=YES
if ! checkyesno rc_configured; then
echo "/etc/rc.conf is not configured. Multiuser boot aborted."
exit 1
fi
if [ "$1" = autoboot ]; then
autoboot=yes
_rc_fast_run=yes # run_rc_command(): do fast booting
fi
stty status '^T'
# Set shell to ignore SIGINT (2), but not children;
# shell catches SIGQUIT (3) and returns to single user.
#
trap : 2
trap "echo 'Boot interrupted.'; exit 1" 3
date
files=`rcorder -s nostart /etc/rc.d/*`
for _rc_elem in $files; do
run_rc_script $_rc_elem start
done
date
exit 0