📜  Zombie、Orphan 和 Daemon 进程之间的区别

📅  最后修改于: 2022-05-13 01:56:11.519000             🧑  作者: Mango

Zombie、Orphan 和 Daemon 进程之间的区别

1.僵尸进程:
Zombie 是一个已完成其任务的进程,但它仍然在进程表中显示一个条目。僵尸进程通常发生在子进程中。很短的时间进程就是一个僵尸。在进程完成其所有任务后,它会报告它即将终止的父进程。

僵尸进程状态

Zombie 无法自行终止,因为它被视为死进程。所以父进程需要执行终止命令来终止child.is

2.孤儿进程:
即使在其父进程终止或完成而不等待子进程执行之后仍保持运行的子进程称为孤儿进程。一个进程无意中变成了一个孤儿。由于长时间运行时间来完成分配的任务而没有用户注意,有些时间故意成为孤儿。孤立进程具有控制终端。

3.守护进程:
守护进程在系统启动时开始工作,仅在系统关闭时终止。它没有控制终端。它总是在后台运行。

Zombie、Orphan 和 daemon 进程之间的区别:

Sl.No

Zombie Process

Orphan Process

Daemon Process

1.A Zombie is a process that has completed its task but still, it shows an entry in a process table.A child process that remains running even after its parent process is terminated or completed without waiting for the child process execution is called an orphan.A daemon process is a system-related process always running in the background.
2.Zombie process states always indicated by ZThe orphan process was created unknowingly due to a system crash.Daemon process state indicated by ? in the field of tty column in the output
3.The zombie process has controlling terminalsOrphan The zombie process has controlling terminals. The daemon process does not have controlling terminals.
4.The zombie process treated as dead they are not used for system processingAn orphan process is a computer process even after their parent terminates init is become a parent and continue the remaining task.A program that runs for a long time makes them as a daemon process and runs it in the background.
5.To remove the zombie process execute the kill command.Terminate the Orphan process use the SIGHUP signal.Daemon process only when system shutdown.