clean_var() { if [ ! -f /var/run/clean_var ]; then rm -rf /var/run/* find /var/spool/lock ! -type d -delete rm -rf /var/spool/uucp/.Temp/* # Keep a copy of the boot messages around dmesg >/var/run/dmesg.boot 接着rc会读取以下文件:
# Whack the pty perms back into shape. chflags 0 /dev/tty[pqrsPQRS]* chmod 666 /dev/tty[pqrsPQRS]* chown root:wheel /dev/tty[pqrsPQRS]* 并清理自己产生的“垃圾”以及/tmp目录:
# Clean up left-over files # Clearing /tmp at boot-time seems to have a long tradition. It doesn't # help in any way for long-living systems, and it might accidentally # clobber files you would rather like to have preserved after a crash # (if not using mfs /tmp anyway). # See also the example of another cleanup policy in /etc/periodic/daily. # Remove X lock files, since they will prevent you from restarting X11 # after a system crash. 现在rc准备启动一些后台进程,首先是syslogd和named:
# Start system logging and name service. Named needs to start before syslogd # if you don't have a /etc/resolv.conf. 然后是inetd、cron、lpd、sendmail、sshd和usbd:
# Now start up miscellaneous daemons that don't belong anywhere else 接着rc将更新motd(每日信息)并执行“uname -m”,这条命令会在屏幕上显示构架类型。