gpt4 book ai didi

supervisord - supervisorctl 3.3.1 不工作,提示找不到 .conf 文件

转载 作者:行者123 更新时间:2023-12-04 03:12:38 26 4
gpt4 key购买 nike

root@dev-demo-karl:~# supervisord -v
3.3.1

尝试访问 supervisorctl 时出现以下错误:
Error: .ini file does not include supervisorctl section
For help, use /usr/bin/supervisorctl -h

主管不使用配置文件
root@dev-demo-karl:/srv/www# /usr/bin/supervisorctl
Error: .ini file does not include supervisorctl section
For help, use /usr/bin/supervisorctl -h
root@dev-demo-karl:/srv/www# cd /etc/
root@dev-demo-karl:/etc# cat supervisor
supervisor/ supervisord/ supervisord.conf
root@dev-demo-karl:/etc# ls supervisord/conf.d
supervisord.conf
root@dev-demo-karl:/etc# ls supervisor/conf.d
supervisord.conf
root@dev-demo-karl:/etc# ls supervisord
conf.d supervisord.conf
root@dev-demo-karl:/etc# ls supervisor
conf.d supervisord.conf

所有 supervisord.conf文件有以下内容:
root@dev-demo-karl:/etc# cat supervisord.conf 
[supervisord]
nodaemon=true

[program:node]
directory=/srv/www
command=npm run demo
autostart=true
autorestart=true

[program:mongod]
command=/usr/bin/mongod --auth --fork --smallfiles --logpath /var/log/mongodb.log

KNOW supervisord 正在寻找其中之一,因为服务已启动:
root@dev-demo-karl:~# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.8 47624 17744 ? Ss 21:03 0:00 /usr/bin/python /usr/bin/supervisord
root 8 0.1 2.4 1003400 49580 ? Sl 21:03 0:00 npm
root 16 0.6 2.3 295224 48192 ? Sl 21:03 0:03 /usr/bin/mongod --auth --fork --smallfiles --logpath /var/log/mongodb.log
root 40 0.0 0.0 4512 844 ? S 21:03 0:00 sh -c npm run prod
root 41 0.1 2.4 1003412 49584 ? Sl 21:03 0:00 npm
root 52 0.0 0.0 4512 712 ? S 21:03 0:00 sh -c NODE_ENV=production NODE_PATH="$(pwd)" node src/index.js
root 54 0.4 8.1 1068568 166080 ? Sl 21:03 0:02 node src/index.js
root 79 0.0 0.1 18240 3248 ? Ss+ 21:04 0:00 bash
root 238 0.0 0.1 18248 3248 ? Ss 21:06 0:00 bash
root 501 0.0 0.1 34424 2884 ? R+ 21:12 0:00 ps aux

为什么不是 supervisorctl不工作?

最后:
root@dev-demo-karl:~# cat /etc/supervisord.conf
[supervisord]
nodaemon=true

[program:node]
directory=/srv/www
command=npm run demo
autostart=true
autorestart=true

[program:mongod]
command=/usr/bin/mongod --auth --fork --smallfiles --logpath /var/log/mongodb.log
root@dev-demo-karl:~# supervisorctl -c /etc/supervisord.conf
Error: .ini file does not include supervisorctl section
For help, use /usr/bin/supervisorctl -h

什么?有谁知道我做错了什么?我通过 Docker 容器中的命令启动它:
CMD ["/usr/bin/supervisord"]

最佳答案

一、如何启动supervisord:

# Start server
supervisord -c /path/to/supervisor.conf
# Then use client
supervisorctl -c /path/to/supervisor.conf status

二、典型配置(为我工作supervisord --v -> 4.1.0)
[inet_http_server]
port = 127.0.0.1:9001

[supervisorctl]
serverurl = http://127.0.0.1:9001

[program:<your_program_name>]

或者
[unix_http_server]
file=/tmp/supervisor.sock

[supervisord]
nodaemon=true
logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid
childlogdir=/var/log/supervisor

[rpcinterface:supervisor]
supervisor.rpcinterface_factory =
supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///tmp/supervisor.sock

[program:<your_program_name>]
...

附言我已经在这篇文章中回答了,因为它首先出现在谷歌搜索中。)

关于supervisord - supervisorctl 3.3.1 不工作,提示找不到 .conf 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43792897/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com