supervisor使用问题1:unix:///var/run/supervisor.sock refused connection

在使用supervisor时,使用如下命令启动

supervisord -c /etc/supervisord.conf

隔一段时间使用supervisorctl检查状态时发现如下报错

image.png

原因为配置文件中本地socket文件被写到tmp目录下,最终被系统定时清除了

[unix_http_server]
file=/tmp/supervisor.sock   ; the path to the socket file
;chmod=0700                 ; socket file mode (default 0700)
;chown=nobody:nogroup       ; socket file uid:gid owner
;username=user              ; default is no username (open server)
;password=123               ; default is no password (open server)

改为

[unix_http_server]
;file=/tmp/supervisor.sock   ; (the path to the socket file)
file=/var/run/supervisor.sock   ; 修改为 /var/run 目录或者其他目录,避免被系统删除
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容