I am using Django 1.8 and I want to run the application using gunicorn.
I can run it OK from the command line binding to my IP:
gunicorn myapp.wsgi:application --bind xx.xx.xx.xx:8001
But now I want to run it through a Unix socket:
gunicorn myapp.wsgi:application --bind=unix$/webapps/myapp/run/gunicorn.sock
I get this error:
[2015-08-23 07:38:04 +0000] [18598] [INFO] Starting gunicorn 19.3.0 [2015-08-23 07:38:04 +0000] [18598] [ERROR] Retrying in 1 second. [2015-08-23 07:38:05 +0000] [18598] [ERROR] Retrying in 1 second. [2015-08-23 07:38:06 +0000] [18598] [ERROR] Retrying in 1 second. [2015-08-23 07:38:07 +0000] [18598] [ERROR] Retrying in 1 second. [2015-08-23 07:38:08 +0000] [18598] [ERROR] Retrying in 1 second. [2015-08-23 07:38:09 +0000] [18598] [ERROR] Can't connect to $/webapps/myapp/run/gunicorn.sock
If I do ls -al /webapps/myapp/run , I see that the socket file exists, although it is empty:
srwxrwxrwx 1 opuser webapps 0 Aug 23 07:22 /webapps/myapp/run/gunicorn.sock
How can i fix this?
Ultimately, I want to run gunicorn as an opuser user, I tried adding --user opuser --group webapps to the gunicorn command, but still getting the same error.
django sockets gunicorn
Richard
source share