4

Yes, I've tried all the basic kill, pkill, etc. methods that come up with a Google search.
Sometimes it works, other times it seems something is preventing the process from terminating.
There is no stderr message when the kill command fails, but ps, pgrep, etc. show the process is still running.

Is there a more forceful way to do this? Thanks.

6
  • 3
    Try kill -9 <PID> Commented Jun 27, 2017 at 7:30
  • First thing I tried. I thought it would work too, but no such luck in this instance, unfortunately. Commented Jun 27, 2017 at 8:14
  • OK, what happened when you tried? Did you get an error message? Nothing? What does the output of ps show for this process? Please edit your question and add this information. Commented Jun 27, 2017 at 11:30
  • @terdon yep, that info's already included in the question body. The command executed, without error. It appeared to be successful, but I noticed the (non-responsive) process in question was still running. Confirmed by pgrep, and also ps aux. Wouldn't even let me do a clean reboot. It's not the first time I've encountered this behaviour. Commented Jun 27, 2017 at 13:27
  • 1
    Yes, but can you please show us the output of ps so we can see what it reports for the process? Also, if you've tried kill -9 and that also fails, add that to your question too. The more detail you give, the more likely it is that we'll be able to answer. Commented Jun 27, 2017 at 13:38

1 Answer 1

5

kill -KILL $PID or kill -9 $PID will forcibly terminate $PID, unless you don't have the permissions to do so (i.e., it belongs to a different user and you're not root), but be very careful with it. Inflicting it on a process will prevent it from doing any kind of filesystem (or other) cleanup.

2
  • 2
    It's worth remembering that kill -9 might not always stop the process in the time frame you would like - unix.stackexchange.com/questions/5642/… Commented Jun 27, 2017 at 8:08
  • Yep, tried that. Commented Jun 27, 2017 at 8:12

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.