supervisord launches with wrong setuid

Posted by friendzis on Server Fault See other posts from Server Fault or by friendzis
Published on 2013-10-21T14:45:37Z Indexed on 2013/10/21 15:55 UTC
Read the original article Hit count: 470

Filed under:
|

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.

© Server Fault or respective owner

Related posts about uwsgi

Related posts about supervisord