1833328 Members
2855 Online
110051 Solutions
New Discussion

Stopping hung processes

 
SOLVED
Go to solution
Jeffrey Davis_1
Frequent Advisor

Stopping hung processes

Hi all,
I'm sure I answered my own question, but I need to ask because I cannot reboot this machine this week and I need to get some work done.
I have a file system (vxfs) called /dbs/USDEV_6 which has a few processes that were running against it doing different things: 'll', 'tar', 'll -R'
Somehow, thanks to lost connections via nfs or other these processes seem to be hung now.
A 'ps -eaf' shows the processes are in the process table and have lost their parent attachment (now assigned to init). These processes are also 'sleeping' in 'top'.
I have tried 'kill'ing from several angles: 9, 3, 15, etc. to no avail. I cannot 'umount' the file sys for obvious reasons, and I tried stopping the processes with 'fuser -k', no help.
Is there any hope for me without having to reboot the system????
8 REPLIES 8
Sanjay_6
Honored Contributor
Solution

Re: Stopping hung processes

Hi Jeff,

quote //

The only sure way to kill a defunct process is to reboot. You may be able to kill it by changing to a single-user state and then back to your normal initial state.

A defunct process does no harm to the system, however. You may safely allow it to remain.

//unquote

hope this helps.

Regds
A. Clay Stephenson
Acclaimed Contributor

Re: Stopping hung processes

Hi Jeffrey,

Since all of the processes are blocked waiting on I/o they are not going to notice your signals. Normally, NFS mounts should recover if your can get the server back up. If not, well time for the big reboot.
If it ain't broke, I can fix that.
Rita C Workman
Honored Contributor

Re: Stopping hung processes

As you said...you have answered your own question.

If the process is hung and now owned by '1' the system, then the only option you can do to effectively clear these up...is the dreaded reboot.

Rgrds,
Rita
Sanjay_6
Honored Contributor
Bernie Vande Griend
Respected Contributor

Re: Stopping hung processes

Unfortunately you are probably force to reboot to clear them up since they are defunct.

If it is an NFS issue sometimes things can be recovered once the NFS server is brought back up, but since these processes are already defunct, a reboot is likely the only way to clear them.
Ye who thinks he has a lot to say, probably shouldn't.
Roger Baptiste
Honored Contributor

Re: Stopping hung processes

<>

If these processes are orphaned/defunct,
they won't be consuming any resources, except
for taking up an entry in the process table.
So, i don't see any need for rebooting the system. In any busy system with lots of users, one can see atleast a few defunct processes around and it is considered as "normal" to let this guys float around until the next reboot.

If these processes are "runaway" processes,
which consume CPU time very rapidly, they there is a need to kill them and infact they are killable, unlike defunct processes.

Based on the info you gave, my suggestion would be to just let them be as it is , unless they are hogging system resources .

-raj
Take it easy.
Deepak Extross
Honored Contributor

Re: Stopping hung processes

RajMan,

Defunct process can be quite a bother occasionally. A couple of cases in point:

1. The defunct process has opened a connection to a database, and somebody wants to take a dump of the database. dbexport will not run if the database has any open connections.

2. This guy uses a compilation script, which compiles his source and then 'cp -f's the fresh executable into the runtime environment. But the old exe is still running, so he gets an error.

Times like this, there's no alternative to rebooting the box
Frank Slootweg
Honored Contributor

Re: Stopping hung processes

Deepak, a *real* defunct ("zombie") process, i.e. "" in the ps(1) output *can not* have "opened a connection to a database". Therefor its is always important to check if a process is defunct, hanging, looping, etc., because each of these are different and need different solutions. For details about real defunct/zombie processes see "zombie process" in the glossary(9) ("man glossary") manual page.