记录:Supervisor 安装和配置

安装

sudo apt–get install supervisor

在 /etc/supervisord.conf
中查看

[include]
files=/etc/supervisor/*.conf

然后写 *.conf文件

[program:xxx-worker]
process_name=%(program_name)s
directory=/path/to/project
command=/path/to/project/main arg1 arg2
autostart=true
autorestart=true
user=gamedev
numprocs=1
redirect_stderr=true
stdout_logfile=/var/log/xxx-worker.log

然后

sudo supervisorctl reread //检查配置语法
sudo supervisorctl update //更新配置语法
sudo supervisorctl start xxx-worker //启动


supervisorctl reread但是在centos上使用这个命令会报错error: <class 'socket.error'>, [Errno 2] No such file or directory: file: /usr/lib64/python2.7/socket.py line: 224
解决办法:supervisord -c /etc/supervisor/supervisord.conf来启动

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容