Reputation:
I am trying out gunicorn, and I installed it inside a virtualenv with a django site. I got gunicorn running with this command:
gunicorn_django -b 127.0.0.1:9000
Which is all well and good. I haven't setup a bash script or hooked it to upstart (I am on Ubuntu) yet, because I am testing it out.
Meantime, my connection to the server was broken, and thus I lost the console, and I can no longer do CTRL + C to stop the server after reconnecting.
How do I stop gunicorn_django, when it is already running?
Upvotes: 16
Views: 17482
Reputation: 2163
A faster way:
> kill -9 `ps aux | grep gunicorn | awk '{print $2}'`
updated code
Upvotes: 15
Reputation: 11582
Just found this also - pkill
- which will kill all processes matching the search text:
$ pkill gunicorn
No idea how well supported it is, but can confirm that it works on Ubuntu 12.04
(from http://www.howtogeek.com/howto/linux/kill-linux-processes-easier-with-pkill/)
Upvotes: 20
Reputation: 599778
The general solution to problems like this is to do ps ax|grep gunicorn
to look for the relevant process, then do kill xxxx
where xxxx is the number in the first column.
Upvotes: 26