rc revision 70109
1279264Sdelphij#!/bin/sh
2110010Smarkm#
3110010Smarkm# Copyright (c) 2000  The FreeBSD Project
4160819Ssimon# All rights reserved.
5110010Smarkm#
6110010Smarkm# Redistribution and use in source and binary forms, with or without
7110010Smarkm# modification, are permitted provided that the following conditions
8110010Smarkm# are met:
9110010Smarkm# 1. Redistributions of source code must retain the above copyright
10110010Smarkm#    notice, this list of conditions and the following disclaimer.
11110010Smarkm# 2. Redistributions in binary form must reproduce the above copyright
12110010Smarkm#    notice, this list of conditions and the following disclaimer in the
13110010Smarkm#    documentation and/or other materials provided with the distribution.
14110010Smarkm#
15110010Smarkm# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16110010Smarkm# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17110010Smarkm# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18110010Smarkm# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19110010Smarkm# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20215698Ssimon# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21215698Ssimon# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22215698Ssimon# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23215698Ssimon# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24215698Ssimon# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25110010Smarkm# SUCH DAMAGE.
26110010Smarkm#
27110010Smarkm# $FreeBSD: head/etc/rc 70109 2000-12-17 08:24:49Z dougb $
28110010Smarkm#	From: @(#)rc	5.27 (Berkeley) 6/5/91
29110010Smarkm#
30110010Smarkm
31110010Smarkm# System startup script run by init on autoboot
32110010Smarkm# or after single-user.
33110010Smarkm# Output and error are redirected to console by init,
34110010Smarkm# and the console is the controlling terminal.
35110010Smarkm
36110010Smarkm# Note that almost all of the user-configurable behavior is no longer in
37110010Smarkm# this file, but rather in /etc/defaults/rc.conf.  Please check that file
38110010Smarkm# first before contemplating any changes here.  If you do need to change
39110010Smarkm# this file for some reason, we would like to know about it.
40110010Smarkm
41279264Sdelphijstty status '^T'
42279264Sdelphij
43110010Smarkm# Set shell to ignore SIGINT (2), but not children;
44110010Smarkm# shell catches SIGQUIT (3) and returns to single user after fsck.
45215698Ssimon#
46215698Ssimontrap : 2
47215698Ssimontrap : 3	# shouldn't be needed
48215698Ssimon
49160819Ssimonbootmode=$1
50215698Ssimon
51160819SsimonHOME=/
52160819SsimonPATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin
53279264Sdelphijexport HOME PATH
54279264Sdelphij
55279264Sdelphij# BOOTP diskless boot.  We have to run the rc file early in order to
56110010Smarkm# retarget various config files.
57279264Sdelphij#
58279264Sdelphijif [ -r /etc/rc.diskless1 ]; then
59279264Sdelphij	dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null`
60279264Sdelphij	if [ ${dlv:=0} != 0 ]; then
61279264Sdelphij		. /etc/rc.diskless1
62279264Sdelphij	fi
63215698Ssimonfi
64279264Sdelphij
65279264Sdelphij# If there is a global system configuration file, suck it in.
66279264Sdelphij#
67279264Sdelphijif [ -r /etc/defaults/rc.conf ]; then
68279264Sdelphij	. /etc/defaults/rc.conf
69215698Ssimon	source_rc_confs
70279264Sdelphijelif [ -r /etc/rc.conf ]; then
71110010Smarkm	. /etc/rc.conf
72110010Smarkmfi
73110010Smarkm
74110010Smarkmchkdepend() {
75110010Smarkm	svc=$1
76110010Smarkm	svc_var=$2
77110010Smarkm	dep=$3
78110010Smarkm	dep_var=$4
79110010Smarkm
80110010Smarkm	eval svc_val=\${$svc_var}
81110010Smarkm	eval dep_val=\${$dep_var}
82110010Smarkm
83110010Smarkm	case ${svc_val} in
84110010Smarkm	[Yy][Ee][Ss])
85110010Smarkm		case ${dep_val} in
86110010Smarkm		[Yy][Ee][Ss])
87110010Smarkm		    ;;
88110010Smarkm		*)
89110010Smarkm		    eval ${dep_var}="YES"
90110010Smarkm		    echo "DEPENDENCY NOTE: ${dep} will be enabled" \
91110010Smarkm			 "to support ${svc}"
92110010Smarkm		    ;;
93110010Smarkm		esac
94110010Smarkm		;;
95110010Smarkm	esac
96110010Smarkm}
97110010Smarkm
98110010Smarkmchkdepend amd amd_enable        portmap portmap_enable
99110010Smarkmchkdepend NFS nfs_server_enable portmap portmap_enable
100110010Smarkm
101110010Smarkm# First pass at entropy recovery so the rebooting /dev/random can reseed.
102110010Smarkm#
103110010Smarkmcase ${entropy_file} in
104110010Smarkm[Nn][Oo] | '')
105110010Smarkm	;;
106110010Smarkm*)
107110010Smarkm	if [ -w /dev/random ]; then
108110010Smarkm		if [ -f "${entropy_file}" -a -r "${entropy_file}" -a \
109110010Smarkm		    -s "${entropy_file}" ]; then
110110010Smarkm			echo "Using ${entropy_file} as an entropy file"
111110010Smarkm			cat ${entropy_file} > /dev/random 2> /dev/random
112110010Smarkm			entropy_reseeded=yes
113110010Smarkm		fi
114110010Smarkm	fi
115110010Smarkm	;;
116110010Smarkmesac
117110010Smarkm
118110010Smarkm# Configure ccd devices.
119110010Smarkm#
120110010Smarkmif [ -r /etc/ccd.conf ]; then
121110010Smarkm	ccdconfig -C
122110010Smarkmfi
123110010Smarkm
124110010Smarkmcase ${start_vinum} in
125110010Smarkm[Yy][Ee][Ss])
126110010Smarkm	vinum start
127110010Smarkm	;;
128110010Smarkmesac
129110010Smarkm
130110010Smarkmswapon -a
131110010Smarkm
132110010Smarkmcase ${bootmode} in
133160819Ssimonautoboot)
134110010Smarkm	echo 'Automatic boot in progress...'
135110010Smarkm	fsck -p
136279264Sdelphij	case $? in
137215698Ssimon	0)
138215698Ssimon		;;
139215698Ssimon	2)
140215698Ssimon		exit 1
141110010Smarkm		;;
142110010Smarkm	4)
143110010Smarkm		reboot
144110010Smarkm		echo 'Reboot failed... help!'
145110010Smarkm		exit 1
146110010Smarkm		;;
147215698Ssimon	8)
148110010Smarkm		echo 'Automatic file system check failed... help!'
149110010Smarkm		exit 1
150110010Smarkm		;;
151110010Smarkm	12)
152110010Smarkm		echo 'Reboot interrupted'
153110010Smarkm		exit 1
154110010Smarkm		;;
155110010Smarkm	130)
156110010Smarkm		# interrupt before catcher installed
157160819Ssimon		exit 1
158110010Smarkm		;;
159110010Smarkm	*)
160160819Ssimon		echo 'Unknown error in reboot'
161110010Smarkm		exit 1
162160819Ssimon		;;
163110010Smarkm	esac
164110010Smarkm	;;
165160819Ssimon*)
166160819Ssimon	echo 'Skipping disk checks ...'
167160819Ssimon	;;
168esac
169
170set -T
171trap "echo 'Reboot interrupted'; exit 1" 3
172
173# root normally must be read/write, but if this is a BOOTP NFS
174# diskless boot it does not have to be.
175#
176case ${root_rw_mount} in
177[Nn][Oo] | '')
178	;;
179*)
180	if ! mount -u -o rw / ; then
181		echo 'Mounting root filesystem rw failed, startup aborted'
182		exit 1
183	fi
184	;;
185esac
186
187umount -a >/dev/null 2>&1
188
189# Mount everything except nfs filesystems.
190mount -a -t nonfs
191
192case $? in
1930)
194	;;
195*)
196	echo 'Mounting /etc/fstab filesystems failed, startup aborted'
197	exit 1
198	;;
199esac
200
201# Run custom disk mounting function here
202#
203if [ -n "${diskless_mount}" -a -r "${diskless_mount}" ]; then
204		sh ${diskless_mount}
205fi
206
207# Second attempt at reseeding, if needed.
208#
209case ${entropy_reseeded} in
210yes)
211	;;
212*)
213	case ${entropy_file} in
214	[Nn][Oo] | '')
215		;;
216	*)
217		if [ -w /dev/random ]; then
218			if [ -f "${entropy_file}" -a -r "${entropy_file}" -a \
219			    -s "${entropy_file}" ]; then
220				echo "Using ${entropy_file} as an entropy file"
221				cat ${entropy_file} > /dev/random 2> /dev/random
222			elif [ "${entropy_file}" != /var/db/entropy -a \
223			    -f /var/db/entropy -a -r /var/db/entropy -a \
224			    -s /var/db/entropy ]; then
225				echo 'Using /var/db/entropy as an entropy file'
226				cat /var/db/entropy > /dev/random 2> /dev/random
227			else
228    echo "Can't use ${entropy_file} as an entropy file, trying other sources"
229				# XXX temporary until we can get the entropy
230				# harvesting rate up
231				# Entropy below is not great,
232				# but better than nothing.
233				(ps -gauxwww; iostat; vmstat; sysctl -a;
234				    dmesg) | /bin/dd of=/dev/random bs=8k 2>/dev/null
235				( for i in /etc /var/run ; do
236					cd $i ; ls -al ; cat *
237				done ) | /bin/dd of=/dev/random bs=8k 2>/dev/null
238			fi
239		fi
240		;;
241	esac
242	;;
243esac
244
245# Remove these to prevent problems on future reboots
246rm -f "${entropy_file}" /var/db/entropy
247
248adjkerntz -i
249
250purgedir() {
251	local dir file
252
253	if [ $# -eq 0 ]; then
254		purgedir .
255	else
256		for dir
257		do
258		(
259			cd "$dir" && for file in .* *
260			do
261				[ ."$file" = .. -o ."$file" = ... ] && continue
262				[ -d "$file" -a ! -L "$file" ] &&
263					purgedir "$file"
264				[ -f "$file" ] && rm -f -- "$file"
265			done
266		)
267		done
268	fi
269}
270
271clean_var() {
272	if [ ! -f /var/run/clean_var ]; then
273		rm -rf /var/run/*
274		purgedir /var/spool/lock
275		rm -rf /var/spool/uucp/.Temp/*
276		# Keep a copy of the boot messages around
277		dmesg >/var/run/dmesg.boot
278		# And an initial utmp file
279		(cd /var/run && cp /dev/null utmp && chmod 644 utmp;)
280		>/var/run/clean_var
281	fi
282}
283
284if [ -d /var/run -a -d /var/spool/lock -a -d /var/spool/uucp/.Temp ]; then
285	# network_pass1() *may* end up writing stuff to /var - we don't want to
286	# remove it immediately afterwards - *nor* to we want to fail to clean
287	# an nfs-mounted /var.
288	clean_var
289fi
290
291# Add additional swapfile, if configured.
292#
293case ${swapfile} in
294[Nn][Oo] | '')
295	;;
296*)
297	if [ -w "${swapfile}" -a -c /dev/vn0b ]; then
298		echo "Adding ${swapfile} as additional swap"
299		vnconfig /dev/vn0b ${swapfile} && swapon /dev/vn0b
300	fi
301	;;
302esac
303
304# Set sysctl variables as early as we can
305#
306if [ -r /etc/rc.sysctl ]; then
307	. /etc/rc.sysctl
308fi
309
310# Configure serial devices
311#
312if [ -r /etc/rc.serial ]; then
313	. /etc/rc.serial
314fi
315
316# Start up PC-card configuration
317#
318if [ -r /etc/rc.pccard ]; then
319	. /etc/rc.pccard
320fi
321
322# Start up the initial network configuration.
323#
324if [ -r /etc/rc.network ]; then
325	. /etc/rc.network	# We only need to do this once.
326	network_pass1
327fi
328
329case ${ipv6_enable} in
330[Yy][Ee][Ss])
331	if [ -r /etc/rc.network6 ]; then
332		. /etc/rc.network6	# We only need to do this once also.
333		network6_pass1
334	fi
335	;;
336esac
337
338# Mount NFS filesystems if present in /etc/fstab
339case "`mount -d -a -t nfs`" in
340*mount_nfs*)
341	echo -n 'Mounting NFS file systems:'
342	mount -a -t nfs
343	echo '.'
344	;;
345esac
346
347# Whack the pty perms back into shape.
348#
349if ls /dev/tty[pqrsPQRS]* > /dev/null 2>&1; then
350	chflags 0 /dev/tty[pqrsPQRS]*
351	chmod 666 /dev/tty[pqrsPQRS]*
352	chown root:wheel /dev/tty[pqrsPQRS]*
353fi
354
355# Clean up left-over files
356#
357clean_var			# If it hasn't already been done
358rm /var/run/clean_var
359
360# Clearing /tmp at boot-time seems to have a long tradition.  It doesn't
361# help in any way for long-living systems, and it might accidentally
362# clobber files you would rather like to have preserved after a crash
363# (if not using mfs /tmp anyway).
364#
365# See also the example of another cleanup policy in /etc/periodic/daily.
366#
367case ${clear_tmp_enable} in
368[Yy][Ee][Ss])
369	echo -n 'Clearing /tmp:'
370	# prune quickly with one rm, then use find to clean up /tmp/[lq]*
371	# (not needed with mfs /tmp, but doesn't hurt there...)
372	(cd /tmp && rm -rf [a-km-pr-zA-Z]* &&
373		find -d . ! -name . ! -name lost+found ! -name quota.user \
374		! -name quota.group -exec rm -rf -- {} \;)
375	echo '.'
376	;;
377esac
378
379# Remove X lock files, since they will prevent you from restarting X11
380# after a system crash.
381#
382rm -f /tmp/.X*-lock /tmp/.X11-unix/*
383
384# Snapshot any kernel -c changes back to disk here <someday>.
385# This has changed with ELF and /kernel.config.
386
387echo -n 'Additional daemons:'
388
389# Start system logging and name service.  Named needs to start before syslogd
390# if you don't have a /etc/resolv.conf.
391#
392case ${syslogd_enable} in
393[Yy][Ee][Ss])
394	# Transitional symlink (for the next couple of years :) until all
395	# binaries have had a chance to move towards /var/run/log.
396	if [ ! -h /dev/log ]; then
397		# might complain for r/o root f/s
398		ln -sf /var/run/log /dev/log
399	fi
400
401	rm -f /var/run/log
402	echo -n ' syslogd';	syslogd ${syslogd_flags}
403	;;
404esac
405
406echo '.'
407
408# Build device name databases if we are not using DEVFS
409#
410if sysctl vfs.devfs.generation > /dev/null 2>&1 ; then
411	rm -f /var/run/dev.db
412else
413	dev_mkdb
414fi
415
416# Enable dumpdev so that savecore can see it.
417# /var/crash should be a directory or a symbolic link
418# to the crash directory if core dumps are to be saved.
419#
420case ${dumpdev} in
421[Nn][Oo] | '')
422	;;
423*)
424	if [ -e "${dumpdev}" -a -d /var/crash ]; then
425		dumpon -v ${dumpdev}
426		echo -n 'Checking for core dump: '
427		savecore /var/crash
428	fi
429	;;
430esac
431
432if [ -n "${network_pass1_done}" ]; then
433	network_pass2
434fi
435
436# Enable/Check the quotas (must be after ypbind if using NIS)
437#
438case ${enable_quotas} in
439[Yy][Ee][Ss])
440	case ${check_quotas} in
441	[Yy][Ee][Ss])
442		echo -n 'Checking quotas:'
443		quotacheck -a
444		echo ' done.'
445		;;
446	esac
447
448	echo -n 'Enabling quotas:'
449	quotaon -a
450	echo ' done.'
451	;;
452esac
453
454if [ -n "${network_pass2_done}" ]; then
455	network_pass3
456fi
457
458# Check the password temp/lock file
459#
460if [ -e /etc/ptmp ]; then
461	logger -s -p auth.err \
462	"password file may be incorrect -- /etc/ptmp exists"
463fi
464
465case ${accounting_enable} in
466[Yy][Ee][Ss])
467	if [ -d /var/account ]; then
468		echo 'Turning on accounting:'
469		if [ ! -e /var/account/acct ]; then
470			touch /var/account/acct
471		fi
472		accton /var/account/acct
473	fi
474	;;
475esac
476
477# Make shared lib searching a little faster.  Leave /usr/lib first if you
478# add your own entries or you may come to grief.
479#
480ldconfig="/sbin/ldconfig"
481case ${ldconfig_insecure} in
482[Yy][Ee][Ss])
483	ldconfig="${ldconfig} -i"
484	;;
485esac
486if [ -x /sbin/ldconfig ]; then
487	case `/usr/bin/objformat` in
488	elf)
489		_LDC=/usr/lib
490		for i in ${ldconfig_paths}; do
491			if [ -d "${i}" ]; then
492				_LDC="${_LDC} ${i}"
493			fi
494		done
495		echo 'ELF ldconfig path:' ${_LDC}
496		${ldconfig} -elf ${_LDC}
497		;;
498	esac
499
500	# Legacy aout support for i386 only
501	case `sysctl -n hw.machine` in
502	i386)
503		# Default the a.out ldconfig path.
504		: ${ldconfig_paths_aout=${ldconfig_paths}}
505		_LDC=/usr/lib/aout
506		for i in ${ldconfig_paths_aout}; do
507			if [ -d "${i}" ]; then
508				_LDC="${_LDC} ${i}"
509			fi
510		done
511		echo 'a.out ldconfig path:' ${_LDC}
512		${ldconfig} -aout ${_LDC}
513		;;
514	esac
515fi
516
517# Now start up miscellaneous daemons that don't belong anywhere else
518#
519echo -n 'Starting standard daemons:'
520case ${inetd_enable} in
521[Nn][Oo])
522	;;
523*)
524	echo -n ' inetd';	inetd ${inetd_flags}
525	;;
526esac
527
528case ${cron_enable} in
529[Nn][Oo])
530	;;
531*)
532	echo -n ' cron';	cron
533	;;
534esac
535
536case ${lpd_enable} in
537[Yy][Ee][Ss])
538	echo -n ' printer';	${lpd_program:-/usr/sbin/lpd} ${lpd_flags}
539	;;
540esac
541
542case ${sendmail_enable} in
543[Yy][Ee][Ss])
544	if [ -r /etc/mail/sendmail.cf ]; then
545		echo -n ' sendmail';	/usr/sbin/sendmail ${sendmail_flags}
546	fi
547	;;
548esac
549
550case ${sshd_enable} in
551[Yy][Ee][Ss])
552	if [ -x ${sshd_program:-/usr/sbin/sshd} ]; then
553		echo -n ' sshd';
554		${sshd_program:-/usr/sbin/sshd} ${sshd_flags}
555	fi
556	;;
557esac
558
559case ${usbd_enable} in
560[Yy][Ee][Ss])
561	echo -n ' usbd';	/usr/sbin/usbd ${usbd_flags}
562	;;
563esac
564
565echo '.'
566
567# Recover vi editor files.
568find /var/tmp/vi.recover ! -type f -a ! -type d -delete
569vibackup=`echo /var/tmp/vi.recover/vi.*`
570if [ "${vibackup}" != '/var/tmp/vi.recover/vi.*' ]; then
571	echo -n 'Recovering vi editor sessions:'
572	for i in /var/tmp/vi.recover/vi.*; do
573		# Only test files that are readable.
574		if [ ! -r "${i}" ]; then
575			continue
576		fi
577
578		# Unmodified nvi editor backup files either have the
579		# execute bit set or are zero length.  Delete them.
580		if [ -x "${i}" -o ! -s "${i}" ]; then
581			rm -f "${i}"
582		fi
583	done
584
585	# It is possible to get incomplete recovery files, if the editor
586	# crashes at the right time.
587	virecovery=`echo /var/tmp/vi.recover/recover.*`
588	if [ "${virecovery}" != "/var/tmp/vi.recover/recover.*" ]; then
589		for i in /var/tmp/vi.recover/recover.*; do
590			# Only test files that are readable.
591			if [ ! -r "${i}" ]; then
592				continue
593			fi
594
595			# Delete any recovery files that are zero length,
596			# corrupted, or that have no corresponding backup file.
597			# Else send mail to the user.
598			recfile=`awk '/^X-vi-recover-path:/{print $2}' < "${i}"`
599			if [ -n "${recfile}" -a -s "${recfile}" ]; then
600				sendmail -t < "${i}"
601			else
602				rm -f "${i}"
603			fi
604		done
605	fi
606	echo '.'
607fi
608
609# Make a bounds file for msgs(1) if there isn't one already
610#
611if [ -d /var/msgs -a ! -f /var/msgs/bounds -a ! -L /var/msgs/bounds ]; then
612	echo 0 > /var/msgs/bounds
613fi
614
615case ${update_motd} in
616[Nn][Oo] | '')
617	;;
618*)
619	if T=`mktemp /tmp/_motd.XXXXXX`; then
620		uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > ${T}
621		awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> ${T}
622		cmp -s ${T} /etc/motd || {
623			cp ${T} /etc/motd
624			chmod 644 /etc/motd
625		}
626		rm -f ${T}
627	fi
628	;;
629esac
630
631# Configure implementation specific stuff
632#
633arch=`uname -m`
634if [ -r /etc/rc.${arch} ]; then
635	. /etc/rc.${arch}
636fi
637
638# Run rc.devfs if readable to customize devfs
639#
640if [ -r /etc/rc.devfs ]; then
641	sh /etc/rc.devfs
642fi
643
644echo -n 'Additional ABI support:'
645
646# Start the Linux binary compatibility if requested.
647#
648case ${linux_enable} in
649[Yy][Ee][Ss])
650	echo -n ' linux'
651	if ! kldstat -v | grep -E 'linux(aout|elf)' > /dev/null; then
652		kldload linux > /dev/null 2>&1
653	fi
654	if [ -x /compat/linux/sbin/ldconfig ]; then
655		/compat/linux/sbin/ldconfig
656	fi
657	;;
658esac
659
660# Start the SysVR4 binary emulation if requested.
661#
662case ${svr4_enable} in
663[Yy][Ee][Ss])
664	echo -n ' svr4';	kldload svr4 > /dev/null 2>&1
665	;;
666esac
667
668echo '.'
669
670# Do traditional (but rather obsolete) rc.local file if it exists.  If you
671# use this file and want to make it programmatic, source /etc/defaults/rc.conf
672# in /etc/rc.local and add your custom variables to /etc/rc.conf, as
673# shown below.  Please do not put local extensions into /etc/rc itself.
674# Use /etc/rc.local
675#
676# ---- rc.local ----
677#	if [ -r /etc/defaults/rc.conf ]; then
678#		. /etc/defaults/rc.conf
679#		source_rc_confs
680#	elif [ -r /etc/rc.conf ]; then
681#		. /etc/rc.conf
682#	fi
683#
684#	... additional startup conditionals ...
685# ---- rc.local ----
686#
687if [ -r /etc/rc.local ]; then
688	echo -n 'Starting local daemons:'
689	sh /etc/rc.local
690	echo '.'
691fi
692
693# For each valid dir in $local_startup, search for init scripts matching *.sh
694#
695case ${local_startup} in
696[Nn][Oo] | '')
697	;;
698*)
699	echo -n 'Local package initialization:'
700	for dir in ${local_startup}; do
701		if [ -d "${dir}" ]; then
702			for script in ${dir}/*.sh; do
703				if [ -x "${script}" ]; then
704					(set -T
705					 trap 'exit 1' 2
706					 ${script} start)
707				fi
708			done
709		fi
710	done
711	echo '.'
712	;;
713esac
714
715if [ -n "${network_pass3_done}" ]; then
716	network_pass4
717fi
718
719# Raise kernel security level.  This should be done only after `fsck' has
720# repaired local file systems if you want the securelevel to be greater than 1.
721#
722case ${kern_securelevel_enable} in
723[Yy][Ee][Ss])
724	if [ "${kern_securelevel}" -ge 0 ]; then
725		echo 'Raising kernel security level: '
726		sysctl -w kern.securelevel=${kern_securelevel}
727	fi
728	;;
729esac
730
731echo ''
732
733date
734
735exit 0
736
737