1831206 Members
2813 Online
110021 Solutions
New Discussion

Command hangs

 
SOLVED
Go to solution
Roboz
Frequent Advisor

Command hangs

Hello folks,
I have a small but nagging problem. I am using the HPUX command “devnm” within a shell script to identify the device file where a particular file system resides. This is very handy when you try to identify de devices in a long list of file systems, extracting this data using commands such as bdf in a pipe is not always successful due to some of the naming convention. Now that you know the background info here is the problem. When I run the command with the /usr parameter or any other parameter it hangs. Any attempt to kill the process shown by “ps” fails, even the good old kill -9 (kill –s KILL ) fails to kill the process. The process is not reported as a zombie so it looks like is still running. Nothing much has changed in the system, there have been no patches or fixes installed since or prior to the problem starting. The file systems are in SAN storage and can be accessed by the applications without problems. What could be causing the “devnm” command to hang? any ideas? Thank you for your help.
9 REPLIES 9
James R. Ferguson
Acclaimed Contributor

Re: Command hangs

Hi:

If you can't kill the process with '-9' then the process is in kernel code, probably waiting on an I/O.

Perhaps you would post your script or a decomposition of it that fails too.

Regards!

...JRF...
Steven E. Protter
Exalted Contributor

Re: Command hangs

Shalom,

JRF said what I'd have said.

If kill -9 can't kill it, the Parent process ID is probably 1.

You can't kill process 1 because the whole system would go down.

Therefore you either wait for the I/O to complete, if thats the issue or reboot your system.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor

Re: Command hangs

The problem is that the process is blocking waiting on I/O which has a higher priority than signal handling. The process cannot process your signal request (kill) until the i/o request is satisfied. I would avoid using devnm because 1) it is a non-standard command 2) it recursively descends the /dev tree so it is much more likely to hang (again waiting on i/o) than commands which examine mnttab (df, bdf).
If it ain't broke, I can fix that.
Kent Ostby
Honored Contributor

Re: Command hangs

If you are running 11.11, make sure you have the devnm patch installed --> PHCO_28941
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Roboz
Frequent Advisor

Re: Command hangs

Hey folks thanks for your prompt reply...
I have figured that the devnm process in in kernel mode with a high priority... nice to know you agree BUT my problem persist.... What can be causing the command to hang? Waiting for i/o ? but it had done that always and now it fails?... I will check the patch suggested and install it, see what happens. Thank you so much for your help, if you have any other idea I'll be happy to hear them.
Arunvijai_4
Honored Contributor
Solution

Re: Command hangs

Hello,

You can try running the command under "tusc" to see where it hangs,

tusc can be downloaded from,

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/tusc-7.8/

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
JASH_2
Trusted Contributor

Re: Command hangs

Roboz,

I have suffered the same kind of problems when I had a disk about to fail, application was running fine, but any kind of i/o request like ioscan was failing. It was also failing when I did a recursive ls down the directory tree.

May not be the same, but worth bearing in mind.

Cheers,

JASH
If I can, I will!
Andrew Merritt_2
Honored Contributor

Re: Command hangs

Does the problem happen when you run 'devnm' on the command line, or only inside your script?

If only inside the script, perhaps there's a problem with how devnm is being called. Add a line 'set -x' at the beginning of the script to log the calls it is actually making and see if you can see anything obviously wrong or odd.

Andrew
Roboz
Frequent Advisor

Re: Command hangs

Hello Folks,
First of all thank you so much for your help; all your replies have been most useful. I originally had the problem with devnm from the script as well as the command line, with any parameter (i.e. /usr , /home, etc). Nothing really had change in the server no patches or kernel changes, only a license upgrade for DP5.1, the problem seams to have come from no were. After following your advices I tracked the problem to a totally unrelated scenario. An auxiliary file system was held open (busy) by a separate process that will not exit, like the the â devnmâ was running at PRIO=127 and could not be killed. So the only way to â umountâ the file system was a reboot. After the reboot both the mount/umount as well as devnm command are al working fine and my script runs smoothly once again, Thanks folks for your help.
Roboz
PS.
Arunvijai: Thanks for the tip on such a good toolâ ¦ works great
JASH: yesâ ¦. I have done some diagnostic and exercising of some devices via stm. you right better to be sure than sorry
STEVEN,CLAY,KENT: good hints and additional information.
POINTS ALL AROUNDâ ¦ thanks.