Processes that can't be killed!

tux_compIf you are accustomed to kill processes with kill(all), <Ctrl-c> etc. on Linux you’ll be disappointed to know that there are some rare cases (or rather a process state) in which the process can’t be killed – the D+ state (D indicates “Disk sleep”). man ps says this is the uninterruptible sleep state. In layman’s terms the process is waiting for something (normally IO) and can’t do anything further, for example – die, till the IO operation is complete (no, this is not a deadlock where multiple processes wait on each other). It’s a kernel level sleep and a process is meant to be in this state for a fraction of a second. However, this sometimes lead to a process hang in cases like disk access or a buggy ioctl call. You can’t handle it even if you are the root (which is nothing but an enhanced privilege level to the kernel). The only way to get rid of it is a good old reboot.

Please note that this is different from the Z (zombie) state in which the process is simply waiting for the parent to read its exit status and can be killed.

Leave a Reply

Your email address will not be published. Required fields are marked *