View | Details | Raw Unified | Return to bug 249192 | Differences between
and this patch

Collapse All | Expand All

(-)b/libexec/rc/rc (-20 / +36 lines)
Lines 72-77 fi Link Here
72
. /etc/rc.subr
72
. /etc/rc.subr
73
load_rc_config
73
load_rc_config
74
74
75
# rc_parallel_start default is "NO"
76
rc_parallel_start=${rc_parallel_start:-NO}
77
_rc_parallel=''
78
# enable rcorder -p if /etc/rc.conf rc_parallel_start is "YES"
79
checkyesno rc_parallel_start && _rc_parallel='-p'
80
75
# If we receive a SIGALRM, re-source /etc/rc.conf; this allows rc.d
81
# If we receive a SIGALRM, re-source /etc/rc.conf; this allows rc.d
76
# scripts to perform "boot-time configuration" including enabling and
82
# scripts to perform "boot-time configuration" including enabling and
77
# disabling rc.d scripts which appear later in the boot order.
83
# disabling rc.d scripts which appear later in the boot order.
Lines 93-113 fi Link Here
93
# Do a first pass to get everything up to $early_late_divider so that
99
# Do a first pass to get everything up to $early_late_divider so that
94
# we can do a second pass that includes $local_startup directories
100
# we can do a second pass that includes $local_startup directories
95
#
101
#
96
unset system_rc
102
files=`rcorder ${skip} ${skip_firstboot} ${_rc_parallel} /etc/rc.d/* 2>/dev/null`
97
find_system_scripts
98
files=`rcorder ${skip} ${skip_firstboot} ${system_rc} 2>/dev/null`
99
103
100
_rc_elem_done=' '
104
_rc_elem_done=' '
101
for _rc_elem in ${files}; do
105
oldifs="$IFS"
102
	run_rc_script ${_rc_elem} ${_boot}
106
IFS=$'\n'
103
	_rc_elem_done="${_rc_elem_done}${_rc_elem} "
107
for _rc_group in ${files}; do
104
108
	IFS="$oldifs"
105
	case "$_rc_elem" in
109
	for _rc_elem in ${_rc_group}; do
106
	*/${early_late_divider})	break ;;
110
		run_rc_script ${_rc_elem} ${_boot} &
107
	esac
111
		_rc_elem_done="${_rc_elem_done}${_rc_elem} "
112
		case "$_rc_elem" in
113
		*/${early_late_divider})	break 2 ;;
114
		esac
115
	done
116
	wait
117
	IFS=$'\n'
108
done
118
done
119
IFS="$oldifs"
109
120
110
unset files local_rc system_rc
121
unset files local_rc
111
122
112
# Now that disks are mounted, for each dir in $local_startup
123
# Now that disks are mounted, for each dir in $local_startup
113
# search for init scripts that use the new rc.d semantics.
124
# search for init scripts that use the new rc.d semantics.
Lines 123-137 if [ -e ${firstboot_sentinel} ]; then Link Here
123
	skip_firstboot=""
134
	skip_firstboot=""
124
fi
135
fi
125
136
126
find_system_scripts
137
files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} ${_rc_parallel} 2>/dev/null`
127
files=`rcorder ${skip} ${skip_firstboot} ${system_rc} ${local_rc} 2>/dev/null`
138
IFS=$'\n'
128
for _rc_elem in ${files}; do
139
for _rc_group in ${files}; do
129
	case "$_rc_elem_done" in
140
	IFS="$oldifs"
130
	*" $_rc_elem "*)	continue ;;
141
	for _rc_elem in ${_rc_group}; do
131
	esac
142
		case "$_rc_elem_done" in
132
143
		*" $_rc_elem "*)	continue ;;
133
	run_rc_script ${_rc_elem} ${_boot}
144
		esac
145
		run_rc_script ${_rc_elem} ${_boot} &
146
	done
147
	wait
148
	IFS=$'\n'
134
done
149
done
150
IFS="$oldifs"
135
151
136
# Remove the firstboot sentinel, and reboot if it was requested.
152
# Remove the firstboot sentinel, and reboot if it was requested.
137
# Be a bit paranoid about removing it to handle the common failure
153
# Be a bit paranoid about removing it to handle the common failure
Lines 139-145 done Link Here
139
# Note: this assumes firstboot_sentinel is on / when we have
155
# Note: this assumes firstboot_sentinel is on / when we have
140
# a read-only /, or that it is on media that's writable.
156
# a read-only /, or that it is on media that's writable.
141
if [ -e ${firstboot_sentinel} ]; then
157
if [ -e ${firstboot_sentinel} ]; then
142
	checkyesno root_rw_mount || mount -uw /
158
	checkyesno root_rw_mount && mount -uw /
143
	chflags -R 0 ${firstboot_sentinel}
159
	chflags -R 0 ${firstboot_sentinel}
144
	rm -rf ${firstboot_sentinel}
160
	rm -rf ${firstboot_sentinel}
145
	if [ -e ${firstboot_sentinel}-reboot ]; then
161
	if [ -e ${firstboot_sentinel}-reboot ]; then

Return to bug 249192