Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make uwsgi shut down if application failed to load?

I run my uwsgi in the simplest way possible, as a process managed by upstart, no emperor mode or anything. This is what I get if application fails on startup for some reason:

[traceback skipped]
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 17923)
spawned uWSGI worker 1 (pid: 17948, cores: 1)
...

I have no use for this mode, and would like it to shut down completely, so my upstart job shows as stopped.

How can I do this?

like image 748
letitbee Avatar asked Feb 17 '14 10:02

letitbee


People also ask

How to stop uWSGI process?

If you have the uWSGI process running in the foreground for some reason, you can just hit CTRL+C to kill it off.

What is lazy apps in uWSGI?

Remember: lazy-apps is different from lazy, the first one only instructs uWSGI to load the application one time per worker, while the second is more invasive (and generally discouraged) as it changes a lot of internal defaults.

What is uWSGI used for?

uWSGI is an open source software application that "aims at developing a full stack for building hosting services". It is named after the Web Server Gateway Interface (WSGI), which was the first plugin supported by the project.


1 Answers

The option

--need-app

will do the trick

like image 64
roberto Avatar answered Oct 20 '22 01:10

roberto