Merge pull request #2405 from kenoss/feature/warn-if-sdnotify-and-daemon

Warn in the case of bad systemd configuration
This commit is contained in:
Benoit Chesneau 2023-05-07 16:14:34 +02:00 committed by GitHub
commit 96ab8ba05a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -218,6 +218,11 @@ 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