. ${BUILDFILE%/*}/common.sh pkgver=20161106.2 package() { preamble # Wherever possible, we should use uWSGI for process management of our # HTTP services. This allows for much more consistent management and # configuration than the hodge-podge of PHP-FPM, manage.py, fcgiwrap, # et c. that we used to have on Proton. depends+=(uwsgi) # uWSGI is the program, uwsgi is the protocol it speaks with nginx. A # pool of workers is called a vassal, and is configured in # `/etc/uwsgi/${vassal}.ini`, and activated by # `uwsgi@${vassal}.socket`; a socket speaking the uwsgi protocol is # created at `/var/run/uwsgi/${vassal}.sock`. # We use systemd socket activation rather than a uWSGI emperor because # they provide largely the same functionality; the only real advantage # that a uWSGI emperor would provide over systemd socket activation is # if you ran it in tyrant mode, it lets you do some cool things with # unpriveleged access, which would be useful for a shared web host. # We aren't a shared web host, and have no reason to run emperor in # tyrant mode. # Since the `uwsgi@.service` vassal unit is written to support # socket-activated or non-socket-activated use, it is normally # possible to accidentally start it without the associated `.socket` # unit; which is an error with how our vassal configurations are # written. To fix this, `uwsgi@.service.d/socket.conf` overrides the # unit a bit to disable non-socket-activated use. add-file etc/systemd/system/uwsgi@.service.d/socket.conf <