I am building my app using official php docker image.
Case 1: When I run supervisord with root user and subprocess php-fpm with www-data user. I always get this error log:
FPM initialization failed
failed to open error_log (/proc/self/fd/2): Permission denied (13)
My supervisor config:
[unix_http_server]
file=/run/supervisord.sock ; the path to the socket file
[supervisord]
logfile=/var/log/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; supervisord pidfile; default supervisord.pid
nodaemon=true ; start in foreground if true; default false
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///run/supervisord.sock ; use a unix:// URL for a unix socket
[include]
files = /etc/supervisor.d/*.conf
My subprocess php-fpm config:
[program:php-fpm]
process_name=%(program_name)s
command=php-fpm
user=www-data
autostart=true
autorestart=true
redirect_stderr=false
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
Note that if I change user of subprocess php-fpm from www-data to root, it worked perfectly
Case 2: When I run supervisord with www-data user (with a little change in config file in order to run it) and subprocess php-fpm also with www-data user, everything works fine.
My supervisor config:
[unix_http_server]
file=/app/supervisord.sock ; the path to the socket file
[supervisord]
logfile=/app/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/app/supervisord.pid ; supervisord pidfile; default supervisord.pid
nodaemon=true ; start in foreground if true; default false
user=www-data ; setuid to this UNIX account at startup; recommended if root
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///run/supervisord.sock ; use a unix:// URL for a unix socket
[include]
files = /etc/supervisor.d/*.conf
My subprocess php-fpm config:
[program:php-fpm]
process_name=%(program_name)s
command=php-fpm
user=www-data
autostart=true
autorestart=true
redirect_stderr=false
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
What is the difference between these 2 cases? Thank you!
replicas) since forever. Why force this supervisor stuff into your container workload when your container system is basically a replacement for supervisor and the like?