Warn in the case of bad systemd configuration

This commit is contained in:
Ken Okada 2020-08-20 09:00:03 +09:00
parent 5001de6070
commit d81c6cefcb

View File

@ -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