Supervisor 运行在 3.0 上:
pip freeze | grep supervisor
supervisor==3.0
从命令行启动supervisord时:
sudo $VIRTENV/supervisord --nodaemon --configuration $PATH_TO_CONFIG/supervisord.conf
我收到此错误:
2013-11-11 23:30:50,205 CRIT Supervisor running as root (no user in config file)
但如果没有的话我就无法启动supervisordsudo,它抱怨:
Error: Cannot open an HTTP server: socket.error reported errno.EACCES (13)
正确的处理方法是什么?
(如果以root身份启动但在supervisord.conf的[supervisord]部分下设置user = foobar,我会得到同样的错误)
Update:这是我的supervisord.conf
[unix_http_server]
file = /opt/run/supervisord.sock
[inet_http_server]
port = 9001
username = foobar
password = foobar
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisord]
logfile = /opt/logs/supervisord.log
loglevel = debug
pidfile = /opt/run/supervisord.pid
[supervisorctl]
[program:foo1]
user = foobar
autostart = True
autorestart = True
command = foo1
stdout_logfile = /opt/logs/foo1.stdout.log
stderr_logfile = /opt/logs/foo1.stderr.log
stdout_logfile_maxbytes = 10MB
stderr_logfile_maxbytes = 10MB
[program:foo2]
user = foobar
autostart = true
autorestart = true
command = foo2
priority = 100
stdout_logfile_backups = 0
stderr_logfile_backups = 0
stdout_logfile_maxbytes = 10MB
stderr_logfile_maxbytes = 10MB
stdout_logfile = /opt/logs/foo2.stdout.log
stderr_logfile = /opt/logs/foo2.stderr.log
Supervisord 在进行任何处理之前切换到 UNIX 用户帐户。
您需要指定它应使用哪种用户帐户,以 root 身份运行守护程序,但在配置文件中指定用户
Example:
[program:myprogram]
command=gunicorn --worker-class socketio.sgunicorn.GeventSocketIOWorker app.wsgi:application -b 127.0.0.1:8000
directory=/opt/myprogram
user=user1
autostart=true
autorestart=true
redirect_stderr=True
Visit http://supervisord.org/configuration.html#program-x-section-values http://supervisord.org/configuration.html#program-x-section-values了解更多信息
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)