From d81c6cefcb1b0a359c56675906b39ba641aaf016 Mon Sep 17 00:00:00 2001 From: Ken Okada Date: Thu, 20 Aug 2020 09:00:03 +0900 Subject: [PATCH 1/2] Warn in the case of bad systemd configuration --- gunicorn/app/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gunicorn/app/base.py b/gunicorn/app/base.py index df8c666f..c74ea3e8 100644 --- a/gunicorn/app/base.py +++ b/gunicorn/app/base.py @@ -218,6 +218,10 @@ class Application(BaseApplication): debug.spew() if self.cfg.daemon: + if os.environ.get('NOTIFY_SOCKET'): + msg = "Warning: you shouldn't specify `daemon = True` when launching by systemd with `Type = notify`" + print(msg, file=sys.stderr, flush=True) + util.daemonize(self.cfg.enable_stdio_inheritance) # set python paths From f2d8b6d100bc9d1041f8db42b7ba5481ea9cf58a Mon Sep 17 00:00:00 2001 From: Ken Okada Date: Mon, 24 Aug 2020 21:15:31 +0900 Subject: [PATCH 2/2] Split long line --- gunicorn/app/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gunicorn/app/base.py b/gunicorn/app/base.py index c74ea3e8..dbd05bc7 100644 --- a/gunicorn/app/base.py +++ b/gunicorn/app/base.py @@ -219,7 +219,8 @@ class Application(BaseApplication): if self.cfg.daemon: if os.environ.get('NOTIFY_SOCKET'): - msg = "Warning: you shouldn't specify `daemon = True` when launching by systemd with `Type = notify`" + msg = "Warning: you shouldn't specify `daemon = True`" \ + " when launching by systemd with `Type = notify`" print(msg, file=sys.stderr, flush=True) util.daemonize(self.cfg.enable_stdio_inheritance)