logo

Navigation:First_Community->Computer->Linux Goto:New TopicSettingSearch
Linux 网管 123 --- 第9章. 各种杂项管理工作 -2.管理进程
Posted by: imac Date: March 29, 2008 02:49AM
    随着时间增加,您可能会想看看 Linux 上正在执行的行程。要得到行程列表的话,键入

CopyRight owned by the original author.--(www.MegaEntry.com)

 ``ps -aux ' ',看起来会像下面这个样子:    USER       PID %CPU %MEM  SIZE   RSS TTY STAT START   TIME COMMAND bin         69  0.0  1.0   788   320  ?  S   Nov 30   0:00 /usr/sbin/rpc.portmap frampton 10273  0.0  2.1  1136   664  p0 S    14:12   0:00 -bash frampton 10744  0.0  1.1   820   360  p0 R    17:25   0:00 ps -aux frampton 10745  0.0  0.8   788   264  p0 S    17:25   0:00 more

CopyRight owned by the original author.--(www.MegaEntry.com)

nobody   10132  0.0  1.8  1016   588  ?  S    13:36   0:00 httpd nobody   10133  0.0  1.8   988   568  ?  S    13:36   0:00 httpd nobody   10413  0.0  1.8  1012   580  ?  S    14:56   0:00 httpd nobody   10416  0.0  1.8  1012   580  ?  S    14:56   0:00 httpd nobody   10418  0.0  1.8  1012   588  ?  S    14:57   0:00 httpd nobody   10488  0.0  1.7   976   556  ?  S    15:34   0:00 httpd

CopyRight owned by the original author.--(www.MegaEntry.com)

nobody   10564  0.0  1.8   988   564  ?  S    16:06   0:00 httpd nobody   10600  0.0  1.8   988   564  ?  S    16:15   0:00 httpd nobody   10670  0.0  1.8   988   568  ?  S    16:45   0:00 httpd nobody   10704  0.0  1.7   976   552  ?  S    17:03   0:00 httpd root         1  0.0  1.0   776   312  ?  S   Nov 30   1:13 init [3] root         2  0.0  0.0     0     0  ?  SW  Nov 30   0:00 (kflushd)

CopyRight owned by the original author.--(www.MegaEntry.com)

root         3  0.0  0.0     0     0  ?  SW  Nov 30   0:00 (kswapd)   上面的列表显示出行程的拥有者 (“nobody”是特别的服务,像是网页等),行程识别数字,行程目前 所占 CPU 时间的百分比,行程所耗的记忆体百分比,还有其他资讯,以及任务本身的描述。 

MegaEntry - Social networking and discussion site!

要得到特定行程的详细资讯,键入 ``pspid ' ' (“pid”是行程识别数字)。看看我们上面的例子,  “ps 10704” 将会显示 :    10704  ?  S     0:00 /usr/local/etc/httpd/httpd  

MegaEntry - Social networking and discussion site!

这显示出这个特别的行程是网页伺服 (Apache 网页伺服器在行程列表中出现好几次 ; 要得到更多有关 讯息可以查看 第7章,网页伺服器及 HTTP 快取代理主机管理 ).  如果您突然发现某一服务没有运作,您可以使用“kill -HUP pid” (“pid”是上面用“ps”显示的程 序列表中的行程识别数字)。例如,如果 Internet 服务 (称做 inetd 的程序,在我们的例子中的 #123 程序) 没有照他们应该作的运作, ``kill -HUP 123 ' ' (或更安全一些,使用 ``killall ' ' 指令指定程序名

MegaEntry - Social networking and discussion site!

称 : ``killall -HUP inetd ' ')应该会重新启动该程序。 -HUP 选项对於 kill 指令的意义是“挂断”;  程序知道被认定为自我重新载入。  如果您无法解决这个问题,另一个方法是关闭系统然後重新启动它 (查看 第6章,关闭系统及重新启动  有关细节)。 

CopyRight owned by the original author.--(www.MegaEntry.com)

偶尔,您可能需要暂时搁置一个行程,然後晚一点再继续执行它。例如,您可能执行需要强调 CPU工作的 程式,烧录 IDE 介面的可写入式光碟机。既然 IDE 介面设备较仰赖 CPU 做输出及输入,如果 CPU 太忙 碌的话可能会耗尽缓区,然後您最後会得到一个杯垫而不是录好的光碟 ! 下面的指令会搁置行程,然後 再分别地继续他们:    kill -STOP 945 kill -CONT 945

CopyRight owned by the original author.--(www.MegaEntry.com)

  Red Hat 提供启动及停止一些程序的较好方法,在後面的 行程的启动及停止 提及


Reply To This Message
Subject: 

Copyright 2005-2006 megaentry,All Rights Reserved
IE 6.0 or above is perfect