📄 00000003.htm
字号:
<HTML><HEAD> <TITLE>BBS水木清华站∶精华区</TITLE></HEAD><BODY><CENTER><H1>BBS水木清华站∶精华区</H1></CENTER>发信人: Hanky@FruitTea1 (骗谁啊?), 信区: Linux <BR>标 题: SysV init 2.6 的开机过程 (二) 附件一 <BR>发信站: 果茶小站 (Wed May 29 21:39:12 1996) <BR> <BR>PATH="/sbin:/bin:/usr/sbin:/usr/bin" <BR>umask 022 <BR> <BR>echo <BR>echo "Running /etc/init.d/boot..." <BR>echo <BR> <BR># enable kerneld <BR>if [ -x /sbin/kerneld ]; then <BR> /sbin/kerneld <BR>fi <BR> <BR># 把 md 跑起来 <BR>if [ -s /etc/mdtab -a -f /sbin/mdadd ] <BR>then <BR> mdadd -ar <BR>fi <BR> <BR>echo "Activating swap..." <BR>swapon -a 2>/dev/null <BR> <BR># Ensure that bdflush (update) is running before any major I/O is <BR># performed (the following is a good example of such activity :). <BR>update & <BR> <BR># Check the integrity of all file systems (if not a fastboot). <BR>if [ ! -f /fastboot ] <BR>then <BR> # Ensure that root is quiescent and read-only before fsck'ing. <BR> mount -n -o remount,ro / <BR> if [ $? = 0 ] <BR> then <BR> echo "Checking file systems..." <BR> fsck -A -a <BR> # If there was a failure, drop into single-user mode. <BR> # <BR> # NOTE: "failure" is defined as exiting with a return code of <BR> # 2 or larger. A return code of 1 indicates that file system <BR> # errors were corrected but that the boot may proceed. <BR> if [ $? -gt 1 ] <BR> then <BR> # Surprise! Re-directing from a HERE document (as in <BR> # "cat << EOF") won't work, because the root is read-only. <BR> echo <BR> echo "fsck failed. Please repair manually and reboot. Please note" <BR> echo "that the root file system is currently mounted read-only. To" <BR> echo "remount it read-write:" <BR> echo <BR> echo " bash# mount -n -o remount,rw /" <BR> echo <BR> echo "CONTROL-D will reboot the system." <BR> echo <BR> # Start a single user shell on the console <BR> /sbin/sulogin /dev/console <BR> sync <BR> reboot <BR> fi <BR> echo <BR> else <BR> echo "*** ERROR! Cannot fsck because root is not read-only!" <BR> echo <BR> fi <BR>else <BR> echo "*** Fast boot ... skipping disk checks" <BR> echo <BR>fi <BR> <BR># Remount the root file system in read-write mode. <BR>mount -n -o remount,rw / <BR> <BR># Load the appropriate modules. <BR>if [ -x /etc/init.d/modules ] <BR>then <BR> /etc/init.d/modules <BR>fi <BR> <BR># Remove /etc/mtab*, /etc/rmtab, /etc/nologin and /fastboot. <BR>rm -f /etc/mtab* /etc/nologin /fastboot /etc/rmtab <BR> <BR># update /etc/psdatabase <BR>psupdate 2> /dev/null <BR># or <BR>#ps -U 2> /dev/null <BR> <BR># Mount local file systems in /etc/fstab. <BR>echo "Mounting local file systems..." <BR>mount -avt nonfs <BR> <BR># Execute swapon command again, in case we want to swap to <BR># a file on a now mounted filesystem. <BR>swapon -a 2>/dev/null <BR> <BR># Setup the network interfaces. Note that /var/run and /var/lock <BR># are cleaned up after this, so don't put anything in the "network" <BR># script that leave a pidfile or a lockfile. <BR>if [ -x /etc/init.d/network ] <BR>then <BR> /etc/init.d/network <BR>fi <BR> <BR># Set hostname. <BR># If there's no /etc/HOSTNAME, fall back on this default: <BR>if [ ! -r /etc/HOSTNAME ]; then <BR> echo "Henry.Dorm10.NCTU.edu.tw" > /etc/HOSTNAME <BR>fi <BR>cat /etc/HOSTNAME | cut -f1 -d . > /etc/hostname <BR>hostname --file /etc/hostname <BR> <BR># Now that TCP/IP is configured, mount the NFS file systems in /etc/fstab. <BR>echo "Mounting remote file systems..." <BR>mount -a -t nfs <BR> <BR># Update all the shared library links automatically <BR>echo "Update /etc/ld.so.cache and all the shared library links." <BR>/sbin/ldconfig <BR> <BR># Set GMT="-u" if your system clock is set to GMT, and GMT="" <BR># if not. <BR>GMT="" <BR># Set and adjust the CMOS clock. <BR>clock -s $GMT <BR>if [ ! -f /etc/adjtime ] <BR>then <BR> echo "0.0 0 0.0" > /etc/adjtime <BR>fi <BR>clock -a $GMT <BR> <BR># Now that /usr/lib/zoneinfo should be available, announce the local time. <BR>echo <BR>echo "Local time: `date`" <BR>echo <BR> <BR># Wipe /tmp (and don't erase `lost+found', `quota.user' or `quota.group')! <BR># Note that files _in_ lost+found _are_ deleted. <BR>echo -n "Cleaning up /tmp, /var/run and /var/lock... " <BR>( cd /tmp && \ <BR> find . \ <BR> ! -name .\ <BR> ! \( -name lost+found -uid 0 \) \ <BR> ! \( -name quota.user -uid 0 \) \ <BR> ! \( -name quota.group -uid 0 \) \ <BR> -depth -exec rm -rf -- {} \; ) <BR># Clean up any stale locks. <BR>( cd /var/lock && find . -type f -exec rm -f -- {} \; ) <BR># Clean up /var/run and create /var/run/utmp so that we can login. <BR>( cd /var/run && find . ! -type d -exec rm -f -- {} \; ) <BR>∶<I> > /var/run/utmp </I><BR>echo "done." <BR> <BR># Run the package-specific boot scripts in /etc/rc.boot. <BR>run-parts /etc/rc.boot <BR># Set pseudo-terminal access permissions. <BR>chmod 666 /dev/tty[pqrstuvwxyzabcde]* <BR>chown root.tty /dev/tty[pqrstuvwxyzabcde]* <BR> <BR># Setup the /etc/issue.net to reflect the current kernel level: <BR>cat /etc/issue > /etc/issue.net <BR>uname -a >> /etc/issue.net <BR>echo >> /etc/issue.net <BR> <BR>touch /etc/motd <BR> <BR># and startup powerd <BR>echo "Start up the genpowerd" ; /sbin/genpowerd /dev/UPS henry <BR> <BR><CENTER><H1>BBS水木清华站∶精华区</H1></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -