Failed to start gunicorn daemon ubuntu 1

Failed to start gunicorn daemon ubuntu

sudo systemctl enable gunicorn.service
sudo systemctl start gunicorn.socket
sudo systemctl status gunicorn.service

Here is what the above code is Doing:
1. Create a new file in /etc/systemd/system/ called gunicorn.service.
2. Add the following lines to the file:
[Unit]
Description=Gunicorn instance to serve myproject
After=network.target

[Service]
User=sammy
Group=www-data
WorkingDirectory=/home/sammy/myproject
ExecStart=/home/sammy/myproject/myprojectenv/bin/gunicorn –workers 3 –bind unix:/home/sammy/myproject/myproject.sock myproject.wsgi:application

[Install]
WantedBy=multi-user.target
3. Save and close the file.
4. Start the Gunicorn service we just defined and enable it so that it starts at boot:
sudo systemctl start gunicorn
sudo systemctl enable gunicorn
5. Check the status of the service:
sudo systemctl status gunicorn
6. If you need to stop, start, or restart the processes the service is managing, you can do so with the following commands:
sudo systemctl stop gunicorn
sudo systemctl start gunicorn
sudo systemctl restart gunicorn
7. If you want to find out what commands are available for a service, you can use the status command with the –help flag:
sudo systemctl status gunicorn –help

Similar Posts