Kill phantom jobs automatically?

Hello,

now I have the following problem:
I want to kill phantom jobs automatically every minute, for example with a shellscript.

How can I secure identify, which process is a phantom job?

I hope someone has a great idea.

Thank you very much.

I have never heard the term "phantom job" before. Can you give us a more clear idea of what you mean?

if you are talking about zombie procceses:

ps -aefcl can be used to let you know if you have a zombie processes. the 2nd column will have a Z for zombie.

Last week end I tried to kill some Zombie processes that dont let me shutted down the server as a matter of fact I tell ya, from my point of view there is no solution to kill a zombie process but a reboot. I know this is not a polite way to handle a server but even kill -9 or fuser -ck wasnt enough. I really wonder some one who know how to eliminate such processes.

I read an interesting description of zombies a while back. I can't remember where - maybe someone else can.
Have you ever seen the movie "The Princess Bride"? If so, you remeber that the main character was not dead - just "mostly dead". Zombie processes are like that. You can't kill them because they don't really exist as processes.

The only way of killing them, that I'm aware is to kill the parent - and not with -9 either. Usually, when a server shuts down ( from what I've seen ), it send various kill signals to all processes, starting with a simple request, then progressing (eventually) to SIGKILL (-9), to make sure all proceeses stop. Is this happening on your server? Also, are you running any sort of large database, or disk intensive programs? If so, it can take over 20-30 minutes to write all data to disk before it will exit. Make sure you are not kill -9'ing those!

You have to kill the parent process of the zombies indeed. Normally zombies are not something you should worry about as they do not take up any resources (or little) in the kernel.