uwsgi-docs icon indicating copy to clipboard operation
uwsgi-docs copied to clipboard

documentation: systemd socket activation

Open rumpeltux opened this issue 4 years ago • 0 comments

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 use
    

    It’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.socket line 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=True in the wsgi.ini file.

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.

rumpeltux avatar Jan 16 '21 15:01 rumpeltux