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