Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to run uwsgi server as www user, but if I write:

uwsgi --socket $SOCKET --chmod-socket 666 --pidfile $PIDFILE --daemonize $LOGFILE --chdir $CHDIR --pp $PYTHONPATH --module main --post-buffering 8192 --workers 1 --threads 10 --uid www --gid www

A socket creation error occurs:


  1 *** Starting uWSGI 1.4.1 (64bit) on [Mon Dec 10 22:15:23 2012] ***
  2 compiled with version: 4.4.5 on 17 November 2012 23:31:14
  3 os: Linux-2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012
  4 nodename: autoblog
  5 machine: x86_64
  6 clock source: unix
  7 pcre jit disabled
  8 detected number of CPU cores: 2
  9 current working directory: /
 10 writing pidfile to /tmp/
 11 detected binary path: /usr/local/bin/uwsgi
 12 setgid() to 1002
 13 set additional group 1004 (files)
 14 setuid() to 1002
 15 *** WARNING: you are running uWSGI without its master process manager ***
 16 your memory page size is 4096 bytes
 17 detected max file descriptor number: 1024
 18 lock engine: pthread robust mutexes
 19 unlink(): Operation not permitted [core/socket.c line 109]
 20 bind(): Address already in use [core/socket.c line 141]
share|improve this question
try posting your uWSGI configure and the log output. I would check your socket location. Something like /var/uwsgi is a good location. – Sc0rian Dec 10 '12 at 16:54
Ok, updated with log – atomAltera Dec 10 '12 at 18:18

Thanks for updating with your log.

According to your log file it says the address is already in use. The port you are trying to use is in use already.

look at netstat -ntp and make sure the port you are binding to is not already in use

share|improve this answer

the most likely scenario is that you were previously running without the uid and gid arguments, thus the socket files are already existing and owned by root. sudo rm /path/to/*.sock, restart uwsgi, and you should be all set.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.