defunct processes?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users defunct processes?
# 1  
Old 05-21-2010
defunct processes?

HiI had a tool fail recently, on analysis I found it was cleaning up orphaned directories that had been created by specific processes that had died for some reason, thus failing to clean up after themselves.The directories were of the form /dir.pid. The tool would look to see if any instances of the process were running under that pid and if not would clear away the directory. It was failing because intermmittently it was seeing a instance of the pid in the ps output.I put a trap in for this (grep -vi) and all seemed well but I have now seen it fail once more, unfortunately with no trace on. I cannot replicate it as it is now so intermittent with the fix I mentioned in place.My question is "Are there any other ways a dead process can show up in the ps output and if so what should I be grepping for"?CheersPS Sorry if the format of this post is rough, my work PC is locked down and doesn't seem able to handle the java very well.
# 2  
Old 05-21-2010
dead process == zombie? What is your definition of a dead process?

The OS cycles the pid of new processes from 1 -> signed short max for most systems.

You should be checking the user/owner of the file and looking for the both the pid and the user. Not just a pid. pids are reused constantly. lsof will tell you if a process still has the file open, if that is the source of your problem.

What OS do you have? Does your system have mandatory locking -- i.e., Apps like weblogic lock directories, do you have something like that running?
This User Gave Thanks to jim mcnamara For This Post:
# 3  
Old 05-21-2010
HI Jim, thanks for the reply. Once again aplologies for the text all being in one paragraph. No the script parses a .pid extension off a temporary directory and if it doesn't find a running process with that pid it clears down the directory. The problem I found when tracing the fail was a process with that id was still listed but with the arg DEFUNCT. You have got me thinking though, perhaps the transient error I found was due to the process id being reassigned to something else. That would explain why I am struggling to replicate it. I need to look at the code again and see if I can tighten it up so it finds the process name as well as the pid. One issue I am finding with these scripts is the ps args are often truncated to fit on screen and so the process name is not recoverable from the ps output. I think that is why they may have been written that way to start with. Do you know of anyway of forcing ps to output the whole line, wrapping if necessary? It would have to work on SUN and AIX..... Once again, thanks Jim, as always your very helpful

Last edited by steadyonabix; 05-21-2010 at 11:13 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

How to clear defunct processes??

How to find out and clear the 'defunct' processes at OS and DB level ..?? (6 Replies)
Discussion started by: SurajR
6 Replies

2. HP-UX

Defunct Processes; Maximum Process

I'd like to remove this defunct processes without rebooting. Or, I could remove this defuncts when the maximum allowable process is nearly reached, then send an email to the user/team. How can I determine the maximum allowable process that a server can handle? Any thoughts? Jin@PRODUCTION: >... (3 Replies)
Discussion started by: Jin_
3 Replies

3. HP-UX

Defunct processes are getting generated

Dear Sir / Madam, We have two socket programs which are running in background. These two socket programs are creating defunct processes in HP-UX which were not happening in Compaq True64 UNIX. What is the root cause of these defunct processes and how can we correct it? Your suggestion will be... (3 Replies)
Discussion started by: kcsahoo
3 Replies

4. Shell Programming and Scripting

Abnormal behaviour of Defunct processes.

Hi All, Sorry to bother you all if my query is silly. Can you please clarify my doubts on defunct processes. Actually coming to the scenario, i have a server which is under cluster environment. Server B is having problems with the defunct process. There was a cron scheduled on Server B which... (0 Replies)
Discussion started by: reddybs
0 Replies

5. AIX

Defunct Processes

Hi, Can any one help me to get rid of defunct process on UNIX IBM AIX box. These processes started when the system was rebooted almost after 1 1/2 years. Once one defunct process is created then all the user ids get infected and in turn creates numerous defunct processes. We have tried... (6 Replies)
Discussion started by: trokia88
6 Replies

6. UNIX for Dummies Questions & Answers

whats the difference between zombie orpha and defunct processes

can some one please explain zombie orphan defunct and how they r related (3 Replies)
Discussion started by: pbsrinivas
3 Replies

7. UNIX for Dummies Questions & Answers

Question about defunct processes

Hey guys/gals. I am new to the site and fairly new to Unix/Linux. I have a master netbackup server (solaris) that I get pinged on occasionally regarding defunct processes. (Usually over 50 or so of them.) I know what a defunct process is, but what is it a product of? Just plain sloppy code? (From... (1 Reply)
Discussion started by: EMCSANMAN
1 Replies

8. Solaris

how do I kill defunct processes?

mqm 17700 16815 0 0:00 <defunct> kill -9 does not work, even as root (10 Replies)
Discussion started by: csaunders
10 Replies

9. Programming

defunct process!!

how can i assure that daemon process which is being run as init child,can be removed immediately from system when it goes defunct or to avoid daemon process becoming defunt? (5 Replies)
Discussion started by: rish2005
5 Replies

10. UNIX for Dummies Questions & Answers

<DEFUNCT> Processes

When I ps -ef I see about 3 or 4 <DEFUNCT> things - what are these, and what causes them? Are they a concern? How can I fix them? Thanks, Michael (4 Replies)
Discussion started by: cuppjr
4 Replies
Login or Register to Ask a Question