Saturday 15 August 2015

python - why Ghost Process appears after kill -9 -


In my Python script, I first launch a subprocess by subprances. Popen (). Then later, I want to kill that subprosession by using the kill-9 pid .

What has I found that after the execution of the murder, the subprocess "closed" because the GUI window disappeared immediately after that process. But when I do a ps "aux" immediately after the murder, then the same process (with the same plague) is still shown in the result. The difference is that the command of this process () is included in a pair of like () below:

root 30506 0.0 0.0 0 s000 Z + 6:13 PM 0: 00.00 (Sampling Process)

It recognizes my process as rational because the dead process can still be found by ps

Why is this happening to anyone?

Thank you! From the manual page of

Z Definct ("zombie") process ends, but is not changed by its parents.

This means that parents did not have waitpid () for the child of death.

In addition to Waitpid (), you can avoid using it while executing the child.


No comments:

Post a Comment