I am trying to kill a du -mh
command that has been stuck running for 18 hours. I have tried many kill signals kill -15
, kill -2
, kill -9
as root but with no luck. Are there any other techniques to kill this process?
Note this is in R
running state, yet it does not appear to be responding to my kill signals.
ps -Z 31806
LABEL PID TTY STAT TIME COMMAND
unconfined 31806 ? RN 1137:41 du
D
, notR
state). In your case: maybe you don't have permission to kill it? Trystrace -e trace=kill kill PID
, and if that shows that the kill() is successful, attach to thedf
process withstrace -p PID
, kill it and see how it's reacting to the signal. – Aug 06 '19 at 11:11strace -e trace=kill kill PID
returns exit code 0, andstrace -p PID
shows attached, but no output followingkill
,kill -9
command – StackEng2010 Aug 06 '19 at 11:18kill -TSTP PID
stop it? – Aug 06 '19 at 11:33@mosvy
kill -TSTP PID` doesn't stop it either. – StackEng2010 Aug 06 '19 at 11:35gdb -p PID
? Anyways, please add the output ofps -Z PID
(instead of thetop
screenshot, which may not be accessible to some people). Also mention if you're using any kind of virtualization/containerization. – Aug 06 '19 at 11:50gdb -p PID
is "Attaching to process 31806" – StackEng2010 Aug 06 '19 at 11:58strace
succeeds because it usesPTRACE_SEIZE
which doesn't stop the process). This may be some kind of kernel bug -- also see this old question. – Aug 06 '19 at 12:58nfs(5)
and read the info on thesoft
andhard
mount options (which control timeout & retry behaviour, effectively giving you a choice between hangs like this or the risk of data corruption). I ask because I've seen hangs on df or du many times over the years when an NFS server doesn't respond to an NFS client. – cas Aug 06 '19 at 23:38du
hang may be related to docker containers hosted on this server. – StackEng2010 Aug 08 '19 at 17:28