zombie and orphan process in Linux-Unix systems

link: http://www.coolcoder.in/2013/12/process-types-in-linux-unix-systems.html




Zombie Process:



On Unix and Unix-like computer operating systems, a zombie process or defunct process is a process that has completed execution but still has an entry in the process table. This entry is still needed to allow the parent process to read its child's exit status. The term zombie process derives from the common definition of zombie? an undead person. In the term's metaphor, the child process has "died" but has not yet been "reaped". Also, unlike normal processes, the kill command has no effect on a zombie process.
 Zombies can be identified in the output from the Unix ps command by the presence of a "Z" in the "STAT" column.
A zombie process is not the same as an orphan process. An orphan process is a process that is still executing, but whose parent has died. They do not become zombie processes; instead, they are adopted by init(process ID 1), which waits on its children. 

There are certain ways to list the zombie processes like:
  ps -Al | grep 'Z'  
S : sleeping  
R : running  
w : waiting (over het algemeen voor IO)  
T : gestopt (suspended) of getrasseerd  
Z :  zombie (defunct) 


OR 
ps -el | grep 'Z' 


Parent process: 

        In the operating system Unix, every process except process 0 (the swapper) is created when another process executes the fork() system call.


The process that invoked fork is the parent process and the newly-created process is the child process.
 
Every process (except process 0) has one parent process, but can have many child processes.
  

Orphan Process:

 An orphan process is a computer process whose parent process has finished or terminated , though it remains running itself. 
 In a Unix-like operating system any orphaned process will be immediately adopted by the special init system process.
 This operation is called re-parenting and occurs automatically.
 Even though technically the process has the init process as its parent, it is still called an orphan process since the process that originally created it no longer exists. 
  

Child Process: 

 A child process in computing is a process created by another process (the parent process).
 A child process inherits most of its attributes, such as open files, from its parent. 
 In UNIX, a child process is in fact created (using fork) as a copy of the parent. 
 The child process can then overlay itself with a different program (using exec) as required.
 Each process may create many child processes but will have at most one parent process; if a process does not have a parent this usually indicates that it was created directly by the kernel. 

 Daemon process: 

In Unix and other multitasking computer operating systems, a daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user.



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值