Update the Eventlet and Gevent worker classes to check for versions of
Eventlet and Gevent that are stable under Python 3 and remove outdated
compatibility code.
Remove the `gunicorn_paster` command. With the `--paste` option to the
`gunicorn` command, Gunicorn will no longer read the server section of
the configuration. Instead, server configuration must be done with
Gunicorn configuration files, command line switches, and environment
variables.
The use of Gunicorn as a Paste Deployment server factory is no longer
deprecated. It allows specifying `host` and `port`, as well as `bind`,
but is otherwise more strict with options than in the past. Rather than
ignoring unknown options it will raise an error.
Close#1189
There's no need for PIDFile=, especially not for Type=notify services.
systemd knows the correct pid of the process it manages.
No need for the `--bind` option either, since gunicorn supports the
LISTEN_FDS environment variable and will use all of the sockets that systemd
provides. This way, it's also more flexible, since we can specify several
sockets in a .socket unit.
The .socket unit should specify User=www-data so that nginx can connect to the socket.
The service (gunicorn process) will inherit the file descriptor so it
doesn't even need permissions for the socket (it's nginx which needs
permissions).
tmpfiles.d is not needed.
replace ExecStop=/bin/kill with KillMode=mixed
* add systemd sd_notify support
roughly based on sd_notify() from systemd and https://github.com/bb4242/sdnotify
only implements `READY=1` and `STATUS=Gunicorn arbiter booted` of the
protocol in the arbiter. in the future, reloads can be notified, and
possibly also other statuses.
see https://www.freedesktop.org/software/systemd/man/sd_notify.html for
more info
sd_notify() is a noop when not run in a systemd service (i.e
NOTIFY_SOCKET environment variable is not set)
The doc change introduced in #1037 is initially helpful but then internally
inconsistent. It correctly points out that X-Forwarded-For is no longer
used in setting REMOTE_ADDR (c4873681299212d6082cd9902740eef18c2f14f1),
but then confusingly indicates a solution using the X-Forwarded-For header.
The deployment doc provides a full configuration example which includes
proxy headers as set by nginx. What is missing, before this patch, is a
clear suggestion on how to make use of the header in Gunicorn's access
log.
Accordingly, remove the confusing suggestion and replace it with a drop-in
replacement for Gunicorn's default access log format.
- run lint using latest Python 3.7
- updated env list in tox.ini
- added py38-dev
- removed py36-dev
- moved aiohttp to requirements_test.txt
Signed-off-by: Brett Randall <javabrett@gmail.com>
The systemd files recommended in the docs do not work. The socket file disappears after the first request, or after the service is restarted.
This commit updates the systemd files to include the correct settings
If you have two (or more) instances of gunicorn that use `reuse-port`
and bind to single unix socket all work until one of gunicorn will
stopped. Because the first stopped removes unix socket file and other
instances can't longer process requests.
If you have two (or more) instances of gunicorn that use `reuse-port` and bind to single unix socket all work until one of gunicorn will stopped. Because the first stopped removes unix socket file and other instances can't longer process requests.
Some systems report UNIX socket addresses as bytes while others will
report it as a unicode string type. This patch improves socket type
detection code to support both.
Fix#1861
0f527a01f4 added a fix for the case when some modules have the `__file__` attr set to `None`, for the polling reloader. Unfortunately, it missed making the same fix for the inotify reloader.
This change copies that fix into InotifyReloader