I’m running a Django app using Gunicorn and Django. It was running, but when I rebooted the instance, Django and Gunicorn does not auto start. I made adjustments (like below), now both are not running eventhough I have restarted the services.
- gunicorn.service
[Unit]
Description=My Django Application with Gunicorn
Requires=gunicorn.socket
After=network.target
[Service]
User=<user>
Group=<user>
WorkingDirectory=/opt/apps/django/myproject/<prjctname>
ExecStart=/usr/bin/gunicorn <prjctname>.wsgi
Restart=always
[Install]
WantedBy=multi-user.target
- gunicorn.socket
[Unit]
Description= Gunicorn socket
[Socket]
ListenStream=/run/gunicorn.sock
SocketUser=<scktuser>
[Install]
WantedBy=sockets.target
- nginx.conf
http {
server {
listen 80;
listen [::]:80;
server_name _;
root /usr/share/nginx/html;
}
After enabling and starting the services, I checked the status and here are the results
- gunicorn.service
Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; preset: disabled)
Active: failed (Result: exit-code)
TriggeredBy: × gunicorn.socket
gunicorn.service: Start request repeated too quickly.
gunicorn.service: Failed with result 'exit-code'.
Failed to start gunicorn.service - My Django Application with Gunicorn.
- gunicorn.socket
gunicorn.socket: Failed with result 'service-start-limit-hit'
New contributor
kayi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.