rc revision 51231
140123Sdes#!/bin/sh
250472Speter# $FreeBSD: head/etc/rc 51231 1999-09-13 15:44:20Z sheldonh $
3709Swollman#	From: @(#)rc	5.27 (Berkeley) 6/5/91
437Srgrimes
537Srgrimes# System startup script run by init on autoboot
637Srgrimes# or after single-user.
737Srgrimes# Output and error are redirected to console by init,
837Srgrimes# and the console is the controlling terminal.
937Srgrimes
1051231Ssheldonh# Note that almost all of the user-configurable behavior is no longer in
1151231Ssheldonh# this file, but rather in /etc/defaults/rc.conf.  Please check that file
1251231Ssheldonh# first before contemplating any changes here.  If you do need to change
1351231Ssheldonh# this file for some reason, we would like to know about it.
148460Sjkh
1537Srgrimesstty status '^T'
1637Srgrimes
1737Srgrimes# Set shell to ignore SIGINT (2), but not children;
1837Srgrimes# shell catches SIGQUIT (3) and returns to single user after fsck.
1951231Ssheldonh#
2037Srgrimestrap : 2
2137Srgrimestrap : 3	# shouldn't be needed
2237Srgrimes
2351231SsheldonhHOME=/
2420684SjoergPATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin
2551231Ssheldonhexport HOME PATH
2637Srgrimes
2743179Sdillon# BOOTP diskless boot.  We have to run the rc file early in order to
2843803Sdillon# retarget various config files.
2943179Sdillon#
3051231Ssheldonhif [ -r /etc/rc.diskless1 ]; then
3143375Sdillon	dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null`
3243375Sdillon	if [ ${dlv:=0} != 0 ]; then
3343803Sdillon		. /etc/rc.diskless1
3443179Sdillon	fi
3543179Sdillonfi
3643179Sdillon
3743219Speter# If there is a global system configuration file, suck it in.
3843219Speter#
3951231Ssheldonhif [ -r /etc/defaults/rc.conf ]; then
4043849Sjkh	. /etc/defaults/rc.conf
4151231Ssheldonhelif [ -r /etc/rc.conf ]; then
4243219Speter	. /etc/rc.conf
4343219Speterfi
4443219Speter
4515568Sasami# Configure ccd devices.
4651231Ssheldonh#
4751231Ssheldonhif [ -r /etc/ccd.conf ]; then
4815568Sasami	ccdconfig -C
4915568Sasamifi
5015568Sasami
5151231Ssheldonhcase ${start_vinum} in
5251231Ssheldonh[Yy][Ee][Ss])
5345239Sgrog	vinum start
5451231Ssheldonh	;;
5551231Ssheldonh*)
5651231Ssheldonh	if [ -n "${vinum_drives}" ]; then
5751231Ssheldonh		vinum read ${vinum_drives}
5851231Ssheldonh	fi
5951231Ssheldonh	;;
6051231Ssheldonhesac
6142741Sgrog
6243803Sdillonswapon -a
633843Sdg
6451231Ssheldonhcase $1 in
6551231Ssheldonhautoboot)
6637Srgrimes	echo Automatic reboot in progress...
6737Srgrimes	fsck -p
6837Srgrimes	case $? in
6937Srgrimes	0)
7037Srgrimes		;;
7137Srgrimes	2)
7237Srgrimes		exit 1
7337Srgrimes		;;
7437Srgrimes	4)
7537Srgrimes		reboot
7637Srgrimes		echo "reboot failed... help!"
7737Srgrimes		exit 1
7837Srgrimes		;;
7937Srgrimes	8)
8037Srgrimes		echo "Automatic file system check failed... help!"
8137Srgrimes		exit 1
8237Srgrimes		;;
8337Srgrimes	12)
8437Srgrimes		echo "Reboot interrupted"
8537Srgrimes		exit 1
8637Srgrimes		;;
8737Srgrimes	130)
8837Srgrimes		# interrupt before catcher installed
8937Srgrimes		exit 1
9037Srgrimes		;;
9137Srgrimes	*)
9237Srgrimes		echo "Unknown error in reboot"
9337Srgrimes		exit 1
9437Srgrimes		;;
9537Srgrimes	esac
9651231Ssheldonh	;;
9751231Ssheldonh*)
982164Sdg	echo Skipping disk checks ...
9951231Ssheldonh	;;
10051231Ssheldonhesac
10137Srgrimes
10245222Scracauerset -T
10337Srgrimestrap "echo 'Reboot interrupted'; exit 1" 3
10437Srgrimes
10543197Sdillon# root normally must be read/write, but if this is a BOOTP NFS
10643197Sdillon# diskless boot it does not have to be.
10743197Sdillon#
10851231Ssheldonhcase ${root_rw_mount} in
10951231Ssheldonh[Nn][Oo] | '')
11051231Ssheldonh	;;
11151231Ssheldonh*)
11251231Ssheldonh	if ! mount -u -o rw / ; then
11351231Ssheldonh		echo "Mounting root filesystem rw failed, startup aborted"
11451231Ssheldonh		exit 1
11551231Ssheldonh	fi
11651231Ssheldonh	;;
11751231Ssheldonhesac
1181692Sphk
11943803Sdillonumount -a >/dev/null 2>&1
12043197Sdillon
12151231Ssheldonh# Where/how would this get set?
12251231Ssheldonh#
12351231Ssheldonhcase ${early_nfs_mounts} in
12451231Ssheldonh[Yy][Ee][Ss])
12551231Ssheldonh	mount -a
12651231Ssheldonh	;;
12751231Ssheldonh*)
12843197Sdillon	mount -a -t nonfs
12951231Ssheldonh	;;
13051231Ssheldonhesac
13151231Ssheldonh
13251231Ssheldonhcase $? in
13351231Ssheldonh0)
13451231Ssheldonh	;;
13551231Ssheldonh*)
13651231Ssheldonh	echo "Mounting /etc/fstab filesystems failed, startup aborted"
13743803Sdillon	exit 1
13851231Ssheldonh	;;
13951231Ssheldonhesac
14037Srgrimes
14143197Sdillon# Run custom disk mounting function here
14243197Sdillon#
14351231Ssheldonhif [ -n "${diskless_mount}" -a -r "${diskless_mount}" ]; then
14450357Ssheldonh		sh ${diskless_mount}
14543197Sdillonfi
14643197Sdillon
1474091Sacheadjkerntz -i
148872Sache
14938237Sbrianclean_var() {
15039384Sbrian	if [ ! -f /var/run/clean_var ]; then
15139384Sbrian		rm -rf /var/run/*
15239384Sbrian		rm -f /var/spool/lock/*
15339384Sbrian		rm -rf /var/spool/uucp/.Temp/*
15439384Sbrian		# Keep a copy of the boot messages around
15539384Sbrian		dmesg >/var/run/dmesg.boot
15639384Sbrian		# And an initial utmp file
15751231Ssheldonh		(cd /var/run && cp /dev/null utmp && chmod 644 utmp;)
15839384Sbrian		>/var/run/clean_var
15939384Sbrian	fi
16038237Sbrian}
16126450Sache
16238237Sbrianif [ -d /var/run -a -d /var/spool/lock -a -d /var/spool/uucp/.Temp ]; then
16339384Sbrian	# network_pass1() *may* end up writing stuff to /var - we don't want to
16439384Sbrian	# remove it immediately afterwards - *nor* to we want to fail to clean
16539384Sbrian	# an nfs-mounted /var.
16639384Sbrian	clean_var
16738237Sbrianfi
16821197Sphk
16917767Sjkh# Add additional swapfile, if configured.
17051231Ssheldonh#
17151231Ssheldonhcase ${swapfile} in
17251231Ssheldonh[Nn][Oo] | '')
17351231Ssheldonh	;;
17451231Ssheldonh*)
17551231Ssheldonh	if [ -w "${swapfile}" -a -b /dev/vn0b ]; then
17651231Ssheldonh		echo "Adding ${swapfile} as additional swap."
17751231Ssheldonh		vnconfig /dev/vn0b ${swapfile} && swapon /dev/vn0b
17851231Ssheldonh	fi
17951231Ssheldonh	;;
18051231Ssheldonhesac
18117767Sjkh
18251231Ssheldonh# Set sysctl variables as early as we can
18351231Ssheldonh#
18451231Ssheldonhif [ -r /etc/rc.sysctl ]; then
18545096Simp	. /etc/rc.sysctl
18645096Simpfi
18745096Simp
18851231Ssheldonh# Configure serial devices
18951231Ssheldonh#
19051231Ssheldonhif [ -r /etc/rc.serial ]; then
1917293Sjkh	. /etc/rc.serial
1921675Sachefi
1931675Sache
19451231Ssheldonh# Start up PC-card configuration
19551231Ssheldonh#
19651231Ssheldonhif [ -r /etc/rc.pccard ]; then
19714624Snate	. /etc/rc.pccard
19814596Snatefi
19914596Snate
20051231Ssheldonh# Start up the initial network configuration.
20151231Ssheldonh#
20251231Ssheldonhif [ -r /etc/rc.network ]; then
20325184Sjkh	. /etc/rc.network	# We only need to do this once.
20425184Sjkh	network_pass1
2057460Sjkhfi
2067460Sjkh
20751231Ssheldonh# Retest for early_nfs here?
20851231Ssheldonh#
20938456Sphkecho -n "Mounting NFS file systems"
21029319Sbrianmount -a -t nfs
21138456Sphkecho .
2127487Srgrimes
2137487Srgrimes# Whack the pty perms back into shape.
21451231Ssheldonh#
21549366Simpchflags 0 /dev/tty[pqrsPQRS]*
21620828Sjoergchmod 666 /dev/tty[pqrsPQRS]*
21744752Sdeschown root:wheel /dev/tty[pqrsPQRS]*
2187487Srgrimes
21951231Ssheldonh# Clean up left-over files
22051231Ssheldonh#
22138237Sbrianclean_var			# If it hasn't already been done
22238237Sbrianrm /var/run/clean_var
22338237Sbrian
22431192Ssteve# Clearing /tmp at boot-time seems to have a long tradition.  It doesn't
22531192Ssteve# help in any way for long-living systems, and it might accidentally
22631192Ssteve# clobber files you would rather like to have preserved after a crash
22731192Ssteve# (if not using mfs /tmp anyway).
22831192Ssteve#
22931192Ssteve# See also the example of another cleanup policy in /etc/periodic/daily.
23031192Ssteve#
23151231Ssheldonhcase ${clear_tmp_enable} in
23251231Ssheldonh[Yy][Ee][Ss])
23331192Ssteve	echo clearing /tmp
23431192Ssteve	# prune quickly with one rm, then use find to clean up /tmp/[lq]*
23531192Ssteve	# (not needed with mfs /tmp, but doesn't hurt there...)
23631192Ssteve	(cd /tmp && rm -rf [a-km-pr-zA-Z]* &&
23751231Ssheldonh		find -d . ! -name . ! -name lost+found ! -name quota.user \
23851231Ssheldonh		! -name quota.group -exec rm -rf -- {} \;)
23951231Ssheldonh	;;
24051231Ssheldonhesac
24131192Ssteve
24251231Ssheldonh# Remove X lock files, since they will prevent you from restarting X11
24338915Scracauer# after a system crash.
24451231Ssheldonh#
24538915Scracauerrm -f /tmp/.X*-lock /tmp/.X11-unix/*
24638915Scracauer
24751231Ssheldonh# Snapshot any kernel -c changes back to disk here <someday>.
24851231Ssheldonh# This has changed with ELF and /kernel.config.
2497487Srgrimes
25025339Sjkhecho -n 'additional daemons:'
25151231Ssheldonh
25251231Ssheldonh# Start system logging and name service.  Named needs to start before syslogd
25351231Ssheldonh# if you don't have a /etc/resolv.conf.
2547259Sjkh#
25551231Ssheldonhcase ${syslogd_enable} in
25651231Ssheldonh[Yy][Ee][Ss])
25724463Spst	# Transitional symlink (for the next couple of years :) until all
25851231Ssheldonh	# binaries have had a chance to move towards /var/run/log.
25951231Ssheldonh	if [ ! -h /dev/log ]; then
26024463Spst		# might complain for r/o root f/s
26124463Spst		ln -sf /var/run/log /dev/log
26224463Spst	fi
26324463Spst
26424463Spst	rm -f /var/run/log
26551231Ssheldonh	echo -n ' syslogd';	syslogd ${syslogd_flags}
26651231Ssheldonh	;;
26751231Ssheldonhesac
26851231Ssheldonh
26925339Sjkhecho '.'
27025339Sjkh
27151231Ssheldonh# Enable dumpdev so that savecore can see it.
27232340Sjoerg# /var/crash should be a directory or a symbolic link
27332340Sjoerg# to the crash directory if core dumps are to be saved.
27451231Ssheldonh#
27551231Ssheldonhcase ${dumpdev} in
27651231Ssheldonh[Nn][Oo] | '')
27751231Ssheldonh	;;
27851231Ssheldonh*)
27951231Ssheldonh	if [ -e "${dumpdev}" -a -d /var/crash ]; then
28051231Ssheldonh		dumpon ${dumpdev}
28151231Ssheldonh		echo -n checking for core dump...
28251231Ssheldonh		savecore /var/crash
28351231Ssheldonh	fi
28451231Ssheldonh	;;
28551231Ssheldonhesac
28632340Sjoerg
28750357Ssheldonhif [ -n "${network_pass1_done}" ]; then
28839384Sbrian	network_pass2
289857Sdgfi
29037Srgrimes
29144818Sbillf# Enable/Check the quotas (must be after ypbind if using NIS)
29251231Ssheldonh#
29351231Ssheldonhcase ${enable_quotas} in
29451231Ssheldonh[Yy][Ee][Ss])
29551231Ssheldonh	case ${check_quotas} in
29651231Ssheldonh	[Yy][Ee][Ss])
29751231Ssheldonh		echo -n 'checking quotas:'
29851231Ssheldonh		quotacheck -a
29951231Ssheldonh		echo ' done.'
30051231Ssheldonh		;;
30151231Ssheldonh	esac
30244818Sbillf
30351231Ssheldonh	echo -n 'enabling quotas:'
30451231Ssheldonh	quotaon -a
30551231Ssheldonh	echo ' done.'
30651231Ssheldonh	;;
30751231Ssheldonhesac
30844818Sbillf
30950357Ssheldonhif [ -n "${network_pass2_done}" ]; then
31039384Sbrian	network_pass3
3117477Sachefi
3127477Sache
31351231Ssheldonh# Build ps databases
31451231Ssheldonh#
31551231Ssheldonhkvm_mkdb
3167487Srgrimesdev_mkdb
3177487Srgrimes
31851231Ssheldonh# Check the password temp/lock file
31951231Ssheldonh#
32051231Ssheldonhif [ -e /etc/ptmp ]; then
3217487Srgrimes	logger -s -p auth.err \
3227487Srgrimes	"password file may be incorrect -- /etc/ptmp exists"
3237238Sachefi
3247238Sache
32551231Ssheldonhcase ${accounting_enable} in
32651231Ssheldonh[Yy][Ee][Ss])
32751231Ssheldonh	if [ -d /var/account ]; then
32851231Ssheldonh		echo 'turning on accounting'
32951231Ssheldonh		if [ ! -e /var/account/acct ]; then
33051231Ssheldonh			touch /var/account/acct
33151231Ssheldonh		fi
33251231Ssheldonh		accton /var/account/acct
33311992Sache	fi
33451231Ssheldonh	;;
33551231Ssheldonhesac
3367238Sache
33727365Sjkh# Make shared lib searching a little faster.  Leave /usr/lib first if you
33827365Sjkh# add your own entries or you may come to grief.
33951231Ssheldonh#
34038512Sgpalmerif [ -x /sbin/ldconfig ]; then
34151231Ssheldonh	case `/usr/bin/objformat` in
34251231Ssheldonh	elf)
34339329Sjdp		_LDC=/usr/lib
34450357Ssheldonh		for i in ${ldconfig_paths}; do
34551231Ssheldonh			if [ -d "${i}" ]; then
34650357Ssheldonh				_LDC="${_LDC} ${i}"
34739329Sjdp			fi
34839329Sjdp		done
34939329Sjdp		echo 'setting ELF ldconfig path:' ${_LDC}
35039329Sjdp		ldconfig -elf ${_LDC}
35151231Ssheldonh		;;
35251231Ssheldonh	esac
35339329Sjdp
35441648Sjb	# Legacy aout support for i386 only
35551231Ssheldonh	case `sysctl -n hw.machine` in
35651231Ssheldonh	i386)
35743951Sjkh		# Default the a.out ldconfig path.
35841648Sjb		: ${ldconfig_paths_aout=${ldconfig_paths}}
35941648Sjb		_LDC=/usr/lib/aout
36050357Ssheldonh		for i in ${ldconfig_paths_aout}; do
36151231Ssheldonh			if [ -d "${i}" ]; then
36250357Ssheldonh				_LDC="${_LDC} ${i}"
36341648Sjb			fi
36441648Sjb		done
36541648Sjb		echo 'setting a.out ldconfig path:' ${_LDC}
36641648Sjb		ldconfig -aout ${_LDC}
36751231Ssheldonh		;;
36851231Ssheldonh	esac
36938512Sgpalmerfi
3707296Sjkh
37117210Spst# Now start up miscellaneous daemons that don't belong anywhere else
37217210Spst#
37325339Sjkhecho -n starting standard daemons:
37451231Ssheldonhcase ${inetd_enable} in
37551231Ssheldonh[Nn][Oo])
37651231Ssheldonh	;;
37751231Ssheldonh*)
37826727Spst	echo -n ' inetd';	inetd ${inetd_flags}
37951231Ssheldonh	;;
38051231Ssheldonhesac
38117210Spst
38251231Ssheldonhcase ${cron_enable} in
38351231Ssheldonh[Nn][Oo])
38451231Ssheldonh	;;
38551231Ssheldonh*)
38626727Spst	echo -n ' cron';	cron
38751231Ssheldonh	;;
38851231Ssheldonhesac
38926727Spst
39051231Ssheldonhcase ${lpd_enable} in
39151231Ssheldonh[Yy][Ee][Ss])
39251231Ssheldonh	echo -n ' printer';	${lpd_program:-/usr/sbin/lpd} ${lpd_flags}
39351231Ssheldonh	;;
39451231Ssheldonhesac
39517210Spst
39651231Ssheldonhcase ${sendmail_enable} in
39751231Ssheldonh[Yy][Ee][Ss])
39851231Ssheldonh	if [ -r /etc/sendmail.cf ]; then
39951231Ssheldonh		echo -n ' sendmail';	/usr/sbin/sendmail ${sendmail_flags}
40051231Ssheldonh	fi
40151231Ssheldonh	;;
40251231Ssheldonhesac
40317161Spst
40451231Ssheldonhcase ${usbd_enable} in
40551231Ssheldonh[Yy][Ee][Ss])
40642498Sn_hibma	echo -n ' usbd';	/usr/sbin/usbd ${usbd_flags}
40751231Ssheldonh	;;
40851231Ssheldonhesac
40942498Sn_hibma
41017161Spstecho '.'
41117161Spst
41251231Ssheldonh# Configure implementation specific stuff
41351231Ssheldonh#
4147487Srgrimesarch=`uname -m`
41551231Ssheldonhif [ -r /etc/rc.${arch} ]; then
41625469Sandreas	. /etc/rc.${arch}
41725469Sandreasfi
4187487Srgrimes
41916671Spst# Recover vi editor files.
42050612Simpfind /var/tmp/vi.recover ! -type f -a ! -type d -delete
42119314Spetervibackup=`echo /var/tmp/vi.recover/vi.*`
42250357Ssheldonhif [ "${vibackup}" != '/var/tmp/vi.recover/vi.*' ]; then
42316671Spst	echo 'Recovering vi editor sessions'
42450357Ssheldonh	for i in ${vibackup}; do
42519314Speter		# Only test files that are readable.
42651231Ssheldonh		if [ ! -r "${i}" ]; then
42719314Speter			continue
42819314Speter		fi
42919314Speter
43019314Speter		# Unmodified nvi editor backup files either have the
43119314Speter		# execute bit set or are zero length.  Delete them.
43251231Ssheldonh		if [ -x "${i}" -o ! -s "${i}" ]; then
43350357Ssheldonh			rm -f ${i}
43419314Speter		fi
43516671Spst	done
43619314Speter
43719314Speter	# It is possible to get incomplete recovery files, if the editor
43819314Speter	# crashes at the right time.
43919314Speter	virecovery=`echo /var/tmp/vi.recover/recover.*`
44050357Ssheldonh	if [ "${virecovery}" != "/var/tmp/vi.recover/recover.*" ]; then
44150357Ssheldonh		for i in ${virecovery}; do
44219314Speter			# Only test files that are readable.
44351231Ssheldonh			if [ ! -r "${i}" ]; then
44419314Speter				continue
44519314Speter			fi
44619314Speter
44719314Speter			# Delete any recovery files that are zero length,
44819314Speter			# corrupted, or that have no corresponding backup file.
44919314Speter			# Else send mail to the user.
45050357Ssheldonh			recfile=`awk '/^X-vi-recover-path:/{print $2}' < ${i}`
45151231Ssheldonh			if [ -n "${recfile}" -a -s "${recfile}" ]; then
45250357Ssheldonh				sendmail -t < ${i}
45319314Speter			else
45450357Ssheldonh				rm -f ${i}
45519314Speter			fi
45619314Speter		done
45719314Speter	fi
45816671Spstfi
45916671Spst
46051231Ssheldonh# Make a bounds file for msgs(1) if there isn't one already
46151231Ssheldonh# "Delete important files with symlink" security hole?
46251231Ssheldonh#
46351231Ssheldonhif [ -d /var/msgs -a ! -f /var/msgs/bounds ]; then
46437899Snectar	echo 0 > /var/msgs/bounds
46537899Snectarfi
46637899Snectar
46751231Ssheldonh# For each valid dir in $local_startup, search for init scripts matching *.sh
46851231Ssheldonh#
46951231Ssheldonhcase ${local_startup} in
47051231Ssheldonh[Nn][Oo] | '')
47151231Ssheldonh	;;
47251231Ssheldonh*)
47327365Sjkh	echo -n 'Local package initialization:'
47413071Sjkh	for dir in ${local_startup}; do
47551231Ssheldonh		if [ -d "${dir}" ]; then
47651231Ssheldonh			for script in ${dir}/*.sh; do
47751231Ssheldonh				if [ -x "${script}" ]; then
47851231Ssheldonh					(set -T
47951231Ssheldonh					 trap 'exit 1' 2
48051231Ssheldonh					 ${script} start)
48151231Ssheldonh				fi
48251231Ssheldonh			done
48351231Ssheldonh		fi
48410873Sjkh	done
48516391Sjkh	echo .
48651231Ssheldonh	;;
48751231Ssheldonhesac
48837Srgrimes
48951231Ssheldonhcase ${update_motd} in
49051231Ssheldonh[Nn][Oo] | '')
49151231Ssheldonh	;;
49251231Ssheldonh*)
49351231Ssheldonh	if T=`mktemp /tmp/_motd.XXXXXX`; then
49450357Ssheldonh		uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > ${T}
49550357Ssheldonh		awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> ${T}
49650357Ssheldonh		cmp -s ${T} /etc/motd || {
49750357Ssheldonh			cp ${T} /etc/motd
49849451Speter			chmod 644 /etc/motd
49949451Speter		}
50050357Ssheldonh		rm -f ${T}
50149451Speter	fi
50251231Ssheldonh	;;
50351231Ssheldonhesac
50451231Ssheldonh
50551231Ssheldonh# Run rc.devfs if readable to customize devfs
50651231Ssheldonh#
50751231Ssheldonhif [ -r /etc/rc.devfs ]; then
50851231Ssheldonh	sh /etc/rc.devfs
50941704Sdillonfi
51041704Sdillon
51141704Sdillon# Do traditional (but rather obsolete) rc.local file if it exists.  If you
51243951Sjkh# use this file and want to make it programmatic, source /etc/defaults/rc.conf
51343951Sjkh# in /etc/rc.local and add your custom variables to /etc/rc.conf, as
51443951Sjkh# shown below.  Please do not put local extensions into /etc/rc itself.
51541704Sdillon# Use /etc/rc.local
51641704Sdillon#
51751231Ssheldonh# ---- rc.local ----
51851231Ssheldonh#	if [ -r /etc/defaults/rc.conf ]; then
51951231Ssheldonh#		. /etc/defaults/rc.conf
52051231Ssheldonh#	fi
52151231Ssheldonh#
52251231Ssheldonh#	... additional startup conditionals ...
52351231Ssheldonh# ---- rc.local ----
52451231Ssheldonh#
52551231Ssheldonhif [ -r /etc/rc.local ]; then
52643197Sdillon	echo -n 'starting local daemons:'
52751231Ssheldonh	sh /etc/rc.local
52843197Sdillon	echo '.'
52941704Sdillonfi
53041704Sdillon
53137106Sjkoshy# Raise kernel security level.  This should be done only after `fsck' has
53237106Sjkoshy# repaired local file systems if you want the securelevel to be greater than 1.
53351231Ssheldonh#
53451231Ssheldonhcase ${kern_securelevel_enable} in
53551231Ssheldonh[Yy][Ee][Ss])
53651231Ssheldonh	if [ "${kern_securelevel}" -ge 0 ]; then
53751231Ssheldonh		echo 'Raising kernel security level'
53851231Ssheldonh		sysctl -w kern.securelevel=${kern_securelevel}
53951231Ssheldonh	fi
54051231Ssheldonh	;;
54151231Ssheldonhesac
54237106Sjkoshy
54337Srgrimesdate
54437Srgrimesexit 0
545