Fix eventlet patching by performing the patching before the
`init_process` method, which does not return, is called.
This fix depends on bumping the required version to 0.24.1, which
contains a fix for the monotonic clock. See the relevant commit:
eventlet/eventlet@82f1877
This commit reverts 120f503f68929ef98d721a406745a1dbbb9d83fe
Fix#1847Fix#1884
This commit reverts one aspect changed by 5f4ebd2eb2b08783a5fbefe79d09fcb3fc1fbc73 (#1151);
header-values are again encoded as latin-1 and not ascii. Test is restored but uses
a latin-1-mappable test-character, not a general utf8 character.
Fixed#1778.
Signed-off-by: Brett Randall <javabrett@gmail.com>
Commits e974f305 and 78208c8c removed support for Python 2 and Python
<3.4 respectively so the conditional logic for importing
`concurrent.futures` is no longer necessary as it has been part of the
standard library since Python 3.2.
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)