UWSGI service fails

I have a problem that drives me crazy. I am trying to create a Ubuntu 15.04 Upstart job that will launch a uWSGI server (uWSGI version 2.0.7-debian) that starts a Django application.

I configured the service as follows and try to start the task by issuing the command $ sudo service uwsgi start . There is no way out in the log files, a socket file is not created and there is no error.

 # file: /etc/init/uwsgi.conf description "uWSGI server" start on runlevel [2345] stop on runlevel [!2345] exec /usr/bin/uwsgi --ini /srv/configs/uwsgi.ini 

service uwsgi status says

 ● uwsgi.service - LSB: Start/stop uWSGI server instance(s) Loaded: loaded (/etc/init.d/uwsgi) Active: active (exited) since Tue 2015-05-05 09:40:08 EEST; 1s ago Docs: man:systemd-sysv-generator(8) Process: 21405 ExecStop=/etc/init.d/uwsgi stop (code=exited, status=0/SUCCESS) Process: 21460 ExecStart=/etc/init.d/uwsgi start (code=exited, status=0/SUCCESS) May 05 09:40:08 web-2 systemd[1]: Starting LSB: Start/stop uWSGI server instance(s)... May 05 09:40:08 web-2 uwsgi[21460]: * Starting app server(s) uwsgi May 05 09:40:08 web-2 uwsgi[21460]: ...done. May 05 09:40:08 web-2 systemd[1]: Started LSB: Start/stop uWSGI server instance(s). 

UWSGI app configured as

 [uwsgi] uid = www-data gid = www-data socket = /srv/sockets/uwsgi.sock chmod-socket = 666 master = true processes = 4 enable-threads = true plugins = python chdir = /srv/sites/current module = wsgi:application virtualenv = /srv/environments/current logto = /srv/logs/uwsgi.log logfile-chown = true touch-reload = /srv/sites/current/wsgi.py 

The service starts normally, and everything works fine if the service starts directly, for example. by issuing the command: sudo -u www-data /usr/bin/uwsgi --ini /srv/configs/uwsgi.ini

For directories of dir directory files and logs, I set the most relaxed permissions.

So, I am at a loss. What to do next?

+5
source share
2 answers

Thanks to nmgeeks comment, I started looking at other places where uWSGI is configured.

While trying to move all our own application bundled in /srv , I deleted the /run/uwsgi directory where uWSGI is trying to create a PID file.

You can find the link in /usr/share/uwsgi/conf/default.ini .

Too bad uWSGI does not cause errors in this situation, which left me disappointed throughout the day.

+6
source

I just want to add some additional information. In my case, I did not delete anything, but for some reason systemd unable to create the /run/uwsgi directory. So, I did echo "/run/uwsgi 0755 www-data www-data -" > /etc/tmpfiles.d/uwsgi.conf . After that, I restarted my virtual machine (I did not find a way to apply these changes without restarting), and uwsgi started working!

Yes, it is too bad that uWSGI does not create errors in this situation.

0
source

All Articles