Zombie Files on a HP-UX

How can you find a zombie file on the system. I have been in the database side of the system to search for Orphan files removed the orphan files, but still got the zombie file. When you run a top command it says there is a zombie process that is running i would like to find it. How can i do that?

Thanks

A zombie process is created when a parent process dies without cleaning up its children properly. AFAIK there is nothing you can do to clean them up after the fact except reboot. They generally dont cause any harm though. If you are seeing many zombies you should investigate which program is causing them and fix the problem.

Thank you that is what i thought but was not too sure and i am not going to kill it since it is my complete database that caused this zombie process.

Thanks

About zombie processes, I have several opinion.

1) The cause lead to generation of zombie is, when the child processes stop (as you know, a signal of SIGCHLD will be sent to the father process), normally the father should do something with the signal SIGCHLD with the system call wait() or waitpid(). But if the father process encounters a logical error in his internal procedure. certainly the signal SIGCHLD is blocked. so the father can not release the resource occupied by his child processes. you can run 'ps -ef|grep defunct' to search all the zombies.

2) To solve this problem. you can kill the father process of all the dufunct processes. the initial process 'init' will release all the zombies automaticlly.

Another thing, I am from China. So my english language may be not good enough to interpret all your doubtness! Thank you!

I basicly agree with WayneYang. Every time you see a zombie on ps, look at the ppid field to find the parent program that is ignoring the death of its children. That program really has a bug and it should be fixed. And if you kill that parent, init will inherit the zombies and reap them.

But there is nothing wrong with ignoring SIGCHLD. Lots of well behaved programs simply issue the wait() call at the proper time.

try this:

 while \(\(ret = waitpid\(\(pid_t\)-1, &status, WNOHANG\)\) != 0\) \{
    printf\("ret : %d", ret\);
    \}

put this in your main loop and it will remove all defunct processes.