rc revision 84367
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# @(#)rc 5.27 (Berkeley) 6/5/91 28# $FreeBSD: head/etc/rc 84367 2001-10-02 11:50:14Z knu $ 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 126case ${harvest_ethernet} in 127[Nn][Oo]) 128 ;; 129*) 130 if [ -w /dev/random ]; then 131 /sbin/sysctl -w kern.random.sys.harvest.ethernet=1 >/dev/null 132 echo -n ' ethernet' 133 fi 134 ;; 135esac 136 137case ${harvest_p_to_p} in 138[Nn][Oo]) 139 ;; 140*) 141 if [ -w /dev/random ]; then 142 /sbin/sysctl -w kern.random.sys.harvest.point_to_point=1 >/dev/null 143 echo -n ' point_to_point' 144 fi 145 ;; 146esac 147 148echo '.' 149 150# First pass at reseeding /dev/random. 151# 152case ${entropy_file} in 153[Nn][Oo] | '') 154 ;; 155*) 156 if [ -w /dev/random ]; then 157 feed_dev_random "${entropy_file}" 158 fi 159 ;; 160esac 161 162# XXX temporary until we can get the entropy 163# harvesting rate up 164# Entropy below is not great, 165# but better than nothing. 166( ps -efauxww; sysctl -a; date; df -ib; dmesg; ps -efauxww; ) \ 167 | dd of=/dev/random bs=8k 2>/dev/null 168cat /bin/ls | dd of=/dev/random bs=8k 2>/dev/null 169 170# Configure ccd devices. 171# 172if [ -r /etc/ccd.conf ]; then 173 ccdconfig -C 174fi 175 176case ${start_vinum} in 177[Yy][Ee][Ss]) 178 vinum start 179 ;; 180esac 181 182swapon -a 183 184# Last chance to do things before potentially waiting for 185# operator to do fsck related tasks 186if [ -r /etc/rc.early ]; then 187 . /etc/rc.early 188fi 189 190case ${bootmode} in 191autoboot) 192 echo 'Automatic boot in progress...' 193 case ${background_fsck} in 194 [Yy][Ee][Ss]) 195 fsck -F -p 196 ;; 197 *) 198 fsck -p 199 ;; 200 esac 201 case $? in 202 0) 203 ;; 204 2) 205 exit 1 206 ;; 207 4) 208 reboot 209 echo 'Reboot failed... help!' 210 exit 1 211 ;; 212 8) 213 case ${fsck_y_enable} in 214 [Yy][Ee][Ss]) 215 echo 'File system preen failed, trying fsck -y . . .' 216 fsck -y 217 case $? in 218 0) 219 ;; 220 *) 221 echo 'Automatic file system check failed . . . help!' 222 exit 1 223 ;; 224 esac 225 ;; 226 *) 227 echo 'Automatic file system check failed . . . help!' 228 exit 1 229 ;; 230 esac 231 ;; 232 12) 233 echo 'Reboot interrupted' 234 exit 1 235 ;; 236 130) 237 # interrupt before catcher installed 238 exit 1 239 ;; 240 *) 241 echo 'Unknown error in reboot' 242 exit 1 243 ;; 244 esac 245 ;; 246*) 247 echo 'Skipping disk checks ...' 248 ;; 249esac 250 251set -T 252trap "echo 'Reboot interrupted'; exit 1" 3 253 254# root normally must be read/write, but if this is a BOOTP NFS 255# diskless boot it does not have to be. 256# 257case ${root_rw_mount} in 258[Nn][Oo] | '') 259 ;; 260*) 261 if ! mount -u -o rw / ; then 262 echo 'Mounting root filesystem rw failed, startup aborted' 263 exit 1 264 fi 265 ;; 266esac 267 268umount -a >/dev/null 2>&1 269 270# Mount everything except nfs filesystems. 271mount -a -t nonfs 272 273case $? in 2740) 275 ;; 276*) 277 echo 'Mounting /etc/fstab filesystems failed, startup aborted' 278 exit 1 279 ;; 280esac 281 282# Run custom disk mounting function here 283# 284if [ -n "${diskless_mount}" -a -r "${diskless_mount}" ]; then 285 sh ${diskless_mount} 286fi 287 288# Reseed /dev/random with previously stored entropy. 289case ${entropy_dir} in 290[Nn][Oo]) 291 ;; 292*) 293 entropy_dir=${entropy_dir:-/var/db/entropy} 294 if [ -d "${entropy_dir}" ]; then 295 if [ -w /dev/random ]; then 296 for seedfile in ${entropy_dir}/*; do 297 feed_dev_random "${seedfile}" 298 done 299 fi 300 fi 301 ;; 302esac 303 304case ${entropy_file} in 305[Nn][Oo] | '') 306 ;; 307*) 308 if [ -w /dev/random ]; then 309 feed_dev_random "${entropy_file}" 310 fi 311 ;; 312esac 313 314adjkerntz -i 315 316purgedir() { 317 local dir file 318 319 if [ $# -eq 0 ]; then 320 purgedir . 321 else 322 for dir 323 do 324 ( 325 cd "$dir" && for file in .* * 326 do 327 [ ."$file" = .. -o ."$file" = ... ] && continue 328 if [ -d "$file" -a ! -L "$file" ] 329 then 330 purgedir "$file" 331 else 332 rm -f -- "$file" 333 fi 334 done 335 ) 336 done 337 fi 338} 339 340clean_var() { 341 if [ ! -f /var/run/clean_var ]; then 342 purgedir /var/run /var/spool/lock 343 rm -rf /var/spool/uucp/.Temp/* 344 # Keep a copy of the boot messages around 345 dmesg >/var/run/dmesg.boot 346 # And an initial utmp file 347 (cd /var/run && cp /dev/null utmp && chmod 644 utmp;) 348 >/var/run/clean_var 349 fi 350} 351 352if [ -d /var/run -a -d /var/spool/lock -a -d /var/spool/uucp/.Temp ]; then 353 # network_pass1() *may* end up writing stuff to /var - we don't want to 354 # remove it immediately afterwards - *nor* to we want to fail to clean 355 # an nfs-mounted /var. 356 clean_var 357fi 358 359# Add additional swapfile, if configured. 360# 361case ${swapfile} in 362[Nn][Oo] | '') 363 ;; 364*) 365 if [ -w "${swapfile}" -a -c /dev/mdctl ]; then 366 echo "Adding ${swapfile} as additional swap" 367 mdev=`mdconfig -a -t vnode -f ${swapfile}` && swapon /dev/${mdev} 368 fi 369 ;; 370esac 371 372# Set sysctl variables as early as we can 373# 374if [ -r /etc/rc.sysctl ]; then 375 . /etc/rc.sysctl 376fi 377 378# Configure serial devices 379# 380if [ -r /etc/rc.serial ]; then 381 . /etc/rc.serial 382fi 383 384# Start up PC-card configuration 385# 386if [ -r /etc/rc.pccard ]; then 387 . /etc/rc.pccard 388fi 389 390# Start up the initial network configuration. 391# 392if [ -r /etc/rc.network ]; then 393 . /etc/rc.network # We only need to do this once. 394 network_pass1 395fi 396 397case ${ipv6_enable} in 398[Yy][Ee][Ss]) 399 if [ -r /etc/rc.network6 ]; then 400 . /etc/rc.network6 # We only need to do this once also. 401 network6_pass1 402 fi 403 ;; 404esac 405 406# Mount NFS filesystems if present in /etc/fstab 407case "`mount -d -a -t nfs 2> /dev/null`" in 408*mount_nfs*) 409 echo -n 'Mounting NFS file systems:' 410 mount -a -t nfs 411 echo '.' 412 ;; 413esac 414 415# Whack the pty perms back into shape. 416# 417if ls /dev/tty[pqrsPQRS]* > /dev/null 2>&1; then 418 chflags 0 /dev/tty[pqrsPQRS]* 419 chmod 666 /dev/tty[pqrsPQRS]* 420 chown root:wheel /dev/tty[pqrsPQRS]* 421fi 422 423# Clean up left-over files 424# 425clean_var # If it hasn't already been done 426rm /var/run/clean_var 427 428# Clearing /tmp at boot-time seems to have a long tradition. It doesn't 429# help in any way for long-living systems, and it might accidentally 430# clobber files you would rather like to have preserved after a crash 431# (if not using mfs /tmp anyway). 432# 433# See also the example of another cleanup policy in /etc/periodic/daily. 434# 435case ${clear_tmp_enable} in 436[Yy][Ee][Ss]) 437 echo -n 'Clearing /tmp:' 438 # prune quickly with one rm, then use find to clean up /tmp/[lq]* 439 # (not needed with mfs /tmp, but doesn't hurt there...) 440 (cd /tmp && rm -rf [a-km-pr-zA-Z]* && 441 find -d . ! -name . ! -name lost+found ! -name quota.user \ 442 ! -name quota.group -exec rm -rf -- {} \;) 443 echo '.' 444 ;; 445esac 446 447# Remove X lock files, since they will prevent you from restarting X11 448# after a system crash. 449# 450rm -f /tmp/.X*-lock /tmp/.X11-unix/* 451 452# Snapshot any kernel -c changes back to disk here <someday>. 453# This has changed with ELF and /kernel.config. 454 455echo -n 'Additional daemons:' 456 457# Start system logging and name service. Named needs to start before syslogd 458# if you don't have a /etc/resolv.conf. 459# 460case ${syslogd_enable} in 461[Yy][Ee][Ss]) 462 # Transitional symlink (for the next couple of years :) until all 463 # binaries have had a chance to move towards /var/run/log. 464 if [ ! -L /dev/log ]; then 465 # might complain for r/o root f/s 466 ln -sf /var/run/log /dev/log 467 fi 468 469 rm -f /var/run/log 470 echo -n ' syslogd'; 471 ${syslogd_program:-/usr/sbin/syslogd} ${syslogd_flags} 472 ;; 473esac 474 475echo '.' 476 477# Build device name databases if we are not using DEVFS 478# 479if sysctl vfs.devfs.generation > /dev/null 2>&1 ; then 480 rm -f /var/run/dev.db 481else 482 dev_mkdb 483fi 484 485# Enable dumpdev so that savecore can see it. 486# /var/crash should be a directory or a symbolic link 487# to the crash directory if core dumps are to be saved. 488# 489case ${dumpdev} in 490[Nn][Oo] | '') 491 ;; 492*) 493 if [ -e "${dumpdev}" -a -d /var/crash ]; then 494 /sbin/dumpon -v ${dumpdev} 495 echo -n 'Checking for core dump: ' 496 /sbin/savecore ${savecore_flags} /var/crash 497 fi 498 ;; 499esac 500 501if [ -n "${network_pass1_done}" ]; then 502 network_pass2 503fi 504 505# Enable/Check the quotas (must be after ypbind if using NIS) 506# 507case ${enable_quotas} in 508[Yy][Ee][Ss]) 509 case ${check_quotas} in 510 [Yy][Ee][Ss]) 511 echo -n 'Checking quotas:' 512 quotacheck -a 513 echo ' done.' 514 ;; 515 esac 516 517 echo -n 'Enabling quotas:' 518 quotaon -a 519 echo ' done.' 520 ;; 521esac 522 523if [ -n "${network_pass2_done}" ]; then 524 network_pass3 525fi 526 527# Check the password temp/lock file 528# 529if [ -e /etc/ptmp ]; then 530 logger -s -p auth.err \ 531 "password file may be incorrect -- /etc/ptmp exists" 532fi 533 534case ${accounting_enable} in 535[Yy][Ee][Ss]) 536 if [ -d /var/account ]; then 537 echo 'Turning on accounting:' 538 if [ ! -e /var/account/acct ]; then 539 touch /var/account/acct 540 fi 541 accton /var/account/acct 542 fi 543 ;; 544esac 545 546# Make shared lib searching a little faster. Leave /usr/lib first if you 547# add your own entries or you may come to grief. 548# 549ldconfig="/sbin/ldconfig" 550case ${ldconfig_insecure} in 551[Yy][Ee][Ss]) 552 ldconfig="${ldconfig} -i" 553 ;; 554esac 555if [ -x /sbin/ldconfig ]; then 556 case `/usr/bin/objformat` in 557 elf) 558 _LDC=/usr/lib 559 for i in ${ldconfig_paths}; do 560 if [ -d "${i}" ]; then 561 _LDC="${_LDC} ${i}" 562 fi 563 done 564 echo 'ELF ldconfig path:' ${_LDC} 565 ${ldconfig} -elf ${_LDC} 566 ;; 567 esac 568 569 # Legacy aout support for i386 only 570 case `sysctl -n hw.machine` in 571 i386) 572 # Default the a.out ldconfig path. 573 : ${ldconfig_paths_aout=${ldconfig_paths}} 574 _LDC=/usr/lib/aout 575 for i in ${ldconfig_paths_aout}; do 576 if [ -d "${i}" ]; then 577 _LDC="${_LDC} ${i}" 578 fi 579 done 580 echo 'a.out ldconfig path:' ${_LDC} 581 ${ldconfig} -aout ${_LDC} 582 ;; 583 esac 584fi 585 586# Now start up miscellaneous daemons that don't belong anywhere else 587# 588echo -n 'Starting standard daemons:' 589case ${inetd_enable} in 590[Nn][Oo]) 591 ;; 592*) 593 echo -n ' inetd'; ${inetd_program:-/usr/sbin/inetd} ${inetd_flags} 594 ;; 595esac 596 597case ${cron_enable} in 598[Nn][Oo]) 599 ;; 600*) 601 echo -n ' cron'; ${cron_program:-/usr/sbin/cron} ${cron_flags} 602 ;; 603esac 604 605case ${lpd_enable} in 606[Yy][Ee][Ss]) 607 echo -n ' printer'; ${lpd_program:-/usr/sbin/lpd} ${lpd_flags} 608 ;; 609esac 610 611case ${sshd_enable} in 612[Yy][Ee][Ss]) 613 if [ -x ${sshd_program:-/usr/sbin/sshd} ]; then 614 echo -n ' sshd'; 615 ${sshd_program:-/usr/sbin/sshd} ${sshd_flags} 616 fi 617 ;; 618esac 619 620case ${usbd_enable} in 621[Yy][Ee][Ss]) 622 echo -n ' usbd'; /usr/sbin/usbd ${usbd_flags} 623 ;; 624esac 625 626if [ -r /etc/mail/sendmail.cf ]; then 627 case ${sendmail_enable} in 628 [Yy][Ee][Ss]) 629 echo -n ' sendmail' 630 /usr/sbin/sendmail ${sendmail_flags} 631 ;; 632 *) 633 case ${sendmail_outbound_enable} in 634 [Yy][Ee][Ss]) 635 echo -n ' sendmail' 636 /usr/sbin/sendmail ${sendmail_outbound_flags} 637 ;; 638 esac 639 ;; 640 esac 641fi 642 643echo '.' 644 645# Recover vi editor files. 646find /var/tmp/vi.recover ! -type f -a ! -type d -delete 647vibackup=`echo /var/tmp/vi.recover/vi.*` 648if [ "${vibackup}" != '/var/tmp/vi.recover/vi.*' ]; then 649 echo -n 'Recovering vi editor sessions:' 650 for i in /var/tmp/vi.recover/vi.*; do 651 # Only test files that are readable. 652 if [ ! -r "${i}" ]; then 653 continue 654 fi 655 656 # Unmodified nvi editor backup files either have the 657 # execute bit set or are zero length. Delete them. 658 if [ -x "${i}" -o ! -s "${i}" ]; then 659 rm -f "${i}" 660 fi 661 done 662 663 # It is possible to get incomplete recovery files, if the editor 664 # crashes at the right time. 665 virecovery=`echo /var/tmp/vi.recover/recover.*` 666 if [ "${virecovery}" != "/var/tmp/vi.recover/recover.*" ]; then 667 for i in /var/tmp/vi.recover/recover.*; do 668 # Only test files that are readable. 669 if [ ! -r "${i}" ]; then 670 continue 671 fi 672 673 # Delete any recovery files that are zero length, 674 # corrupted, or that have no corresponding backup file. 675 # Else send mail to the user. 676 recfile=`awk '/^X-vi-recover-path:/{print $2}' < "${i}"` 677 if [ -n "${recfile}" -a -s "${recfile}" ]; then 678 sendmail -t < "${i}" 679 else 680 rm -f "${i}" 681 fi 682 done 683 fi 684 echo '.' 685fi 686 687# Make a bounds file for msgs(1) if there isn't one already 688# 689if [ -d /var/msgs -a ! -f /var/msgs/bounds -a ! -L /var/msgs/bounds ]; then 690 echo 0 > /var/msgs/bounds 691fi 692 693case ${update_motd} in 694[Nn][Oo] | '') 695 ;; 696*) 697 if T=`mktemp /tmp/_motd.XXXXXX`; then 698 uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > ${T} 699 awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> ${T} 700 cmp -s ${T} /etc/motd || { 701 cp ${T} /etc/motd 702 chmod 644 /etc/motd 703 } 704 rm -f ${T} 705 fi 706 ;; 707esac 708 709# Run rc.devfs if readable to customize devfs 710# 711if [ -r /etc/rc.devfs ]; then 712 sh /etc/rc.devfs 713fi 714 715# Configure implementation specific stuff 716# 717arch=`uname -m` 718if [ -r /etc/rc.${arch} ]; then 719 . /etc/rc.${arch} 720fi 721 722# Configure the system console 723# 724if [ -r /etc/rc.syscons ]; then 725 . /etc/rc.syscons 726fi 727 728echo -n 'Additional ABI support:' 729 730# Load the SysV IPC API if requested. 731case ${sysvipc_enable} in 732[Yy][Ee][Ss]) 733 echo -n ' sysvipc' 734 kldload sysvmsg >/dev/null 2>&1 735 kldload sysvsem >/dev/null 2>&1 736 kldload sysvshm >/dev/null 2>&1 737 ;; 738esac 739 740# Start the Linux binary compatibility if requested. 741# 742case ${linux_enable} in 743[Yy][Ee][Ss]) 744 echo -n ' linux' 745 if ! kldstat -v | grep -E 'linux(aout|elf)' > /dev/null; then 746 kldload linux > /dev/null 2>&1 747 fi 748 if [ -x /compat/linux/sbin/ldconfig ]; then 749 /compat/linux/sbin/ldconfig 750 fi 751 ;; 752esac 753 754# Start the SysVR4 binary emulation if requested. 755# 756case ${svr4_enable} in 757[Yy][Ee][Ss]) 758 echo -n ' svr4'; kldload svr4 > /dev/null 2>&1 759 ;; 760esac 761 762echo '.' 763 764# Do traditional (but rather obsolete) rc.local file if it exists. If you 765# use this file and want to make it programmatic, source /etc/defaults/rc.conf 766# in /etc/rc.local and add your custom variables to /etc/rc.conf, as 767# shown below. Please do not put local extensions into /etc/rc itself. 768# Use /etc/rc.local 769# 770# ---- rc.local ---- 771# if [ -r /etc/defaults/rc.conf ]; then 772# . /etc/defaults/rc.conf 773# source_rc_confs 774# elif [ -r /etc/rc.conf ]; then 775# . /etc/rc.conf 776# fi 777# 778# ... additional startup conditionals ... 779# ---- rc.local ---- 780# 781if [ -r /etc/rc.local ]; then 782 echo -n 'Starting local daemons:' 783 sh /etc/rc.local 784 echo '.' 785fi 786 787# For each valid dir in $local_startup, search for init scripts matching *.sh 788# 789case ${local_startup} in 790[Nn][Oo] | '') 791 ;; 792*) 793 echo -n 'Local package initialization:' 794 slist="" 795 for dir in ${local_startup}; do 796 if [ -d "${dir}" ]; then 797 for script in ${dir}/*.sh; do 798 slist="${slist}${script_name_sep}${script}" 799 done 800 fi 801 done 802 script_save_sep="$IFS" 803 IFS="${script_name_sep}" 804 for script in ${slist}; do 805 if [ -x "${script}" ]; then 806 (set -T 807 trap 'exit 1' 2 808 ${script} start) 809 elif [ -f "${script}" -o -l "${script}" ]; then 810 echo -n " (skipping ${script##*/}, not executable)" 811 fi 812 done 813 IFS="${script_save_sep}" 814 echo '.' 815 ;; 816esac 817 818if [ -n "${network_pass3_done}" ]; then 819 network_pass4 820fi 821 822# Raise kernel security level. This should be done only after `fsck' has 823# repaired local file systems if you want the securelevel to be greater than 1. 824# 825case ${kern_securelevel_enable} in 826[Yy][Ee][Ss]) 827 if [ "${kern_securelevel}" -ge 0 ]; then 828 echo 'Raising kernel security level: ' 829 sysctl -w kern.securelevel=${kern_securelevel} 830 fi 831 ;; 832esac 833 834# Start background fsck checks if necessary 835case ${background_fsck} in 836[Yy][Ee][Ss]) 837 echo 'Starting background filesystem checks' 838 nice -4 fsck -B -p 2>&1 | logger -p daemon.notice & 839 ;; 840esac 841 842echo '' 843 844date 845 846exit 0 847 848