0
[email protected]:~# supervisord -v
3.3.1
我得到试图访问supervisorctl
如果出现以下错误:supervisorctl 3.3.1不工作,抱怨找不到.conf文件
Error: .ini file does not include supervisorctl section
For help, use /usr/bin/supervisorctl -h
监事不使用配置文件
[email protected]:/srv/www# /usr/bin/supervisorctl
Error: .ini file does not include supervisorctl section
For help, use /usr/bin/supervisorctl -h
[email protected]:/srv/www# cd /etc/
[email protected]:/etc# cat supervisor
supervisor/ supervisord/ supervisord.conf
[email protected]:/etc# ls supervisord/conf.d
supervisord.conf
[email protected]:/etc# ls supervisor/conf.d
supervisord.conf
[email protected]:/etc# ls supervisord
conf.d supervisord.conf
[email protected]:/etc# ls supervisor
conf.d supervisord.conf
所有的supervisord.conf
文件有以下几种:
[email protected]:/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是找到其中的一个,因为服务了:
[email protected]:~# 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
不工作?
而且最后:
[email protected]:~# 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
[email protected]:~# 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"]