Operating System - HP-UX
1838661 Members
11941 Online
110128 Solutions
New Discussion

Is there a way to check if a process is hanging?

 
Tom Van Den Broeck
New Member

Is there a way to check if a process is hanging?

I have already a few thoughts:

1. check manpage of ps
ps -fl shows state and more info about process. (like time and etime)
ps -pl

2. Use tusc to connect to the pid and show all the active systemcalls.

3. Use glance to check what the process is blocked on.

Any more ideas? Can we check this within an ITO monitor?
4 REPLIES 4
Steven Gillard_2
Honored Contributor

Re: Is there a way to check if a process is hanging?

As you state tusc and glance are probably your best tools to see what a process is doing. If the process is not responding and not making any system calls or using any CPU in user mode then its likely to be hung.

Your other option is to attach a debugger like wdb to the process to get a stack trace. This will be a lot easier if you have the source code.

To check if applications are hung, I have various scripts run from ITO every 2mins or so that checks for the responsiveness somehow. For example if its a web server I have a C program (could easily be done in perl as well) that connects to the port and requests the index page. If there is no response some action is taken - the app may be restarted or an error may be reported. Different applications will have different types of checks, but there is usually some form of active check you can do to decide whether a process is responding or not.

Regards,
Steve
Corthouts Carlo
Valued Contributor

Re: Is there a way to check if a process is hanging?

Hi,

If you can see the rope.....it is hanging :-))
Juan Manuel López
Valued Contributor

Re: Is there a way to check if a process is hanging?

You can use the top command and see if there is activity of your process.
Also you can use ps -ef | grep " your process " and the appropiated flags to see your process activity.

I hope this help.

Juanma.
I would like to be lie on a beautiful beach spending my life doing nothing, so someboby has to make this job.
Juan Manuel López
Valued Contributor

Re: Is there a way to check if a process is hanging?

So, please, give us points !
Thanks in advance.

Juanma.
I would like to be lie on a beautiful beach spending my life doing nothing, so someboby has to make this job.