I am trying to run nginx and uwsgi. When i try to run uwsgi with below command in my proj virtual environment with proj user i get error. When i run uwsgi, i see they proj.sock is created in /run/uwsgi/proj.sock I changed the /run/uwsgi permissions to drwxrwxrwx to see if problem is permission related. But problem continues. I also checked the /etc/passwd and there is no uwsgi user.
The directory info for /run/uwsgi is :
drwxrwxrwx 2 root root 60 Jul 16 10:53 uwsgi
When i try to change ownership of sock file with proj user to proj:nginx in proj virtual nvironment i get below error.
chown: changing ownership of ‘/run/uwsgi/proj.sock’: Operation not permitted
When i check ‘/run/uwsgi/proj.sock’ file it is proj:proj but it should be changed to proj:nginx. This operation can be done manually with root. But it cannot be done with proj user.
Run below command :
uwsgi --ini /etc/uwsgi/sites/proj.ini
Error :
[uWSGI] getting INI configuration from /etc/uwsgi/sites/proj.ini<br>
* Starting uWSGI 2.0.15 (64bit) on [Mon Jul 16 10:53:02 2018] *
compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-28) on 13 July 2018 17:12:50
os: Linux-3.10.0-862.6.3.el7.x86_64 #1 SMP Tue Jun 26 16:32:21 UTC 2018
nodename: localhost.localdomain
machine: x86_64
clock source: unix
detected number of CPU cores: 2
current working directory: /home/proj
detected binary path: /home/proj/Env/proj/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
chdir() to /home/proj/work/proj
your processes number limit is 4096
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
chown(): Operation not permitted [core/utils.c line 2623]
VACUUM WARNING: unix socket /run/uwsgi/proj.sock changed inode. Skip removal
My proj.ini file for uwsgi ini configuration is :
[uwsgi]
py-autoreload = 2
project = proj
username = proj
base = /home/%(username)
chdir = %(base)/%(project)
home = %(base)/Env/%(project)
module = %(project).wsgi:application
master = true
processes = %k
uid = %(username)
socket = /run/uwsgi/%(project).sock
chown-socket = %(username):nginx
chmod-socket = 666
vacuum = truelogto = /var/log/uwsgi/%(project).log