rc revision 73277
1#!/bin/sh 2# 3# Copyright (c) 2000 The FreeBSD Project 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions 8# are met: 9# 1. Redistributions of source code must retain the above copyright 10# notice, this list of conditions and the following disclaimer. 11# 2. Redistributions in binary form must reproduce the above copyright 12# notice, this list of conditions and the following disclaimer in the 13# documentation and/or other materials provided with the distribution. 14# 15# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25# SUCH DAMAGE. 26# 27# $FreeBSD: head/etc/rc 73277 2001-03-01 13:19:49Z dougb $ 28# From: @(#)rc 5.27 (Berkeley) 6/5/91 29# 30 31# System startup script run by init on autoboot 32# or after single-user. 33# Output and error are redirected to console by init, 34# and the console is the controlling terminal. 35 36# Note that almost all of the user-configurable behavior is no longer in 37# this file, but rather in /etc/defaults/rc.conf. Please check that file 38# first before contemplating any changes here. If you do need to change 39# this file for some reason, we would like to know about it. 40 41stty status '^T' 42 43# Set shell to ignore SIGINT (2), but not children; 44# shell catches SIGQUIT (3) and returns to single user after fsck. 45# 46trap : 2 47trap : 3 # shouldn't be needed 48 49bootmode=$1 50 51HOME=/ 52PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin 53export HOME PATH 54 55# BOOTP diskless boot. We have to run the rc file early in order to 56# retarget various config files. 57# 58if [ -r /etc/rc.diskless1 ]; then 59 dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null` 60 if [ ${dlv:=0} != 0 ]; then 61 . /etc/rc.diskless1 62 fi 63fi 64 65# If there is a global system configuration file, suck it in. 66# 67if [ -r /etc/defaults/rc.conf ]; then 68 . /etc/defaults/rc.conf 69 source_rc_confs 70elif [ -r /etc/rc.conf ]; then 71 . /etc/rc.conf 72fi 73 74feed_dev_random() { 75 if [ -f "${1}" -a -r "${1}" -a -s "${1}" ]; then 76 echo "Using ${1} as an entropy file" 77 cat "${1}" | dd of=/dev/random bs=8k 2>/dev/null 78 fi 79} 80 81chkdepend() { 82 svc=$1 83 svc_var=$2 84 dep=$3 85 dep_var=$4 86 87 eval svc_val=\${$svc_var} 88 eval dep_val=\${$dep_var} 89 90 case ${svc_val} in 91 [Yy][Ee][Ss]) 92 case ${dep_val} in 93 [Yy][Ee][Ss]) 94 ;; 95 *) 96 eval ${dep_var}="YES" 97 echo "DEPENDENCY NOTE: ${dep} will be enabled" \ 98 "to support ${svc}" 99 ;; 100 esac 101 ;; 102 esac 103} 104 105chkdepend amd amd_enable portmap portmap_enable 106chkdepend NFS nfs_server_enable portmap portmap_enable 107chkdepend NIS nis_server_enable portmap portmap_enable 108chkdepend NIS nis_client_enable portmap portmap_enable 109 110# Enable harvesting of entropy via devices. The sooner this happens the 111# better so that we can take advantage of the boot process. 112# 113echo -n 'Entropy harvesting:' 114 115case ${harvest_interrupt} in 116[Nn][Oo]) 117 ;; 118*) 119 if [ -w /dev/random ]; then 120 /sbin/sysctl -w kern.random.sys.harvest_interrupt=1 >/dev/null 121 echo -n ' interrupts' 122 fi 123 ;; 124esac 125 126# Steal some code from rc.network to help determine what to enable. 127case ${network_interfaces} in 128[Aa][Uu][Tt][Oo]) 129 h_network_interfaces="`ifconfig -l`" 130 ;; 131*) 132 h_network_interfaces="${network_interfaces}" 133 ;; 134esac 135 136case ${harvest_ethernet} in 137[Nn][Oo]) 138 ;; 139*) 140 do_ether_harvest='' 141 142 for h_ifn in ${h_network_interfaces}; do 143 eval h_ifconfig_args=\$ifconfig_${h_ifn} 144 case ${h_ifconfig_args} in 145 '') 146 ;; 147 *) 148 do_ether_harvest=1 149 ;; 150 esac 151 done 152 153 if [ -w /dev/random -a "${do_ether_harvest}" ]; then 154 /sbin/sysctl -w kern.random.sys.harvest_ethernet=1 >/dev/null 155 echo -n ' ethernet' 156 fi 157 ;; 158esac 159 160case ${harvest_p_to_p} in 161[Nn][Oo]) 162 ;; 163*) 164 do_p_to_p_harvest='' 165 166 # Other than user ppp, tun* will already exist 167 case "${h_network_interfaces}" in 168 *tun0*) 169 do_p_to_p_harvest=1 170 ;; 171 esac 172 173 case ${ppp_enable} in 174 [Yy][Ee][Ss]) 175 do_p_to_p_harvest=1 176 ;; 177 esac 178 179 if [ -w /dev/random -a "${do_p_to_p_harvest}" ]; then 180 /sbin/sysctl -w kern.random.sys.harvest_point_to_point=1 >/dev/null 181 echo -n ' point_to_point' 182 fi 183 ;; 184esac 185 186echo '.' 187 188# First pass at reseeding /dev/random. 189# 190# XXX temporary until we can get the entropy 191# harvesting rate up 192# Entropy below is not great, 193# but better than nothing. 194( ps -efauxww; sysctl -a; date; df -ib; dmesg; ps -efauxww; ) \ 195 | dd of=/dev/random bs=8k 2>/dev/null 196cat /bin/ls | dd of=/dev/random bs=8k 2>/dev/null 197 198case ${entropy_file} in 199[Nn][Oo] | '') 200 ;; 201*) 202 if [ -w /dev/random ]; then 203 feed_dev_random "${entropy_file}" 204 fi 205 ;; 206esac 207 208# Configure ccd devices. 209# 210if [ -r /etc/ccd.conf ]; then 211 ccdconfig -C 212fi 213 214case ${start_vinum} in 215[Yy][Ee][Ss]) 216 vinum start 217 ;; 218esac 219 220swapon -a 221 222case ${bootmode} in 223autoboot) 224 echo 'Automatic boot in progress...' 225 fsck -p 226 case $? in 227 0) 228 ;; 229 2) 230 exit 1 231 ;; 232 4) 233 reboot 234 echo 'Reboot failed... help!' 235 exit 1 236 ;; 237 8) 238 case ${fsck_y_enable} in 239 [Yy][Ee][Ss]) 240 echo 'File system preen failed, trying fsck -y . . .' 241 fsck -y 242 case $? in 243 0) 244 ;; 245 *) 246 echo 'Automatic file system check failed . . . help!' 247 exit 1 248 ;; 249 esac 250 ;; 251 *) 252 echo 'Automatic file system check failed . . . help!' 253 exit 1 254 ;; 255 esac 256 ;; 257 12) 258 echo 'Reboot interrupted' 259 exit 1 260 ;; 261 130) 262 # interrupt before catcher installed 263 exit 1 264 ;; 265 *) 266 echo 'Unknown error in reboot' 267 exit 1 268 ;; 269 esac 270 ;; 271*) 272 echo 'Skipping disk checks ...' 273 ;; 274esac 275 276set -T 277trap "echo 'Reboot interrupted'; exit 1" 3 278 279# root normally must be read/write, but if this is a BOOTP NFS 280# diskless boot it does not have to be. 281# 282case ${root_rw_mount} in 283[Nn][Oo] | '') 284 ;; 285*) 286 if ! mount -u -o rw / ; then 287 echo 'Mounting root filesystem rw failed, startup aborted' 288 exit 1 289 fi 290 ;; 291esac 292 293umount -a >/dev/null 2>&1 294 295# Mount everything except nfs filesystems. 296mount -a -t nonfs 297 298case $? in 2990) 300 ;; 301*) 302 echo 'Mounting /etc/fstab filesystems failed, startup aborted' 303 exit 1 304 ;; 305esac 306 307# Run custom disk mounting function here 308# 309if [ -n "${diskless_mount}" -a -r "${diskless_mount}" ]; then 310 sh ${diskless_mount} 311fi 312 313# Reseed /dev/random with previously stored entropy. 314case ${entropy_dir} in 315[Nn][Oo]) 316 ;; 317*) 318 entropy_dir=${entropy_dir:-/var/db/entropy} 319 if [ -d "${entropy_dir}" ]; then 320 if [ -w /dev/random ]; then 321 for seedfile in ${entropy_dir}/*; do 322 feed_dev_random "${seedfile}" 323 done 324 fi 325 fi 326 ;; 327esac 328 329case ${entropy_file} in 330[Nn][Oo] | '') 331 ;; 332*) 333 if [ -w /dev/random ]; then 334 feed_dev_random "${entropy_file}" 335 fi 336 ;; 337esac 338 339adjkerntz -i 340 341purgedir() { 342 local dir file 343 344 if [ $# -eq 0 ]; then 345 purgedir . 346 else 347 for dir 348 do 349 ( 350 cd "$dir" && for file in .* * 351 do 352 [ ."$file" = .. -o ."$file" = ... ] && continue 353 [ -d "$file" -a ! -L "$file" ] && 354 purgedir "$file" 355 [ -f "$file" ] && rm -f -- "$file" 356 done 357 ) 358 done 359 fi 360} 361 362clean_var() { 363 if [ ! -f /var/run/clean_var ]; then 364 purgedir /var/run /var/spool/lock 365 rm -rf /var/spool/uucp/.Temp/* 366 # Keep a copy of the boot messages around 367 dmesg >/var/run/dmesg.boot 368 # And an initial utmp file 369 (cd /var/run && cp /dev/null utmp && chmod 644 utmp;) 370 >/var/run/clean_var 371 fi 372} 373 374if [ -d /var/run -a -d /var/spool/lock -a -d /var/spool/uucp/.Temp ]; then 375 # network_pass1() *may* end up writing stuff to /var - we don't want to 376 # remove it immediately afterwards - *nor* to we want to fail to clean 377 # an nfs-mounted /var. 378 clean_var 379fi 380 381# Add additional swapfile, if configured. 382# 383case ${swapfile} in 384[Nn][Oo] | '') 385 ;; 386*) 387 if [ -w "${swapfile}" -a -c /dev/vn0b ]; then 388 echo "Adding ${swapfile} as additional swap" 389 vnconfig /dev/vn0b ${swapfile} && swapon /dev/vn0b 390 fi 391 ;; 392esac 393 394# Set sysctl variables as early as we can 395# 396if [ -r /etc/rc.sysctl ]; then 397 . /etc/rc.sysctl 398fi 399 400# Configure serial devices 401# 402if [ -r /etc/rc.serial ]; then 403 . /etc/rc.serial 404fi 405 406# Start up PC-card configuration 407# 408if [ -r /etc/rc.pccard ]; then 409 . /etc/rc.pccard 410fi 411 412# Start up the initial network configuration. 413# 414if [ -r /etc/rc.network ]; then 415 . /etc/rc.network # We only need to do this once. 416 network_pass1 417fi 418 419case ${ipv6_enable} in 420[Yy][Ee][Ss]) 421 if [ -r /etc/rc.network6 ]; then 422 . /etc/rc.network6 # We only need to do this once also. 423 network6_pass1 424 fi 425 ;; 426esac 427 428# Mount NFS filesystems if present in /etc/fstab 429case "`mount -d -a -t nfs`" in 430*mount_nfs*) 431 echo -n 'Mounting NFS file systems:' 432 mount -a -t nfs 433 echo '.' 434 ;; 435esac 436 437# Whack the pty perms back into shape. 438# 439if ls /dev/tty[pqrsPQRS]* > /dev/null 2>&1; then 440 chflags 0 /dev/tty[pqrsPQRS]* 441 chmod 666 /dev/tty[pqrsPQRS]* 442 chown root:wheel /dev/tty[pqrsPQRS]* 443fi 444 445# Clean up left-over files 446# 447clean_var # If it hasn't already been done 448rm /var/run/clean_var 449 450# Clearing /tmp at boot-time seems to have a long tradition. It doesn't 451# help in any way for long-living systems, and it might accidentally 452# clobber files you would rather like to have preserved after a crash 453# (if not using mfs /tmp anyway). 454# 455# See also the example of another cleanup policy in /etc/periodic/daily. 456# 457case ${clear_tmp_enable} in 458[Yy][Ee][Ss]) 459 echo -n 'Clearing /tmp:' 460 # prune quickly with one rm, then use find to clean up /tmp/[lq]* 461 # (not needed with mfs /tmp, but doesn't hurt there...) 462 (cd /tmp && rm -rf [a-km-pr-zA-Z]* && 463 find -d . ! -name . ! -name lost+found ! -name quota.user \ 464 ! -name quota.group -exec rm -rf -- {} \;) 465 echo '.' 466 ;; 467esac 468 469# Remove X lock files, since they will prevent you from restarting X11 470# after a system crash. 471# 472rm -f /tmp/.X*-lock /tmp/.X11-unix/* 473 474# Snapshot any kernel -c changes back to disk here <someday>. 475# This has changed with ELF and /kernel.config. 476 477echo -n 'Additional daemons:' 478 479# Start system logging and name service. Named needs to start before syslogd 480# if you don't have a /etc/resolv.conf. 481# 482case ${syslogd_enable} in 483[Yy][Ee][Ss]) 484 # Transitional symlink (for the next couple of years :) until all 485 # binaries have had a chance to move towards /var/run/log. 486 if [ ! -h /dev/log ]; then 487 # might complain for r/o root f/s 488 ln -sf /var/run/log /dev/log 489 fi 490 491 rm -f /var/run/log 492 echo -n ' syslogd'; syslogd ${syslogd_flags} 493 ;; 494esac 495 496echo '.' 497 498# Build device name databases if we are not using DEVFS 499# 500if sysctl vfs.devfs.generation > /dev/null 2>&1 ; then 501 rm -f /var/run/dev.db 502else 503 dev_mkdb 504fi 505 506# Enable dumpdev so that savecore can see it. 507# /var/crash should be a directory or a symbolic link 508# to the crash directory if core dumps are to be saved. 509# 510case ${dumpdev} in 511[Nn][Oo] | '') 512 ;; 513*) 514 if [ -e "${dumpdev}" -a -d /var/crash ]; then 515 dumpon -v ${dumpdev} 516 echo -n 'Checking for core dump: ' 517 savecore /var/crash 518 fi 519 ;; 520esac 521 522if [ -n "${network_pass1_done}" ]; then 523 network_pass2 524fi 525 526# Enable/Check the quotas (must be after ypbind if using NIS) 527# 528case ${enable_quotas} in 529[Yy][Ee][Ss]) 530 case ${check_quotas} in 531 [Yy][Ee][Ss]) 532 echo -n 'Checking quotas:' 533 quotacheck -a 534 echo ' done.' 535 ;; 536 esac 537 538 echo -n 'Enabling quotas:' 539 quotaon -a 540 echo ' done.' 541 ;; 542esac 543 544if [ -n "${network_pass2_done}" ]; then 545 network_pass3 546fi 547 548# Check the password temp/lock file 549# 550if [ -e /etc/ptmp ]; then 551 logger -s -p auth.err \ 552 "password file may be incorrect -- /etc/ptmp exists" 553fi 554 555case ${accounting_enable} in 556[Yy][Ee][Ss]) 557 if [ -d /var/account ]; then 558 echo 'Turning on accounting:' 559 if [ ! -e /var/account/acct ]; then 560 touch /var/account/acct 561 fi 562 accton /var/account/acct 563 fi 564 ;; 565esac 566 567# Make shared lib searching a little faster. Leave /usr/lib first if you 568# add your own entries or you may come to grief. 569# 570ldconfig="/sbin/ldconfig" 571case ${ldconfig_insecure} in 572[Yy][Ee][Ss]) 573 ldconfig="${ldconfig} -i" 574 ;; 575esac 576if [ -x /sbin/ldconfig ]; then 577 case `/usr/bin/objformat` in 578 elf) 579 _LDC=/usr/lib 580 for i in ${ldconfig_paths}; do 581 if [ -d "${i}" ]; then 582 _LDC="${_LDC} ${i}" 583 fi 584 done 585 echo 'ELF ldconfig path:' ${_LDC} 586 ${ldconfig} -elf ${_LDC} 587 ;; 588 esac 589 590 # Legacy aout support for i386 only 591 case `sysctl -n hw.machine` in 592 i386) 593 # Default the a.out ldconfig path. 594 : ${ldconfig_paths_aout=${ldconfig_paths}} 595 _LDC=/usr/lib/aout 596 for i in ${ldconfig_paths_aout}; do 597 if [ -d "${i}" ]; then 598 _LDC="${_LDC} ${i}" 599 fi 600 done 601 echo 'a.out ldconfig path:' ${_LDC} 602 ${ldconfig} -aout ${_LDC} 603 ;; 604 esac 605fi 606 607# Now start up miscellaneous daemons that don't belong anywhere else 608# 609echo -n 'Starting standard daemons:' 610case ${inetd_enable} in 611[Nn][Oo]) 612 ;; 613*) 614 echo -n ' inetd'; inetd ${inetd_flags} 615 ;; 616esac 617 618case ${cron_enable} in 619[Nn][Oo]) 620 ;; 621*) 622 echo -n ' cron'; ${cron_program:-/usr/sbin/cron} ${cron_flags} 623 ;; 624esac 625 626case ${lpd_enable} in 627[Yy][Ee][Ss]) 628 echo -n ' printer'; ${lpd_program:-/usr/sbin/lpd} ${lpd_flags} 629 ;; 630esac 631 632case ${sendmail_enable} in 633[Yy][Ee][Ss]) 634 if [ -r /etc/mail/sendmail.cf ]; then 635 echo -n ' sendmail'; /usr/sbin/sendmail ${sendmail_flags} 636 fi 637 ;; 638esac 639 640case ${sshd_enable} in 641[Yy][Ee][Ss]) 642 if [ -x ${sshd_program:-/usr/sbin/sshd} ]; then 643 echo -n ' sshd'; 644 ${sshd_program:-/usr/sbin/sshd} ${sshd_flags} 645 fi 646 ;; 647esac 648 649case ${usbd_enable} in 650[Yy][Ee][Ss]) 651 echo -n ' usbd'; /usr/sbin/usbd ${usbd_flags} 652 ;; 653esac 654 655echo '.' 656 657# Recover vi editor files. 658find /var/tmp/vi.recover ! -type f -a ! -type d -delete 659vibackup=`echo /var/tmp/vi.recover/vi.*` 660if [ "${vibackup}" != '/var/tmp/vi.recover/vi.*' ]; then 661 echo -n 'Recovering vi editor sessions:' 662 for i in /var/tmp/vi.recover/vi.*; do 663 # Only test files that are readable. 664 if [ ! -r "${i}" ]; then 665 continue 666 fi 667 668 # Unmodified nvi editor backup files either have the 669 # execute bit set or are zero length. Delete them. 670 if [ -x "${i}" -o ! -s "${i}" ]; then 671 rm -f "${i}" 672 fi 673 done 674 675 # It is possible to get incomplete recovery files, if the editor 676 # crashes at the right time. 677 virecovery=`echo /var/tmp/vi.recover/recover.*` 678 if [ "${virecovery}" != "/var/tmp/vi.recover/recover.*" ]; then 679 for i in /var/tmp/vi.recover/recover.*; do 680 # Only test files that are readable. 681 if [ ! -r "${i}" ]; then 682 continue 683 fi 684 685 # Delete any recovery files that are zero length, 686 # corrupted, or that have no corresponding backup file. 687 # Else send mail to the user. 688 recfile=`awk '/^X-vi-recover-path:/{print $2}' < "${i}"` 689 if [ -n "${recfile}" -a -s "${recfile}" ]; then 690 sendmail -t < "${i}" 691 else 692 rm -f "${i}" 693 fi 694 done 695 fi 696 echo '.' 697fi 698 699# Make a bounds file for msgs(1) if there isn't one already 700# 701if [ -d /var/msgs -a ! -f /var/msgs/bounds -a ! -L /var/msgs/bounds ]; then 702 echo 0 > /var/msgs/bounds 703fi 704 705case ${update_motd} in 706[Nn][Oo] | '') 707 ;; 708*) 709 if T=`mktemp /tmp/_motd.XXXXXX`; then 710 uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > ${T} 711 awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> ${T} 712 cmp -s ${T} /etc/motd || { 713 cp ${T} /etc/motd 714 chmod 644 /etc/motd 715 } 716 rm -f ${T} 717 fi 718 ;; 719esac 720 721# Configure implementation specific stuff 722# 723arch=`uname -m` 724if [ -r /etc/rc.${arch} ]; then 725 . /etc/rc.${arch} 726fi 727 728# Configure the system console 729# 730if [ -r /etc/rc.syscons ]; then 731 . /etc/rc.syscons 732fi 733 734# Run rc.devfs if readable to customize devfs 735# 736if [ -r /etc/rc.devfs ]; then 737 sh /etc/rc.devfs 738fi 739 740echo -n 'Additional ABI support:' 741 742# Load the SysV IPC API if requested. 743case ${sysvipc_enable} in 744[Yy][Ee][Ss]) 745 echo -n ' sysvipc' 746 kldload sysvmsg >/dev/null 2>&1 747 kldload sysvsem >/dev/null 2>&1 748 kldload sysvshm >/dev/null 2>&1 749 ;; 750esac 751 752# Start the Linux binary compatibility if requested. 753# 754case ${linux_enable} in 755[Yy][Ee][Ss]) 756 echo -n ' linux' 757 if ! kldstat -v | grep -E 'linux(aout|elf)' > /dev/null; then 758 kldload linux > /dev/null 2>&1 759 fi 760 if [ -x /compat/linux/sbin/ldconfig ]; then 761 /compat/linux/sbin/ldconfig 762 fi 763 ;; 764esac 765 766# Start the SysVR4 binary emulation if requested. 767# 768case ${svr4_enable} in 769[Yy][Ee][Ss]) 770 echo -n ' svr4'; kldload svr4 > /dev/null 2>&1 771 ;; 772esac 773 774echo '.' 775 776# Do traditional (but rather obsolete) rc.local file if it exists. If you 777# use this file and want to make it programmatic, source /etc/defaults/rc.conf 778# in /etc/rc.local and add your custom variables to /etc/rc.conf, as 779# shown below. Please do not put local extensions into /etc/rc itself. 780# Use /etc/rc.local 781# 782# ---- rc.local ---- 783# if [ -r /etc/defaults/rc.conf ]; then 784# . /etc/defaults/rc.conf 785# source_rc_confs 786# elif [ -r /etc/rc.conf ]; then 787# . /etc/rc.conf 788# fi 789# 790# ... additional startup conditionals ... 791# ---- rc.local ---- 792# 793if [ -r /etc/rc.local ]; then 794 echo -n 'Starting local daemons:' 795 sh /etc/rc.local 796 echo '.' 797fi 798 799# For each valid dir in $local_startup, search for init scripts matching *.sh 800# 801case ${local_startup} in 802[Nn][Oo] | '') 803 ;; 804*) 805 echo -n 'Local package initialization:' 806 for dir in ${local_startup}; do 807 if [ -d "${dir}" ]; then 808 for script in ${dir}/*.sh; do 809 if [ -x "${script}" ]; then 810 (set -T 811 trap 'exit 1' 2 812 ${script} start) 813 fi 814 done 815 fi 816 done 817 echo '.' 818 ;; 819esac 820 821if [ -n "${network_pass3_done}" ]; then 822 network_pass4 823fi 824 825# Raise kernel security level. This should be done only after `fsck' has 826# repaired local file systems if you want the securelevel to be greater than 1. 827# 828case ${kern_securelevel_enable} in 829[Yy][Ee][Ss]) 830 if [ "${kern_securelevel}" -ge 0 ]; then 831 echo 'Raising kernel security level: ' 832 sysctl -w kern.securelevel=${kern_securelevel} 833 fi 834 ;; 835esac 836 837echo '' 838 839date 840 841exit 0 842 843