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