Closed
Description
Upon using Gunicorn for my Django app, I tried to enable the --reload
option to make my work easier, avoiding manual restarting for every change.
Even though I tried the option on the command line (gunicron --reload --bind ...
), I normally run Gunicorn as a systemd service. Here the config file:
[Unit]
Description='gunicorn daemon'
After=network.target
[Service]
User=me
Group=www-data
WorkingDirectory=path/to/djangoapp
ExecStart=/path/to/Envs/venv/bin/gunicorn --access-logfile - --error-logfile /path/to/gunicorn-error.log --workers 3 --reload --bind unix:/path/to/djangoapp/appname.sock appname.wsgi:application
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
[Install]
WantedBy=multi-user.target
As you can see, I'm using Gunicorn from a Virtualenv, as the rest of the app; but I don't know if that's related.
And apparently, I'm not alone; somebody else has the same issue: https://unix.stackexchange.com/questions/375292/how-to-restart-systemd-service-after-files-update-under-gunicorn-server
Metadata
Metadata
Assignees
Labels
No labels