Sobes.tech
Junior — Middle

Kuidas saab operatsioonisüsteemis lõpetada või sunniviisiliselt peatada zombi-protsessi?

sobes.tech AI

Vastus AI-lt

A zombie process is a process that has finished, but its parent process has not yet read its termination status (has not called wait). In the system, it occupies an entry in the process table but does not use CPU resources.

It is not possible to forcibly terminate a zombie process directly, as it has already finished. To get rid of a zombie, you need to:

  • Terminate or restart the parent process that did not call wait. In this case, init (PID 1) will become the new parent of the zombie and will automatically call wait to clean it up.
  • Send the SIGCHLD signal to the parent process so it can handle the termination status of child processes.

Example command to send the signal to the parent:

kill -s SIGCHLD <parent_PID>

If the parent does not respond, you can terminate it:

kill -9 <parent_PID>

After that, init will take over and clean up the zombie.