supervisorctl 3.3.1无法正常工作,抱怨没有找到.conf文件

时间:2017-05-04 21:16:27

标签: supervisord

ExternalType1

尝试访问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

为什么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

WTH?谁知道我做错了什么?我是通过Docker容器中的命令启动的:

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

1 个答案:

答案 0 :(得分:1)

首先,如何启动主管:

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

第二个典型配置(对我来说是监督--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>]
...

p.s。我已经回答了这篇文章,因为它首先出现在Google搜索中。)