Mandar
Mandar

Reputation: 733

Is there some cases in which SIGKILL will not work?

Are there any cases where an application running on Linux, which has not blocked signal SIGKILL, will not get killed on firing SIGKILL signal?

Upvotes: 10

Views: 8758

Answers (3)

magor
magor

Reputation: 709

Check with ps a (or you can use other flags as well) the process state. If a process state is

D : uninterruptible sleep (usually IO)

then you cannot kill that process.
As others mentioned, and as it is defined, this is usually caused by a stuck I/O, for example process waiting to do I/O to a disconnected NFS file system.

Upvotes: 5

Mat
Mat

Reputation: 206689

SIGKILL cannot be blocked or ignored (SIGSTOP can't either).

A process can become unresponsive to the signal if it is blocked "inside" a system call (waiting on I/O is one example - waiting on I/O on a failed NFS filesystem that is hard-mounted without the intr option for example).

(Another side case is zombie processes, but they're not really processes at that point.)

Upvotes: 13

Yes, when the process is blocked in kernel space, e.g. reading on a blocked NFS file system, or on a device which does not respond.

Upvotes: 7

Related Questions