From: Robert Klemme Date: 2009-12-27T03:50:05+09:00 Subject: Re: How to know if a process is zombie? On 26.12.2009 19:13, Iñaki Baz Castillo wrote: > El Sábado, 26 de Diciembre de 2009, Robert Klemme escribió: >> On 26.12.2009 17:53, Iñaki Baz Castillo wrote: >>> Hi, after some forks I need to know if a process still is alive or not, >>> but in case it's alive I also need to know if it's a zombie process (it >>> died without Process.wait or Process.detach). >>> >>> Unfortunatelly I couln't find how to know it using Process module: >>> http://ruby-doc.org/core/classes/Process.html >>> http://ruby-doc.org/core/classes/Process/Status.html >>> >>> Is there any other way to determine if a given PID is zombie? >> I believe you can use Process.kill(0, suspicious_pid) and if you get >> "Errno::ESRCH: No such process" it does not exist any more or is a >> zombie. > > Unfortunatelly I've already checked it and doesn't work since a zombie process > does exist and does receive signals, so Process.kill(0, suspicious_pid) > returns true. > > Anyhow I found a better approach so now I don't need need to know if a process > is zombie. > > Thanks a lot. Thank you for the heads up! Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/