Does anyone know what I shoudl put for: User, WorkingDirectory, and ExecStart? I followed the guide brainlessly and it doesn’t seem to work. Does my project need to be in the env folder?
Currently my app is in: /root/myonlinefp/myonlinefp
My env folder is in: /root/myonlinefp/env
Jul 31 08:00:35 ubuntu-s-1vcpu-1gb-nyc1-01 systemd[1]: Started gunicorn.service.
Jul 31 08:00:35 ubuntu-s-1vcpu-1gb-nyc1-01 systemd[17341]: gunicorn.service: Failed to determine user credentials: No such process
Jul 31 08:00:35 ubuntu-s-1vcpu-1gb-nyc1-01 systemd[17341]: gunicorn.service: Failed at step USER spawning /usr/bin/gunicorn: No such process
Jul 31 08:00:35 ubuntu-s-1vcpu-1gb-nyc1-01 systemd[1]: gunicorn.service: Main process exited, code=exited, status=217/USER
Jul 31 08:00:35 ubuntu-s-1vcpu-1gb-nyc1-01 systemd[1]: gunicorn.service: Failed with result ‘exit-code’.
Jul 31 08:00:35 ubuntu-s-1vcpu-1gb-nyc1-01 systemd[1]: gunicorn.service: Start request repeated too quickly.
Jul 31 08:00:35 ubuntu-s-1vcpu-1gb-nyc1-01 systemd[1]: gunicorn.service: Failed with result ‘exit-code’.
Jul 31 08:00:35 ubuntu-s-1vcpu-1gb-nyc1-01 systemd[1]: Failed to start gunicorn.service.
Aug 02 05:04:13 ubuntu-s-1vcpu-1gb-nyc1-01 systemd[1]: /etc/systemd/system/gunicorn.service:14: Missing ‘=’, ignoring line.
~
Ok, I don’t use gunicorn, so I’m far from being an expert here - but from what I’m reading, it appears you’re conflating two different methodologies here.
It appears to me that the socket listener entry is designed to start a new instance of a process any time a message is sent through the socket, but your gunicorn definition is designed to run persistently.
The example I see in those docs where it shows the use of the listener does not include the worker parameter on the gunicorn command.
Again, there’s a lot of conjecture here - I haven’t taken any time to play with this myself. If I were doing this, the first thing I’d do is try it exactly as it is documented and not add any parameters that aren’t in the example.
Also, I believe you need a backslash at the end of each line as a continuation character. I think you need to add a backslash to all but the last line of your ExecStart parameter.
i found a youtube video and followed it… took over 6 hours to find out what the issue was…
Apparently, I had to create a username on ubtun and that is the User that I was going to use. I wasn’t suppose to use root.
workingdirectory is the folder where you can find the wsgi file and exec start is where you can find the gunicorn file. For people who have the same issue as me, make sure you install all your modules inside your env as well.
The main problem with this tutorial is that after step:
mkdir ~/myprojectdir
cd ~/myprojectdir
we should also do:
sudo chown username path-with-myprojectdir.
Also, all commands outside of the environment are preceded by ‘sudo’.