Operating System - HP-UX
1753837 Members
9275 Online
108806 Solutions
New Discussion юеВ

Recommendations: Defunct Processes

 
SOLVED
Go to solution
Scott Frye_1
Super Advisor

Recommendations: Defunct Processes

We have a scripts that go out and check for defunct processes. What should we do once we find them???? We typically have 3 or 4 servers with defunct processes but we don't know what action we should take with them.

Thanks

Scott
18 REPLIES 18
Sanjay_6
Honored Contributor

Re: Recommendations: Defunct Processes

Hi Scott,

Do a "ps -ef" and grep for defunt. Try a "kill -9 PID" to kill the defunt processes. you may be able to kill them or you may not. If you can't kill them, a reboot is the only way to clear them.

Hope this helps.

Regds
Pete Randall
Outstanding Contributor

Re: Recommendations: Defunct Processes

Scott,

First you should beat your programmers soundly for leaving such sloppy code around.

Second, you can try to kill them off. Start with kill -15, then kill -11 and only resort to kill -9 out of desparation. Sometimes, the processes won't die. In that case, you can sometimes get rid of them by killing the parent. However, if they're a zombie, their parent process ID is now 1 - init - and you don't want to kill that.

You really should be spending more time on why you're getting defunct processes than you are on cleaning them up.


Pete

Pete
Scott Frye_1
Super Advisor

Re: Recommendations: Defunct Processes

Pete,

I understand, but when you are at the mercy of a major application vendor specific for hospital applications, beating them (although I would not be against that) really isn't an option.
John McWilliams_1
Frequent Advisor

Re: Recommendations: Defunct Processes

Hi Scott

I always try kill -15 on the PID. This normally kills them. If that fails I use kill -9 with a 99% success rate.

Cheers John
David DeWitt_2
Frequent Advisor

Re: Recommendations: Defunct Processes

Scott,

If you're going to automate killing them (I wouldn't) you could probably add a log file to record things such as date/time, PID, Process Name. That may help both if the kills start causing other problems and as evidence to the vendor.

Has the vendor admitted that their app creates defunct processes?

-dave
Pete Randall
Outstanding Contributor

Re: Recommendations: Defunct Processes

Scott,

OK, if beating them is only a fond dream, how about regular re-boots? Do your uptime requirements allow for a nightly/weekly/fortnightly window where you could re-boot and clean up the processes that way? It would be simple enough to cron a reboot job.


Pete

Pete
Scott Frye_1
Super Advisor

Re: Recommendations: Defunct Processes

David,

We are not looking to automate the killing, just curious about what our next steps might be. I like you idea of a log file. That would be nice.

Scott
Scott Frye_1
Super Advisor

Re: Recommendations: Defunct Processes

Pete,

Reboots are not an option. We are fighting now trying to get a 2 hour maintenance window once a quarter. Regular reboots would not fly. I guess being a hospital makes a difference. Our apps have to be up 24/7 for patient care.

Scott
Pete Randall
Outstanding Contributor

Re: Recommendations: Defunct Processes

I didn't really think that would work for you but had to suggest it.

Sorry,

Pete

Pete