LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   unable to kill a process (sleeping state) (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-kill-a-process-sleeping-state-4175464405/)

smilemukul 06-01-2013 08:20 PM

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.

btmiller 06-01-2013 08:35 PM

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...

smilemukul 06-02-2013 10:12 AM

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.

WHITE_POWER 06-02-2013 12:39 PM

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

smilemukul 06-02-2013 01:05 PM

Thanks for the info but I had tried killing both child & parent (ppid) id but still no luck ?

jpollard 06-02-2013 04:08 PM

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.


All times are GMT -5. The time now is 06:24 AM.