Skip to content

--reload option not working #1562

Closed
Closed
@ahmedsaoudi

Description

@ahmedsaoudi

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
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions