主页 > 游戏开发  > 

【supervisor】unix:///tmp/supervisor.socknosuchfile


问题

supervisor在正常安装完时运行正常,但隔一段时间后出现了故障,重启后报: unix:///tmp/supervisor.sock no such file 原因是 supervisor 默认配置会把 socket 文件和 pid 守护进程生成在Linux的/tmp/目录下,/tmp/目录是缓存临时文件的目录,Linux会根据不同情况自动删除其下面的文件。比如缓存超时等,因此我们需要做如下修改:

具体操作如下: vi /etc/supervisord.conf

或者

/etc/supervisor/supervisord.conf

[unix_http_server]

;file=/tmp/supervisor.sock ; (the path to the socket file) file=/var/run/supervisor.sock ; 修改为 /var/run 目录,避免被系统删除

[supervisord]

;logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log) logfile=/var/log/supervisor/supervisord.log ; 修改为 /var/log 目录,避免被系统删除 pidfile=/var/run/supervisord.pid ; 修改为 /var/run 目录,避免被系统删除

[supervisorctl]

; 必须和'unix_http_server'里面的设定匹配 ;serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket serverurl=unix:///var/run/supervisor.sock ; 修改为 /var/run 目录,避免被系统删除

更新配置文件 supervisorctl update

但是提示

Redirecting to /bin/systemctl start supervisor.service Failed to start supervisor.service: Unit supervisor.service not found.

再执行 supervisorctl 时提示:

[root@xxx run]# supervisorctl unix:///var/run/supervisor.sock refused connection supervisor> exit

最后

supervisord -c /etc/supervisord.conf # 可以直接执行这条命令, 自动创建supervisor.sock

但我的supervisord.conf 文件在 /etc/supervisor/supervisord.conf 因此执行后启动成功

supervisord -c /etc/supervisor/supervisord.conf
标签:

【supervisor】unix:///tmp/supervisor.socknosuchfile由讯客互联游戏开发栏目发布,感谢您对讯客互联的认可,以及对我们原创作品以及文章的青睐,非常欢迎各位朋友分享到个人网站或者朋友圈,但转载请说明文章出处“【supervisor】unix:///tmp/supervisor.socknosuchfile