Possible to kill process as root to prevent zombies?
I have a weird situation.
I have a tiny script (cgi) that is like 20 lines long. every now and then it goes crazy and creates zombies. With each site visitor the script runs then creates a zombie. Randomly, within an hour, I will get 300+ zombies which can not be removed and slow the server. I am forced to do httpd restart on a daily basis to correct the zombies. Sometimes the restart keeps the zombies away but they eventually return and then get worse.
The script is necessary and works on some servers perfectly and others creates the zombies.
Is there any command that I could use to watch this script as the root user and KILL the scipt every time it runs. Essentially, can the server itself end the script so that it doesnt go zombie?
Suppose I hosted sites and some user/site had such a script and I needed to make sure that it didnt drain the resources of the server? Is there a way to prevent a user + file from taking too many resources aside from suspending the user?