当前位置: 技术问答>linux和unix
请问下linux下的进程问题,顺便散分!
来源: 互联网 发布时间:2017-01-15
本文导语: 用ps axj命令查看下有 "[****]"样子的进程,是什么类型的进程啊,他的父进程ID是1,即init进程。 但是僵尸进程是"[****] defunct"。上面的那种是啥进程呀。。哎! 小弟在此多谢大家发言! | 简...
用ps axj命令查看下有 "[****]"样子的进程,是什么类型的进程啊,他的父进程ID是1,即init进程。
但是僵尸进程是"[****] defunct"。上面的那种是啥进程呀。。哎!
小弟在此多谢大家发言!
但是僵尸进程是"[****] defunct"。上面的那种是啥进程呀。。哎!
小弟在此多谢大家发言!
|
简单在ubuntu下看了,不知道你说的是否是如下进程:
PPID PID PGID SID TTY TPGID STAT UID TIME COMMAND
0 1 1 1 ? -1 Ss 0 0:00 /sbin/init
0 2 0 0 ? -1 S 0 0:00 [kthreadd]
2 3 0 0 ? -1 S 0 0:00 [migration/0]
2 4 0 0 ? -1 S 0 0:00 [ksoftirqd/0]
2 5 0 0 ? -1 S 0 0:00 [watchdog/0]
2 6 0 0 ? -1 S 0 0:00 [events/0]
2 7 0 0 ? -1 S 0 0:00 [cpuset]
2 8 0 0 ? -1 S 0 0:00 [khelper]
2 9 0 0 ? -1 S 0 0:00 [netns]
2 10 0 0 ? -1 S 0 0:00 [async/mgr]
2 11 0 0 ? -1 S 0 0:00 [pm]
...
这些[***]的进程,可能是Linux的守护进程或者一些重要的内核态进程。
这些进程的作用可能是监视系统运行,或者是提供设备驱动等。
如watchdog用于监视系统的运行。
可以参考:
http://blog.csdn.net/flykite1988/article/details/6255246
PPID PID PGID SID TTY TPGID STAT UID TIME COMMAND
0 1 1 1 ? -1 Ss 0 0:00 /sbin/init
0 2 0 0 ? -1 S 0 0:00 [kthreadd]
2 3 0 0 ? -1 S 0 0:00 [migration/0]
2 4 0 0 ? -1 S 0 0:00 [ksoftirqd/0]
2 5 0 0 ? -1 S 0 0:00 [watchdog/0]
2 6 0 0 ? -1 S 0 0:00 [events/0]
2 7 0 0 ? -1 S 0 0:00 [cpuset]
2 8 0 0 ? -1 S 0 0:00 [khelper]
2 9 0 0 ? -1 S 0 0:00 [netns]
2 10 0 0 ? -1 S 0 0:00 [async/mgr]
2 11 0 0 ? -1 S 0 0:00 [pm]
...
这些[***]的进程,可能是Linux的守护进程或者一些重要的内核态进程。
这些进程的作用可能是监视系统运行,或者是提供设备驱动等。
如watchdog用于监视系统的运行。
可以参考:
http://blog.csdn.net/flykite1988/article/details/6255246
|
看到一点解释
ps tries to determine the current command name and arguments both of which
may be changed asynchronously by the process. These are then displayed. Failing this, the command name as it would appear without the option
-f, is written in square brackets
ps tries to determine the current command name and arguments both of which
may be changed asynchronously by the process. These are then displayed. Failing this, the command name as it would appear without the option
-f, is written in square brackets
|
补充说明:
线程标志: ps的名称现实里面加"[]"的是内核线程。
参考的:http://www.itkee.com/os/detail-a64.html
如果你不清楚,可以搜索下进程名(或线程名),看看它到底是什么作用。
线程标志: ps的名称现实里面加"[]"的是内核线程。
参考的:http://www.itkee.com/os/detail-a64.html
如果你不清楚,可以搜索下进程名(或线程名),看看它到底是什么作用。
|
PROCESS STATE CODES
Here are the different values that the s, stat and state output specifiers
(header "STAT" or "S") will display to describe the state of a process.
D Uninterruptible sleep (usually IO)
R Running or runnable (on run queue)
S Interruptible sleep (waiting for an event to complete)
T Stopped, either by a job control signal or because it is being traced.
W paging (not valid since the 2.6.xx kernel)
X dead (should never be seen)
Z Defunct ("zombie") process, terminated but not reaped by its parent.
For BSD formats and when the stat keyword is used, additional characters may
be displayed:
Here are the different values that the s, stat and state output specifiers
(header "STAT" or "S") will display to describe the state of a process.
D Uninterruptible sleep (usually IO)
R Running or runnable (on run queue)
S Interruptible sleep (waiting for an event to complete)
T Stopped, either by a job control signal or because it is being traced.
W paging (not valid since the 2.6.xx kernel)
X dead (should never be seen)
Z Defunct ("zombie") process, terminated but not reaped by its parent.
For BSD formats and when the stat keyword is used, additional characters may
be displayed: