14

I've just installed uwsgi by pip install uwsgi in a virtual env. In "ini" file I used:

socket = 127.0.0.1:3000
# no pidfile option

And run uwsgi --ini config.ini

But how to stop this instance of uwsgi?
uwsgi --stop ... wants a pid file. I can't use an address:

open("127.0.0.1:3000"): No such file or directory [core/io.c line 505]

And if killing - uwsgi just respawns itself.

Sergey
  • 714
  • 2
  • 6
  • 21

3 Answers3

18
ps ax | grep uwsgi
15005 pts/4    S      0:00 /ve/path/bin/uwsgi --ini config.ini
15006 pts/4    S      0:00 /ve/path/bin/uwsgi --ini config.ini
15007 pts/4    S      0:00 /ve/path/bin/uwsgi --ini config.ini

killall -s INT /ve/path/bin/uwsgi
Sergey
  • 714
  • 2
  • 6
  • 21
4

It is a known feature that you cannot terminate uwsgi with just kill. The second bullet of: http://uwsgi-docs.readthedocs.org/en/latest/ThingsToKnow.html

Til uWSGI 2.1, by default, sending the SIGTERM signal to uWSGI means “brutally reload the stack” while the convention is to shut an application down on SIGTERM. To shutdown uWSGI use SIGINT or SIGQUIT instead. If you absolutely can not live with uWSGI being so disrespectful towards SIGTERM, by all means enable the die-on-term option. Fortunately, this bad choice has been fixed in uWSGI 2.1

2

Similar to the top one answer, in Ubuntu or Debian you can simply dosudo killall -9 uwsgi. Though I do want to know if uwsgi gives a way to stop itself.

waldronluo
  • 21
  • 1