背景
用supervisor来守护服务器程序, 但使用非root用户云调用supervisorctl来操作程序时, 总是提示权限问题
[www@super-test ~]$ supervisorctl status error: <class 'PermissionError'>, [Errno 13] Permission denied: file: /usr/local/python/lib/python3.7/site-packages/supervisor-4.1.0-py3.7.egg/supervisor/xmlrpc.py line: 560
解决方案
修改/etc/supervisord.conf
[unix_http_server]
chmod=0770
chown=nobody:supervisor
新建supervisor组 并将用户加到supervisor组中
更干脆的是 直接将所有者改为当前用户
chown=www:www修改 /etc/supervisord.conf
[unix_http_server]
file=/tmp/supervisor.sock
将file直接改到/tmp/下 这下应该有权限了吧...如果上面都不行,再检查配置文件下面一段:
[supervisorctl]
serverurl=unix:///var/run/supervisor/supervisor.sock
这里应该和上面的unix_http_server 中的file 保持一致才对, 不然会提示: unix:///var/run/supervisor/supervisor.sock no such file
《本文》有 0 条评论