0

I started some processes from my local machine (using PyCharm) and also by accessing the remote machine with ssh.

Now I have multiple processes with states R or Rs that are not killable. If I use kill -9 I don't get any errors but the process still exists. I checked for parent processes using ps -o ppid= -p <PID> and get 1 back.

Unfortunately, I don't know how to proceed and the processes take up resources.

oezguensi
  • 101
  • 2
  • Can you edit your question and add the output of ps -o user,pid,stat,command -p PID for some PID in the state that you're describing? – Andy Dalton May 08 '20 at 21:29

1 Answers1

0

If you use kill -9 and the processes don't die, they are likely in the process of dying, but are waiting on some system resource request to complete before they can proceed to die. You can try and find some dodgy method of trying to make them give up but the only guaranteed method is to restart the system. Your other choice is to leave them and hope they die on their own. Their are answers to a similar issue here that basically say the same, but I've never come across a sure-fire method to kill parasitic processes that won't die.

It may help if you know what they may be waiting on... if, for example, they are waiting on network file resources, you could try to unmount the nfs drive that they are waiting on. If you know anything further, you could try to artificially satisfy whatever it is they are requesting. Aside from that, there's not much else.

Fubar
  • 806
  • 3
  • 10
  • 1
    Your answer is describing processes in state D, but this question is asking about processes in state R. – Joseph Sible-Reinstate Monica May 08 '20 at 18:42
  • if they're in state R and don't die, they're likely still waiting for SOMETHING, or else they are consuming CPU at an alarming rate because they can't even spare the time to handle an interrupt. The other alternative is that interrupts were disabled somewhere in the code, so any kill would just get laughed off by the process. – Fubar May 08 '20 at 18:52
  • 1
    A process in the R state cannot block, ignore, postpone, laugh off, or consume CPU at any rate that would prevent its termination when SIGKILL is delivered. – Andy Dalton May 09 '20 at 20:21
  • 1
    you're right of course, I answered flippantly and wasn't concerned with facts ;-) If the SIGKILL was sent and ignored, likely the process was not in R state. – Fubar May 11 '20 at 12:15