Skip to content

Commit

Permalink
Merge pull request #2405 from kenoss/feature/warn-if-sdnotify-and-daemon
Browse files Browse the repository at this point in the history
Warn in the case of bad systemd configuration
  • Loading branch information
benoitc committed May 7, 2023
2 parents b1d6418 + f2d8b6d commit 96ab8ba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gunicorn/app/base.py
Expand Up @@ -218,6 +218,11 @@ def run(self):
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
Expand Down

0 comments on commit 96ab8ba

Please sign in to comment.