Chinaunix首页 | 论坛 | 博客
  • 博客访问: 101143247
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-03-21 23:59:45

整个UNIX系统的启动过程主要做三项工作:引导核心,检查文件系统,启动各种daemon程序。即它可分为两个阶段:一是系统自举;二是启动UNIX。其中,启动UNIX阶段主要由boot程序引导核心程序开始,即系统的引导。当UNIX被引导运行后,将启动一个称之为init的进程。该进程将启动/etc/inittab文件中所列的进程,并且引导系统进入特定的运行级别。
    ?  单用户模式又称为系统维护模式,它一般只适用于系统中的用户都已退出系统,并且对系统进行维护操作时。由于在进行模式选择时直接进入到单用户模式,所以没有执行/etc/rc文件中的各种精灵程序和启动程序。而进入多用户模式时,启动的过程从设置系统的时间开始,然后继续启动相关的进程。这一点,从系统的启动过程的提示信息中可以看出。单用户模式root用户和多用户模式下的root用户状态其启动的系统资源是不一样的。读者还可从下列操作的结果中看到。
单用户模式下进行下列的操作:
# ps –ef &
    UID    PID  PPID  C    STIME      TTY        TIME CMD
    root     0     0  0    May-20       ?    00:00:00 sched
    root     1     0  0    May-20       ?    00:00:00 /etc/init
    root     2     0  0    May-20       ?    00:00:00 vhand
    root     3     0  0    May-20       ?    00:00:00 bdflush
    root     4     0  0    May-20       ?    00:00:00 kmdaemon
    root     5     1  0    May-20       ?    00:00:00 htepi_daemon /
    root     6     0  0    May-20       ?    00:00:00 strd
    root    92     1  2 20:02:48 console    00:00:00 -
    root    52     1  0 20:02:43       ?    00:00:00 /etc/ifor_pmd
    root    53    52  0 20:02:43       ?    00:00:00 /etc/ifor_pmd
    root    49     1  0 20:02:38       ?    00:00:00 /etc/syslogd
    root    41     1  0 20:02:38       ?    00:00:00 htepi_daemon /stand
    root    77     1  0 20:02:47       ?    00:00:00 strerr
root    93         1 0 20:02:49       ?    00:00:00 /var/scohttp/scohttpd -d/var  
/scohttp
    root    61    53  0 20:02:43       ?    00:00:00 /etc/sco_cpd
    root    62    53  0 20:02:43       ?    00:00:00 /etc/ifor_sld
    root   102    92  2 20:08:48 console   00:00:00 ps -ef
    #_  
多用户模式下进行下列的操作:
# ps –ef &  
     UID   PID  PPID  C    STIME      TTY        TIME CMD
    root     0     0   0   May-20          ?     00:00:00 sched
    root     1     0   0   May-20       ?     00:00:00 /etc/init
    root     2     0   0   May-20       ?     00:00:00 vhand
    root     3     0   0   May-20       ?     00:00:00 bdflush
    root     4     0   0   May-20       ?     00:00:00 kmdaemon
    root     5     1   0   May-20       ?     00:00:00 htepi_daemon /
    root     6     0   0   May-20       ?     00:00:00 strd
    root   496     1   0 20:10:03  tty01    00:00:00 /bin/login root
    root    52     1   0 20:02:43      ?     00:00:00 /etc/ifor_pmd
    root    53    52   0 20:02:43      ?     00:00:00 /etc/ifor_pmd
    root    49     1   0 20:02:38      ?     00:00:00 /etc/syslogd
    root    41     1   0 20:02:38      ?     00:00:00 htepi_daemon /stand
    root    77     1   0 20:02:47      ?     00:00:00 strerr
    root   497     1   0 20:10:03    tty02  00:00:00 /etc/getty tty02 sc_m
    root    61    53   0 20:02:43      ?     00:00:00 /etc/sco_cpd
    root    62    53   0 20:02:43      ?     00:00:00 /etc/ifor_sld
    root   498     1   0 20:10:04    tty03  00:00:00 /etc/getty tty03 sc_m
    root   499     1   0 20:10:04    tty04  00:00:00 /etc/getty tty04 sc_m
    root   469     1   0 20:09:58      ?     00:00:00 /usr/lib/scosh/calserver
    root   295     1   0 20:09:35     ?     00:00:00 rusersd
    root   258     1   0 20:09:33     ?     00:00:00 /etc/cron
    root   285     1   0 20:09:35     ?     00:00:00 portmap
    root   270     1   0 20:09:34     ?     00:00:00 /usr/lib/lpsched
    root   379     1   0 20:09:45      ?     00:00:00 statd
    root   294     1   0 20:09:35      ?     00:00:00 rwalld
    root   500     1   0 20:10:04   tty05   00:00:00 /etc/getty tty05 sc_m
            …
    root   313     1   0 20:09:36      ?     00:00:00 /etc/inetd
    mmdf   348     1   0 20:09:40          ?     00:00:00 /usr/mmdf/bin/deliver -b
    root   374     1   0 20:09:45     ?     00:00:00 biod 4
    root   375     1   0 20:09:45     ?     00:00:00 biod 4
    root   376     1   0 20:09:45          ?     00:00:00 biod 4
    root   377     1   0 20:09:45     ?     00:00:00 biod 4
    root   326     1   0 20:09:36     ?     00:00:00 routed
    root   346     1   0 20:09:38          ?     00:00:00 /etc/snmpd
            …
    root   481     1   0 20:10:03     ?     00:00:00 /usr/lib/scosh/caldaemon
    root   501     1   0 20:10:04    tty06   00:00:00 /etc/getty tty06 sc_m
    root   502     1   0 20:10:04    tty07   00:00:00 /etc/getty tty07 sc_m
    root   503     1   0 20:10:04    tty08   00:00:00 /etc/getty tty08 sc_m
    root   504     1   0 20:10:04    tty09   00:00:00 /etc/getty tty09 sc_m
    root   505     1   0 20:10:04    tty10   00:00:00 /etc/getty tty10 sc_m
    root   506     1   0 20:10:04    tty11   00:00:00 /etc/getty tty11 sc_m
    root   507     1   0 20:10:04    tty12   00:00:00 /etc/getty tty12 sc_m
    root   508     1   0 20:10:04     ?     00:00:00 /tcb/files/no_luid/sdd
    root   533   496   2 20:11:25    tty01   00:00:00 -sh
    root   541   533   4 20:12:35    tty01   00:00:00 ps -ef
    #_
    从上述的运行结果看,读者可以发现两种模式下的系统资源配置是不同的。UNIX 是多用户、多任务的操作系统,核心是构成UNIX 内核的程序,但它不能为用户包揽一切。在任何时候, 运行UNIX系统都处在一个运行级(run level)上。用户模式的选择,就是UNIX系统根据用户的选择来启动为用户服务的有关进程(软件的配置)。所以,系统运行的模式体现着系统的资源配置(关于进程的概念,请读者参见第7章的相关章节的内容介绍)。
    ?  在有些情况下,用户可以让系统自动进行启动。如果在一个指定的时间内,比如60秒,用户没有对启动提示作出反应,系统将自动进行启动。其缺省的过程如下:
(1) 从主硬盘装载缺省核心/stand/unix;
(2) 如果必要的话,清理root文件系统;
(3) 启动到多用户模式;
(4) 停顿30秒以设置日期和时间;
(5) 检查安全性数据库;
(6) 清理并安装在系统启动时设置安装的内容
阅读(643) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~