uwsgi-docs
uwsgi-docs copied to clipboard
documentation: systemd socket activation
The official instructions seem to be missing some details or are partially wrong. Here’s what I figured:
-
systemd needs to control the socket, so if uwsgi complains about things like:
error removing unix socket, unlink(): Permission denied bind(): Address already in useIt’s trying to create the socket on start but can’t and also cannot reuse it.
IIRC: this can be fixed by removing the
--socket /var/run/uwsgi/%i.socketline from[email protected]. The socket seems to be passed elsewhere, so this continues to work. -
uwsgi must not try to unlink the socket once it’s done. I was able to achieve this by setting
vacuum=Truein thewsgi.inifile.
Now it’s working for me. systemd spawns the uwsgi service on socket access and the socket is being kept when the uwsgi process dies on idle.