supervisord_QA

supervisor: couldn’t setuid to 0: Can’t drop privilege as nonroot user supervisor: child process was not spawned (nginx: ERROR (spawn error))

supervisord启动报错:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
supervisor: couldn't setuid to 0: Can't drop privilege as nonroot user
supervisor: child process was not spawned
supervisor: couldn't setuid to 0: Can't drop privilege as nonroot user
supervisor: child process was not spawned
supervisor: couldn't setuid to 0: Can't drop privilege as nonroot user
supervisor: child process was not spawned
supervisor: couldn't setuid to 0: Can't drop privilege as nonroot user
supervisor: child process was not spawned
supervisor: couldn't setuid to 0: Can't drop privilege as nonroot user
supervisor: child process was not spawned


[root@VM_1_9_centos ~]# supervisorctl start nginx
nginx: ERROR (spawn error)

前半段是nginx错误日志的输出,后半段是supervisor启动nginx的错误输出

问题原因:nginx需要使用监听80端口,只能使用root用户来运行nginx,而supervisord配置文件中指定了 nginx进程和supervisord自身进程使用非root用户启动,导致报错,修改两处用户配置后,重启supervisor配置文件就可以了

1
supervisorctl reload    #重启supervisord

supervisor error:class ‘socket.error’ [Errno 2] No such file or directory: file:

  • 网上别的文章都是说启动时指定配置文件即可
    1
    /usr/bin/supervisord -c /etc/supervisord.conf
  • 按照此方法没有解决,经排查是python版本不对,默认python版本为2.6,安装的supervisor需要python2.7
    1
    /app/supervisor/Python-2.7.14/python /usr/bin/supervisord -c /etc/supervisord.conf

supervisord 配置activemq

supervisord判断进程是否存活的条件是应用前台启动
所以是用activemq的前台输出命令console即可

1
2
3
4
5
6
7
8
9
[program:activemq]
command=/app/apache-activemq/bin/activemq console
stdout_logfile=/app/apache-activemq/data/activemq_stdout.log
stdout_logfile_maxbytes=10MB
stderr_logfile=/app/apache-activemq/data/activemq_stderr.log
user=app
stderr_logfile_maxbytes=10MB
autostart=true
autorestart=true

supervisord_QA
https://imwang77.github.io/2020/06/08/Supervisord_QA/
作者
imwang77
发布于
2020年6月8日
更新于
2024年1月3日
许可协议