Based on the docs you can spin up a "new" gunicorn with kill -USR2
Then you can send a kill -WINCH
to the old master process to kill off it's workers.
But if Systemd launches gunicorn (like this)
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/app/next/bin/gunicorn --pid /var/run/next/gunicorn.pid --chdir /app/next/dubclub --workers 5 --bind unix:/var/run/next/next.socket myapp.wsgi:application
ExecStop=/bin/kill -TERM $MAINPID
all that happens on WINCH is [INFO] Handling signal: winch
Docs also say you have to use --daemon
on the command line to daemonize it. BUT if you do that with systemd, gunicorn exits right after starting.
Is there a way to use --daemon
with systemd and still leave the process running?