3

So I was trying to get uWSGI and nginx working together and wanted to set the following command line to automatically execute and start my uWSGI background service:

uwsgi --master --processes 4 --die-on-term --uid uwsgi --gid nginx --socket /tmp/uwsgi.sock --chmod-socket --stats :1717 --no-site --vhost --logto /var/log/uwsgi.log

When using systemd I thought the only thing I'd need to do was using ExecStart= and starting that command. But since systemd needs absolute paths I take a look in the default uWSGI start script and saw that /usr/bin/uwsgi or usr/sbin/uwsgi would be the default start path.

So the final exec command for me looks something like this:

ExecStart=/usr/bin/uwsgi --master --processes 4 --die-on-term --uid uwsgi --gid nginx --socket /tmp/uwsgi.sock --chmod-socket --stats :1717 --no-site --vhost --logto /var/log/uwsgi.log

The Problem: When running this it's unable to find the option --no-site for running everything in a virtualenv. When starting this with uwsgi in the command line it's not a problem. But even when starting /usr/bin/uwsgi directly from the command line I get this error.

So to me it looks like the uwsgicommand isn't just running /usr/bin/uwsgi directly. But I'm not sure what I need to do to get this working.

I'd really appreciate any help I can get.

UndeadLeech
  • 133
  • 5
  • 17

2 Answers2

3

So I used whereis uwsgi to look through every folder that has a uwsgi instance in it again and found out that the default uwsgi application seems to be in /usr/local/uwsgi.

UndeadLeech
  • 133
  • 5
  • 17
1

Have you tried putting your uwsgi config in a separate file?

ExecStart=/usr/bin/uwsgi --ini /path/to/your/app/uwsgi.ini

You can read more on uwsgi ini configs here