NetBSD/etc/rc

51 lines
1.0 KiB
Plaintext
Raw Normal View History

#!/bin/sh
#
# $NetBSD: rc,v 1.163 2009/04/10 16:18:04 joerg Exp $
#
# rc --
# Run the scripts in /etc/rc.d with rcorder.
1993-03-21 12:45:37 +03:00
# 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.
1993-03-21 12:45:37 +03:00
1997-03-10 12:34:59 +03:00
export HOME=/
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
umask 022
. /etc/rc.subr
. /etc/rc.conf
_rc_conf_loaded=true
if ! checkyesno rc_configured; then
echo "/etc/rc.conf is not configured. Multiuser boot aborted."
exit 1
fi
if [ "$1" = autoboot ]; then
autoboot=yes
2002-04-18 11:18:05 +04:00
rc_fast=yes # run_rc_command(): do fast booting
fi
stty status '^T'
1993-03-21 12:45:37 +03:00
# Set shell to ignore SIGINT, but not children;
# shell catches SIGQUIT and returns to single user.
#
trap : INT
trap "echo 'Boot interrupted.'; exit 1" QUIT
date
scripts=$(for rcd in ${rc_directories:-/etc/rc.d}; do
test -d ${rcd} && echo ${rcd}/*;
done)
files=$(rcorder -s nostart ${rc_rcorder_flags} ${scripts})
2001-03-12 18:56:39 +03:00
for _rc_elem in $files; do
run_rc_script $_rc_elem start
done
1993-03-21 12:45:37 +03:00
date
exit 0