Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am trying to test a pilot system with nginx connecting to uwsgi served application controlled by supervisord running on ubuntu-server. Application is written in python with Flask in virtualenv, although I'm not sure if that is relevant. To test the system I have created a simple hello world with flask. I want nginx and uwsgi both to run as www-data user.
If I launch uwsgi "manually" from root shell I can see uwsgi processes runing as appropriate user (www-data). Although, if I let supervisor launch the application something strange happens - uwsgi processes are runing under my user (friendzis). Consequently, socket file gets created under wrong user and nginx cannot communicate with my applicaion.
note: the linux server runs as Hyper-V VM, under Windows Server 2008.

Relevant configuration:

[uwsgi]

socket = /var/www/sockets/cowsay.sock
chmod-socket = 666
abstract-socket = false

master = true
workers = 2

uid = www-data
gid = www-data

chdir = /var/www/cowsay/cowsay
pp = /var/www/cowsay/cowsay
pyhome = /var/www/cowsay
module = cowsay
callable = app

supervisor

[program:cowsay]
command = /var/www/cowsay/bin/uwsgi -s /var/www/sockets/cowsay.sock -w cowsay:app
directory = /var/www/cowsay/cowsay
user = www-data
autostart = true
autorestart = true
stdout_logfile = /var/www/cowsay/log/supervisor.log
redirect_stderr = true
stopsignal = QUIT

I'm sure I'm missing some minor detail, but I'm unable to notice it. Would appreciate any suggestions.

share|improve this question

1 Answer 1

How do your run supervisord ? are you sure you did not run it from the shell (with your uid) ?

Are you sure you need supervisord ? You can easily attach uWSGI to upstart or systemd (eventually with the uWSGI Emperor)

share|improve this answer
    
I'm runing supervisord as a System V service (installed with apt-and-friends). Supervisord itself runs as root (output from ps confirms that). I've tried rebooting the VM, and logging in directly to a root shell only to witness the same result. I just can't figure out where that UID 1000 comes from. I'm not sure if I REALLY need supervisor, but it seems to be a nice tool to control related non-WSGI apps –  friendzis Oct 21 '13 at 16:02

Your Answer

 
discard

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.