supervisor常见错误场景

10 篇文章 0 订阅

项目场景:

python虚拟环境venv启动supervisor服务

一、类型一

unix:///var/run/supervisor.sock no such file

error: <class ‘FileNotFoundError’>, [Errno 2] No such file or directory: file: /home/zhaon/miniconda3/envs/abio_filesvr/lib/python3.9/site-packages/supervisor/xmlrpc.py line: 557

在这里插入图片描述

原因分析:

supervisor管理的服务未启动就查询

解决方案:

supervisord -c filesvr.conf

二、类型二

Error: Cannot open an HTTP server: socket.error reported errno.EACCES (13)

在这里插入图片描述

原因分析:

supervisor无权限开启一个HTTP server

查看filesvr.conf,发现有下面一行关于HTTP server的配置,发现没有权限在目录/var/run目录创建文件
[unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)

解决方案:

变更file路径为一个可读写路径(且该路径权限为777),sudo chmod -R 777 /var/log/supervisor

同时为让supervisorctl(利用sock文件开启与释放)管理服务,也需将路径变为/var/log/supervisor
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; (use a unix:// URL for a unix socket)

结果展现:

[unix_http_server]
file=/var/log/supervisor/supervisor.sock  ; (the path to the socket file)
[supervisorctl]
serverurl=unix:///var/log/supervisor/supervisor.sock ; (use a unix:// URL  for a unix socket)

三、类型三

Error: Another program is already listening on a port that one of our HTTP servers is configured to use. Shut this program down first before starting supervisord

在这里插入图片描述

原因分析:

路径/var/log/supervisor存在同名的supervisor.sock文件,

解决方案:

删除同名文件或者更改文件启动名,因只我一个服务要启用,故采用删除法rm -rf /var/log/supervisor/supervisor.sock

四、类型四

Unlinking stale socket /var/log/supervisor/supervisor.sock

在这里插入图片描述

原因分析:

因服务异常关闭或者其它原因不存在了,导致链接异常

解决方案:

unlink /var/log/supervisor/supervisor.sock

结束!

配置任务最直观的感受:

  • 当以非root账户启动supervisor服务时,最常见的错误无非是无权限执行或访问。
  • 当以root账户启动supervisor服务时,什么问题都不再是问题了
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

学无止境gwx

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值