⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 linux系统初始化过程解析.htm

📁 这是我做linux系统初始化过程分析时在网上收集到的资料
💻 HTM
📖 第 1 页 / 共 2 页
字号:
        1.44M <BR>FDC 0 is a post-1991 82077 <BR>md driver 0.90.0 
        MAX_MD_DEVS=256, MAX_REAL=12 <BR>raid5: measuring checksumming speed 
        <BR>raid5: MMX detected, trying high-speed MMX checksum routines <BR>…… 
        <BR>using fastest function: p5_mmx (1168.146 MB/sec) <BR>scsi : 0 hosts. 
        <BR>scsi : detected total. <BR>md.c: sizeof(mdp_super_t) = 4096 
        <BR>Partition check: <BR>hda: hda1 hda2 &lt; hda5 hda6 hda7 hda8 hda9 
        hda10 hda11 &gt; <BR>autodetecting RAID arrays <BR>autorun ... <BR>... 
        autorun DONE. <BR>VFS: Mounted root (ext2 filesystem) readonly. 
        <BR>Freeing unused kernel memory: 64k freed <BR>…… <BR><BR>2.init程序部分 
        <BR><BR>  init程序通常在/sbin或/bin下,它负责在系统启动时运行一系列程序和脚本文件。init程序一旦被内核调用,便成为系统的第0号进程,该进程对于LINUX系统是十分重要的,有关它的详细内容请参阅其他资料。init进程做的每一步都由/etc/initab中的配置决定。以下是RadHat的/etc/inittab文件的例子: 
        <BR><BR># Default runlevel. The runlevels used by RHS are: <BR># 0 - 
        halt (Do NOT set initdefault to this) <BR># 1 - Single user mode <BR># 2 
        - Multiuser, without NFS (The same as 3, if you do not have networking) 
        <BR># 3 - Full multiuser mode <BR># 4 - unused <BR># 5 - X11 <BR># 6 - 
        reboot (Do NOT set initdefault to this) <BR># <BR>id:3:initdefault: 
        <BR><BR># System initialization. <BR>si::sysinit:/etc/rc.d/rc.sysinit 
        <BR><BR>l0:0:wait:/etc/rc.d/rc 0 <BR>l1:1:wait:/etc/rc.d/rc 1 
        <BR>l2:2:wait:/etc/rc.d/rc 2 <BR>l3:3:wait:/etc/rc.d/rc 3 
        <BR>l4:4:wait:/etc/rc.d/rc 4 <BR>l5:5:wait:/etc/rc.d/rc 5 
        <BR>l6:6:wait:/etc/rc.d/rc 6 <BR><BR># Things to run in every runlevel. 
        <BR>ud::once:/sbin/update <BR><BR># Trap CTRL-ALT-DELETE 
        <BR>ca::ctrlaltdel:/sbin/shutdown -t3 -r now <BR><BR># When our UPS 
        tells us power has failed, assume we have a few minutes <BR># of power 
        left. Schedule a shutdown for 2 minutes from now. <BR># This does, of 
        course, assume you have powerd installed and your <BR># UPS connected 
        and working correctly. <BR>pf::powerfail:/sbin/shutdown -f -h +2 "Power 
        Failure; System Shutting Down" <BR><BR># If power was restored before 
        the shutdown kicked in, cancel it. 
        <BR>pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown 
        Cancelled" <BR><BR><BR># Run gettys in standard runlevels 
        <BR>1:2345:respawn:/sbin/mingetty tty1 <BR>2:2345:respawn:/sbin/mingetty 
        tty2 <BR>3:2345:respawn:/sbin/mingetty tty3 
        <BR>4:2345:respawn:/sbin/mingetty tty4 <BR>5:2345:respawn:/sbin/mingetty 
        tty5 <BR>6:2345:respawn:/sbin/mingetty tty6 <BR><BR># Run xdm in 
        runlevel 5 <BR># xdm is now a separate service 
        <BR>x:5:respawn:/etc/X11/prefdm -nodaemon 
        <BR><BR>inittab文件的每一行包含四个域,格式为: <BR>code:runlevels:action:command 
        <BR>(1) 
        code域用单个或两个字符序列来作为本行的标识,这个标识在此文件中是唯一的。文件中的某些记录必须使用特定的code才能使系统工作正常。 
        <BR>(2) 
        runlevels域给出的是本行的运行级别。LINUX系统运行在一定的级别下,当inittab文件指定了某一特定的运行级别时,该记录行包含的命令将被执行。RedHat系统通常设置了7个运行级别(0-6),各运行级别的说明包含在inittab文件的开头。 
        <BR>(3) action域指出的是init程序执行command命令的方式。比如:只执行command一次,还是在它退出时重启。 
        <BR>(4) command域给出相应记录行要执行的命令。 
        <BR><BR>  运行级别1是单用户模式,所谓单用户指的是系统运行在唯一用户--超级用户模式下。而大多数情况下,系统运行在多用户模式下。在启动出错、文件系统出错等情况下,系统将进入单用户模式,此时,系统只有很少的配置,这对于恢复系统是很必要的。 
        <BR>  inittab文件首先指出缺省的运行级别(如id:3:initdefault:),我们看到上面的例子中缺省的运行级别为3。此后根据下一条记录,系统应当运行/etc/rc.d/rc.sysinit,这是一个脚本文件,主要包括基本的系统初始化命令,如激活交换分区、检查并挂上文件系统、装载部分模块等。 
        <BR>  接下来是执行特定运行级别对应的rcN程序。rcN都是目录,当前运行级别为N时,执行/etc/rc.d/rcN.d目录下的脚本程序。以下是rc3.d目录下的文件: 
        <BR><IMG src=""> <BR>  
        <BR><BR>  从中我们看到,rc3.d目录下都是类似Knnxxxx和Snnxxxx的文件。Nn是00-99之间的一个整数,xxxx是系统提供的某些服务。以"S"开头的文件用以启动(start)服务进程,以"K"开头的文件用以终止(kill)服务进程。数字nn的大小决定程序执行的先后顺序。 
        <BR>  例如系统启动进入运行模式3后,/etc/rc.d/rc3.d目录下所有以"S"开头的文件将被依次执行;系统关闭时,离开运行模式3之前,/etc/rc.d/rc3.d目录下所有以"K"开头的文件将被依次执行。 
        <BR>下一条记录表明每一个运行级别都要运行命令update,此程序每隔30秒把内存缓冲区的内容回写一次,称为"同步",以防止系统崩溃或突然掉电造成的数据丢失和损坏。 
        <BR>  以下的各条记录分别描述了Ctrl-Alt-Del组合键是否有效,与UPS相关的电源失败处理和虚拟控制台的初始化,最后一条记录则是在运行级别5的启动X 
        Window系统的X显示管理程序。 <BR><BR>  好了,到此为止,我们就可以登陆LINUX系统了。 <BR><BR><BR>
        <DIV align=right>发布人:netbull&nbsp;来自:China-pub&nbsp;</DIV><BR></UL><IMG 
      src="LINUX系统初始化过程解析.files/line.jpg"><BR>
      <FORM action=post.php?skin=reart&amp;ID=2753 method=post>
      <UL>-- 发表评论 --<BR>&nbsp;昵称:<INPUT name=name>&nbsp;Email:<INPUT 
        name=email><BR>&nbsp;内容:<BR><TEXTAREA name=content rows=5 cols=56></TEXTAREA><BR>&nbsp;&nbsp;<INPUT type=submit value=确定回复>&nbsp;<INPUT type=reset value=清除></UL></FORM><IMG 
      src="LINUX系统初始化过程解析.files/line.jpg"><BR>
      <UL>
        <LI>以下是对此文的评论:<BR><BR></LI></UL></TD><!--第三列-->
    <TD vAlign=top align=left width="25%">&nbsp;<IMG 
      src="LINUX系统初始化过程解析.files/online.jpg" border=0> 
      <UL>
        <LI><A href="http://www.heblinux.org/addnews.php" 
        target=_blank>新闻发布</A><BR><BR>
        <LI><A href="http://www.heblinux.org/addart.php" 
        target=_blank>文献发布</A><BR><BR>
        <LI><A href="http://www.heblinux.org/addsoft.php" 
        target=_blank>软件发布</A><BR><BR>
        <LI><A href="http://www.heblinux.org/manger.php" 
        target=_blank>软件管理</A><BR></LI></UL><IMG height=5 
      src="LINUX系统初始化过程解析.files/tabledi2.jpg" width="100%"><!--下载排行--> 
      &nbsp;<IMG src="LINUX系统初始化过程解析.files/download.jpg" border=0> <BR>&nbsp;<A 
      href="http://www.heblinux.org/view.php?skin=soft&amp;id=676">Red Hat 
      Linux</A>&nbsp;(78904)<BR>&nbsp;<A 
      href="http://www.heblinux.org/view.php?skin=soft&amp;id=93">星际译王1.31版</A>&nbsp;(36834)<BR>&nbsp;<A 
      href="http://www.heblinux.org/view.php?skin=soft&amp;id=219">Oracle9i 
      Enterprise</A>&nbsp;(36781)<BR>&nbsp;<A 
      href="http://www.heblinux.org/view.php?skin=soft&amp;id=785">kylix</A>&nbsp;(35589)<BR>&nbsp;<A 
      href="http://www.heblinux.org/view.php?skin=soft&amp;id=287">AOL 
      server</A>&nbsp;(27226)<BR>&nbsp;<A 
      href="http://www.heblinux.org/view.php?skin=soft&amp;id=969">RedHat 
      中文环境</A>&nbsp;(25499)<BR>&nbsp;<A 
      href="http://www.heblinux.org/view.php?skin=soft&amp;id=647">Chinput</A>&nbsp;(23572)<BR>&nbsp;<A 
      href="http://www.heblinux.org/view.php?skin=soft&amp;id=1041">中软Linux</A>&nbsp;(21135)<BR>&nbsp;<A 
      href="http://www.heblinux.org/view.php?skin=soft&amp;id=946">RedHat Linux 
      7.1正式</A>&nbsp;(20829)<BR>&nbsp;<A 
      href="http://www.heblinux.org/view.php?skin=soft&amp;id=134">XteamLinux</A>&nbsp;(20642)<BR><IMG 
      height=5 src="LINUX系统初始化过程解析.files/tabledi2.jpg" width="100%"> 
      <!--文摘分类-->&nbsp;<IMG src="LINUX系统初始化过程解析.files/artstyle.jpg" border=0> 
      <BR>&nbsp;&nbsp;<A 
      href="http://www.heblinux.org/arttype.php?dno=1">内核分析</A><BR>&nbsp;&nbsp;<A 
      href="http://www.heblinux.org/arttype.php?dno=2">网络技术及应用</A><BR>&nbsp;&nbsp;<A 
      href="http://www.heblinux.org/arttype.php?dno=3">应用编程</A><BR>&nbsp;&nbsp;<A 
      href="http://www.heblinux.org/arttype.php?dno=4">硬件应用</A><BR>&nbsp;&nbsp;<A 
      href="http://www.heblinux.org/arttype.php?dno=5">软件应用</A><BR>&nbsp;&nbsp;<A 
      href="http://www.heblinux.org/arttype.php?dno=6">系统管理</A><BR>&nbsp;&nbsp;<A 
      href="http://www.heblinux.org/arttype.php?dno=7">数据库应用</A><BR>&nbsp;&nbsp;<A 
      href="http://www.heblinux.org/arttype.php?dno=8">系统安全</A><BR>&nbsp;&nbsp;<A 
      href="http://www.heblinux.org/arttype.php?dno=9">Linux中文化</A><BR>&nbsp;&nbsp;<A 
      href="http://www.heblinux.org/arttype.php?dno=10">市场与观点</A><BR><IMG 
      height=5 src="LINUX系统初始化过程解析.files/tabledi2.jpg" width="100%"> <BR><!--合作伙伴-->&nbsp;<IMG src="LINUX系统初始化过程解析.files/friends.jpg" border=0> 
      <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A href="http://www.5ilinux.com/" 
      target=_blank>我爱linux</A><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A 
      href="http://www.heblinux.org/" 
      target=_blank>河北LINUX协会</A><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A 
      href="http://www.xteamlinux.com.cn/" 
      target=_blank>冲浪软件下载中心</A><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A 
      href="http://cosoft.org.cn/html/" 
      target=_blank>共创联盟</A><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A 
      href="http://www.coventive.com.cn/" 
      target=_blank>XLinux</A><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A 
      href="http://www.it365.net/" 
      target=_blank>诺金软件电脑网络</A><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A 
      href="http://www.ch2000.com.cn/" 
      target=_blank>中文2000软件</A><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A 
      href="http://www.csuu.com/" 
      target=_blank>中国Unix联盟</A><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A 
      href="http://freewares.cn/" 
      target=_blank>自由软件在中国</A><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A 
      href="http://www.pconline.com.cn/pcedu" 
      target=_blank>太平洋电脑信息网</A><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A 
      href="http://www.linuxaid.com.cn/" 
      target=_blank>LinuxAid</A><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A 
      href="http://www.cosoft.org.cn/" 
      target=_blank>共创软件联盟</A><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A 
      href="http://wsdn.org/" 
      target=_blank>WEB程序开发网络</A><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A 
      href="http://linux.softhouse.com.cn/" 
      target=_blank>软件屋Linux之家</A><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A 
      href="http://ljb.vpnet.cn/" 
      target=_blank>随意网络</A><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A 
      href="http://linux.ccidnet.com/" 
  target=_blank>赛迪网Linux专区</A><BR></TD></TR></TBODY></TABLE>
<CENTER>Completed in 0.0507870912552&nbsp;seconds</CENTER>
<CENTER>COPYRIGHT 2002-2003 <FONT color=#9b2626>LinuxByte.net</FONT> <A 
href="mailto:oneteam@mail.linuxbyte.net">联系本站</A></CENTER></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -