1,打开配置文件supervisord.conf
代码语言:javascript复制vim /etc/supervisord.conf
2,修改配置文件
代码语言:javascript复制#file=/tmp/supervisor.sock ; (the path to the socket file)
file=/var/run/supervisor.sock ; (the path to the socket file)
#logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile=/var/log/supervisord.log ; (main log file;default $CWD/supervisord.log)
#pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
原因:在supervisor默认配置中,其启动的sock等都会放到tmp目录,而tmp目录会自动清理导致无法使用supervisorctl命令
3,修改权限
代码语言:javascript复制sudo chmod 777 /run
sudo chmod 777 /var/log
4,杀死旧进程(kill),重新启动所有的进程
sudo supervisorctl start all
5,执行supervisorctl status时报unix:///tmp/supervisor.sock no such file,
修改如下配置:
代码语言:javascript复制serverurl=unix:///tmp/supervisor.sock 改成serverurl=unix:///var/run/supervisor.sock,