did as it was in the tutorial on DigitalOcean https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-18-04#step -4-% E2% 80% 94-configuring-gunicorn

created a file with the extension .service and shoved it there

[Unit] Description=Gunicorn instance to serve myproject After=network.target [Service] User=user Group=www-data WorkingDirectory=/home/user/myproject Environment="PATH=/home/user/myproject/myprojectenv/bin" ExecStart=/home/user/myproject/myprojectenv/bin/gunicorn --workers 3 --bind unix:myproject.sock -m 007 wsgi:app 

introduced sudo sysytemctl daemon-reload, systemctl start myproject, systemctl enable myproject

after that I registered the status and got such an error

 Jan 10 16:35:44 ubuntu-s-2vcpu-4gb-fra1-01 systemd[1]: Started Gunicorn instance to serve myproject. Jan 10 16:35:44 ubuntu-s-2vcpu-4gb-fra1-01 systemd[11584]: myproject.service: Failed to execute command: No such file or directory Jan 10 16:35:44 ubuntu-s-2vcpu-4gb-fra1-01 systemd[11584]: myproject.service: Failed at step EXEC spawning /home/user/myproject/.virtualenvs/myp Jan 10 16:35:44 ubuntu-s-2vcpu-4gb-fra1-01 systemd[1]: myproject.service: Main process exited, code=exited, status=203/EXEC Jan 10 16:35:44 ubuntu-s-2vcpu-4gb-fra1-01 systemd[1]: myproject.service: Failed with result 'exit-code'. 

upd: service earned, but the application does not work, what could be the problem?

    1 answer 1

    Try better

     EnvironmentFile=/home/user/myproject/myprojectenv/bin/activate