On Fri, 16 Jan 2015 17:04:36 +0000, notbob wrote:
> If vlc shows a Z in the "stat" column, it means the process has been
> killed, but not properly closed by the parent process which spawned
> it.
Yeah, those zombie processes might be a little tricky. When the parent
process calls wait when a process has died the process will disappear.
Until then, the process will be a living dead, a zombie. As it has
already been killed once it cannot be killed again. At least those living
dead processes does not consume any RAM or CPU.
> It's functionally dead and you cannot eradicate a zombie short of
> a reboot.
In fact, there is an easier way. If the parent process gets killed all
its child processes will be orphaned. Orphaned processes gets adopted by
the init process (with pid 1) and the init process knows how to wait
for zombies to make them pass away.
If you write a program spawning child processes yourself and don't want
to wait for those child processes at a later occasion there is a trick:
Spawn an extra child process which spawns the working child process and
then immediately exit. Wait for the extra process and then continue. The
working child process will then be orphaned and adopted py the init
process and properly waited for at exit. Zombie avoided!