LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-01-2013, 09:20 PM   #1
smilemukul
Member
 
Registered: Jun 2009
Distribution: Redhat,CentOS,Ubuntu,Puppet
Posts: 292

Rep: Reputation: 34
unable to kill a process (sleeping state)


Hi,

I am unable to kill a process which is in sleeping state.Also tried to kill the parent process (ppid)of the process but still no luck.

I followed some points as,

1. kill -9 pid
2. killall -9 pid
3. pkill -9 pid
4. lsof (there are some open files)
5. kill -9 ppid
6. pkill -9 ppid

Any solution will be appreciated.
 
Old 06-01-2013, 09:35 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Can you show us the results of ps aux | grep <pid>. Also, can you check that, having killed the parent, that the child process has been adopted by init (its parent process ID should now be 1). You can quickly do this with "ps -o ppid pid".

If the process is in state "D" as opposed to "S", then it is in uninterruptable sleep, usually because of I/O, and it cannot be killed by any means until whatever operation put it in uninterruptable sleep completes. If it's in state "S", kill -9 should've taken care of it, so I'm a bit confused...
 
2 members found this post helpful.
Old 06-02-2013, 11:12 AM   #3
smilemukul
Member
 
Registered: Jun 2009
Distribution: Redhat,CentOS,Ubuntu,Puppet
Posts: 292

Original Poster
Rep: Reputation: 34
The result of ps aux | grep <pid> shows me the same entry for that pid even after killing the child & parent both & the parent id for that child process is 11. Also after killing the process, I had waited for 30 mins but still I see the same entry in ps.

Also the process is in sleeping state & not D state as I cannot show the print screen due to security reasons.
 
Old 06-02-2013, 01:39 PM   #4
WHITE_POWER
LQ Newbie
 
Registered: May 2013
Posts: 8

Rep: Reputation: Disabled
Have you tried pkill with the -P option. This will kill the parent and it's childs.

pkill -P $( pgrep program_name )

Replace program_name with the program that is sleeping. If that doesn't work, try with the ppid
 
1 members found this post helpful.
Old 06-02-2013, 02:05 PM   #5
smilemukul
Member
 
Registered: Jun 2009
Distribution: Redhat,CentOS,Ubuntu,Puppet
Posts: 292

Original Poster
Rep: Reputation: 34
Thanks for the info but I had tried killing both child & parent (ppid) id but still no luck ?
 
Old 06-02-2013, 05:08 PM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,714

Rep: Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280Reputation: 1280
It depends on what the process is waiting for. It will not be cleaned up while it is in an uninterruptable wait.

User memory will be released, but the process header will remain while waiting (and any locked memory for I/O if there is any). This is a zombie state - its dead, but not completely dead.

That is why you were asked for the ps report... it will show what it is waiting for.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Unable to kill process with kill -9 pgb205 Linux - Software 5 01-13-2011 04:55 PM
Unable to kill a process bibinskariah Linux - Newbie 3 05-26-2009 10:21 PM
Unable to kill a process sunhui Linux - Software 2 03-29-2007 10:27 PM
Unable to kill the process rajaniyer123 Linux - General 5 03-02-2007 09:27 AM
kill process in D state michal017 Linux - Software 1 04-28-2004 03:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:52 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration