I have a process I can't kill with kill -9 <pid>. What's the problem in such a case, especially since I am the owner of that process. I thought nothing could evade that kill option.
|
|
|
However Normally, processes cannot block SIGKILL. But kernel code can, and processes execute kernel code when they call system calls. Kernel code blocks all signals when interrupting the system call would result in a badly formed data structure somewhere in the kernel, or more generally in some kernel invariant being violated. So if (due to a bug or misdesign) a system call blocks indefinitely, there may effectively be no way to kill the process. (But the process will be killed if it ever completes the system call.) A process blocked in a system call is in uninterruptible sleep. The A classical case of long uninterruptible sleep is processes accessing files over NFS when the server is not responding; modern implementations tend not to impose uninterruptible sleep (e.g. under Linux, the You may sometimes see entries marked |
|||||||||||||||||||
|
|
Did you use sudo before command? It should help. |
|||||||||||||
|
|
It sounds like you might have a zombie process. This is harmless: the only resource a zombie process consumes is an entry in the process table. It will go away when the parent process dies or reacts to the death of its child. You can see if the process is a zombie by using
|
||||
|
|
|
Sometime process exists and cannot be killed due to:
|
|||||||||||||
|
|
Kill actually means send a signal. there are multiple signals you can send. kill -9 is a special signal. When sending a signal the application deals with it. if not the kernel deals with it. so you can trap a signal in your application. But I said kill -9 was special. It is special in that the application doesn't get it. it goes straight to the kernel which then truly kills the application at the first possible opportunity. in other words kills it dead kill -15 sends the signal SIGHUP which stands for SIGNAL HANGUP in other words tells the application to quit. this is the friendly way to tell an application it is time to shutdown. but if the application is not responding kill -9 will kill it. if kill -9 doesnt work it probably means your kernel is out of whack. a reboot is in order. I can't recall that ever happening. |
|||||
|
|
If @Maciej's and @Gilles's answer's don't solve your problem, and you don't recognize the process (and asking what it is with your distro doesn't turn up answers ). Check for Rootkit's and any other signs that you've been owned. A rootkit is more than capable of preventing you from killing the process. In fact many are capable of preventing you from seeing them. But if they forget to modify 1 small program they might be spotted ( e.g. they modified |
||||
|
|
Check your You can use |
|||
|
|
You wrote you own the process so my reply is slightly off topic but for the record, note that the init process is immune to SIGKILL. |
|||
|
|
There are cases where even if you send a kill -9 to a process, that pid will stop, but the process restarts automatically (for instance, if you try it with |
|||||
|
|
Made a little script that helped me a lot take a look! You can use it to kill any process with a given name in its path(pay attention to this!!) Or you can kill any process of a given user using the "-u username" parameter.
|
|||||||||||||||
|
|
As others have mentioned, a process in uninterruptible sleep cannot be killed immediately (or, in some cases, at all). It's worth noting that another process state, TASK_KILLABLE, was added to solve this problem in certain scenarios, particularly the common case where the process is waiting on NFS. See http://lwn.net/Articles/288056/ Unfortunately I don't believe this is used anywhere in the kernel but NFS. |
|||||
|
