script of stopped and zombie process
时间: 2024-05-02 20:23:31 浏览: 19
A stopped process is a process that has been paused and is waiting for some signal to continue execution. This can happen when a user presses Ctrl+Z while a process is running, which sends a SIGTSTP signal to the process. The process will then be stopped and its status will be displayed as "T" in the output of the ps command.
A zombie process, on the other hand, is a process that has finished executing but has not been properly cleaned up by its parent process. This can happen when the parent process fails to call the wait() system call to retrieve the exit status of the child process. The child process will then be marked as a "zombie" and its status will be displayed as "Z" in the output of the ps command.
Here's an example output of the ps command showing a stopped and a zombie process:
```
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
user 12345 0.0 0.1 12345 6789 pts/0 T 09:00 0:00 long_running_process
user 23456 0.0 0.0 0 0 ? Z 09:01 0:00 zombie_process
```
In this example, the first process (PID 12345) is a stopped process, marked with a "T" in the STAT column. The second process (PID 23456) is a zombie process, marked with a "Z" in the STAT column.
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)