Chris McDonough wrote:
> What you described in your previous email should have worked.  I'm not 
> sure if this is a bug, or what.

Tried again with a fresh install, new server:

# cat /etc/supervisord.conf
[unix_http_server]
file=/tmp/supervisor.sock   ; (the path to the socket file)
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; (main log file;default 
$CWD/supervisord.log)
logfile_maxbytes=50MB       ; (max main logfile bytes b4 
rotation;default 50MB)
logfile_backups=10          ; (num of main logfile rotation 
backups;default 10)
loglevel=info               ; (log level;default info; others: 
debug,warn,trace)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default 
supervisord.pid)
nodaemon=false              ; (start in foreground if true;default false)
minfds=1024                 ; (min. avail startup file 
descriptors;default 1024)
minprocs=200                ; (min. avail process descriptors;default 200)
user=root                   ; (default is current user, required if root)
[fcgi-program:php]
user=nginx
command=/usr/bin/php-cgi
socket=unix:///tmp/php.sock

# ls -alh /tmp/|grep php.so
srwxr-xr-x  1 root  root     0 Oct 19 15:26 php.sock

However, the user which is running the PHP executable *is* nginx:
# ps aux|grep php
nginx    14005  0.0  0.2 142212  4748 ?        S    15:26   0:00 
/usr/bin/php-cgi

I've tried using the `chown` parameter (as defined in the 
unix_http_server section of the config file) in hopes that it would work 
in a similar way, but no joy.

I need supervisord to run as root, but nginx/php daemons & sockets to 
run as/be owned by nginx. For the moment I'll try running it on a port.

Also noticed that stopping PHP via supervisorctl doesn't remove the 
php.sock file.

Running under CentOS5.2 + Python2.6

>
> Phillip Oldham wrote:
>> Chris McDonough wrote:
>>> There is a separate "user" parameter that is set in the 
>>> [supervisord] section
>>> that may help you work around the issue.  The entire supervisord 
>>> process (and
>>> any children, and any socket files) will be run/written using that 
>>> userid.
>>>
>>> [supervisord]
>>> user = nginx
>>>
>>> Please read 
>>> http://supervisord.org/manual/current/configuration.html#supervisord
>>>   
>> Thanks. I'll see if I can get that to work.
>>
>> However, is there a way to have supervisord run as root, yet have the 
>> socket created by another user? eg:
>>
>> [supervisord]
>> user = root
>> ...
>> [fcgi-program:php]
>> user = nginx
>> socket = unix:///tmp/php.sock
>> ...
_______________________________________________
Supervisor-users mailing list
[email protected]
http://lists.supervisord.org/mailman/listinfo/supervisor-users

Reply via email to