I am using nginx with Supervisor. My supervisord.conf file content is as follows:
[supervisord]
nodaemon=true
logfile=/var/log/supervisor/supervisord.log
[program:nginx]
command=/usr/sbin/nginx -c /etc/nginx/nginx.conf
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
redirect_stderr=true
[supervisorctl]
serverurl=unix:///tmp/supervisor.sock
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
I started supervisord after ensuring that netstat -nltp says all ports are free but please find the nginx error log below:
2014/09/10 20:39:00 [emerg] 277#0: bind() to 0.0.0.0:81 failed (98: Address already in use)
2014/09/10 20:39:00 [emerg] 277#0: bind() to 0.0.0.0:18081 failed (98: Address already in use)
2014/09/10 20:39:00 [emerg] 277#0: bind() to 0.0.0.0:18082 failed (98: Address already in use)
2014/09/10 20:39:00 [emerg] 277#0: bind() to 0.0.0.0:18083 failed (98: Address already in use)
2014/09/10 20:39:00 [emerg] 277#0: bind() to 0.0.0.0:10080 failed (98: Address already in use)
2014/09/10 20:39:00 [emerg] 277#0: bind() to 0.0.0.0:8080 failed (98: Address already in use)
2014/09/10 20:39:00 [emerg] 277#0: bind() to 0.0.0.0:28080 failed (98: Address already in use)
2014/09/10 20:39:00 [emerg] 277#0: bind() to 0.0.0.0:18080 failed (98: Address already in use)
2014/09/10 20:39:00 [emerg] 277#0: bind() to 0.0.0.0:20081 failed (98: Address already in use)
2014/09/10 20:39:00 [emerg] 277#0: bind() to 0.0.0.0:81 failed (98: Address already in use)
But netstat -nltp command gives me the following:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:28080 0.0.0.0:* LISTEN 246/nginx: master p
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 246/nginx: master p
tcp 0 0 0.0.0.0:81 0.0.0.0:* LISTEN 246/nginx: master p
tcp 0 0 0.0.0.0:20081 0.0.0.0:* LISTEN 246/nginx: master p
tcp 0 0 0.0.0.0:18080 0.0.0.0:* LISTEN 246/nginx: master p
tcp 0 0 0.0.0.0:10080 0.0.0.0:* LISTEN 246/nginx: master p
tcp 0 0 0.0.0.0:18081 0.0.0.0:* LISTEN 246/nginx: master p
tcp 0 0 0.0.0.0:18082 0.0.0.0:* LISTEN 246/nginx: master p
tcp 0 0 0.0.0.0:18083 0.0.0.0:* LISTEN 246/nginx: master p
Which means nginx is up and running. But is the supervisord trying to launch multiple nginx processes or it is not getting signal from nginx that it has been started. Can anyone shed some light on this ?