Search code examples
gunicorndigital-oceansystemddjango-deployment

"Start by creating and opening a systemd socket file for Gunicorn with sudo privileges" (directory to this file does not *appear* to exist)


I am working on a server running ubuntu 18.04. This digital ocean tutorial on django deployment(https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04) is telling me to do the following: "We’re now finished configuring our Django application. We can back out of our virtual environment by typing:

(env): deactivate" I am familiar with virtual environments, I did this. Now for the part I am not at all familiar with: "Start by creating and opening a systemd socket file for Gunicorn with sudo privileges:

sudo nano /etc/systemd/system/gunicorn.socket

"

First, since I just deactivated my env, I am now at justin@ubuntu-s-1vcpu-1gb-nyc3-01:~$. If I ls I only see the project folder I created which holds the virtualenv, the python project, manage.py and the static directory. Nowhere can I find this

/etc/systemd/system/

directory and the command they are telling me to use cannot create directories, only files. So I am very confused, any help would be greatly appreciated.


Solution

  • /etc doesn't live inside ~. Try ls /etc to see what's already in that directory. If you need to create that directory, you can do so wih sudo mkdir -p /etc/systemd/system/ (the -p flag is to make sure that, in case systemd is also not present under etc, it will get created).