LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 05-24-2006, 11:47 PM   #1
rahulk
Member
 
Registered: Mar 2006
Posts: 110

Rep: Reputation: 16
Question Process hang


Hi,

I am having Linux RHAS (2.1). kernel "2.4.9-e.3smp"
I am facing issues with ps, top commands. The problem is that there are some processes in the /proc directory which are hanged. Whenever I do

ls /proc/<pid>/

the console hangs up. This problem has been there in Linux operating system for long. does anyone having any suggestions to kill these processes?

top, ps and w get the info. from the /proc file system, so if there is a hanged process, it wont allow the ps command to do a cat or ls in the process directory "/proc/<pid>". thts why the commands hangs up.

could anyone give me the idea to kill these hanged processes so that I could kill all those processes which show up themselves as hanged during an "strace" debugging.

Thanks in Advance.
 
Old 05-25-2006, 12:02 AM   #2
leosgb
Member
 
Registered: Nov 2004
Location: Brazil
Distribution: Gentoo
Posts: 363

Rep: Reputation: 31
I am not sure of what you are trying to do. I can do ls /proc/<pid>/:
ls /proc/1/
auxv cwd exe loginuid mem oom_adj root smaps statm task
cmdline environ fd maps mounts oom_score seccomp stat status wchan

If you have hanged processes you can always kill them:
ps aux (it iwll display the current processes)

After you find the pid for the process you want to kill you just:
kill -9 pid

Does this help you?
 
Old 05-25-2006, 12:55 AM   #3
rahulk
Member
 
Registered: Mar 2006
Posts: 110

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by leosgb
I am not sure of what you are trying to do. I can do ls /proc/<pid>/:
ls /proc/1/
auxv cwd exe loginuid mem oom_adj root smaps statm task
cmdline environ fd maps mounts oom_score seccomp stat status wchan

If you have hanged processes you can always kill them:
ps aux (it iwll display the current processes)

After you find the pid for the process you want to kill you just:
kill -9 pid

Does this help you?
see, what you are saying is right but kill -9 sends the terminate signal to a process. a hanged process will however receive the signal but a process exits only if it closes all the file descriptors, releasing memory maps etc.

if there is a hunged process (eg. a process trying to access the nfs mount on a server while the remote server is down) will not terminate via kill -9 command. also ps command will only work if the processes in /proc directory allows the stat file to be accesses. A hunged process does not allow the ps command to seek the stat info. thts why ps, top, w command wont work.

Thep problem what I am facing is similar to "http://www.ussg.iu.edu/hypermail/linux/kernel/0207.1/0683.html".

there is one way to get rid of this is to reboot the machine, but production systems shud not be rebooted very often. what I am looking for is anything which allows us to free the "hunged process's" memory file descriptor so that the process makes an exit.
 
Old 05-25-2006, 10:26 AM   #4
leosgb
Member
 
Registered: Nov 2004
Location: Brazil
Distribution: Gentoo
Posts: 363

Rep: Reputation: 31
Ok. I understand what you are saying but I have never seen this. After a quick search on google for "hung processes" I got a few hits:

http://uw713doc.sco.com/en/SHL_using...processes.html
http://www.serverwatch.com/tutorials...le.php/3607246

They contain the tips I gave you. Since I have never seen this kind of behavior I would suggest you to upgrade your kernel. Maybe there is some issue with it that was fixed in the later releases (2.4.9 is rather old).

If none of this happens I hope someone else can help you cause I cant Good luck!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how a father process know which child process send the signal SIGCHLD icoming Programming 10 07-20-2010 07:26 AM
Process Table-Process Control Block sarahmencer Linux - General 1 01-09-2006 09:14 PM
Bash Scripting - child process affecting parent process mthaddon Linux - General 1 05-02-2004 01:19 PM
GeForce, Hang on boot, hang on X ctrl-alt-bspace bigearsbilly Linux - Hardware 0 03-01-2004 07:56 AM
Infinite "HANG" during CD burn fixation process! ethereal Linux - Software 2 11-12-2003 12:59 PM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 02:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration