【记录】supervisor进程管理工具(python)
2016-01-11 11:24
811 查看
题记
之前在做视频编码自动化转换,其中转换部分使用了python脚本,因为想着使用一个进程管理工具, 能够检测到转换脚本的状态,能够在进程出现异常或失败时候进行自动重启。
发现
Supervisor is a client/server system that allows its users to control a number of processes on UNIX-like operating systems. Convenience,Accuracy,Delegation,Process Groups。
介绍
supervisor本身使用简单,本来想着写点简介和使用方法,发现网上有人已经写过而且写到通俗易懂,下面就将他人的总结转载一下,以作记录。
通用版supervisord.conf:
[program:hello] directory=/home/codeskyblue/hello command=python hello.py user=codeskyblue autostart=true autorestart=true redirect_stderr=true stopsignal=TERM stopasgroup=true
HTTP 服务
加入如下两行到/etc/supervisord.conf中 [inet_http_server] port = :9001 supervisorctl reload 重新加载配置。打开浏览器输入 http://localhost:9001, 应该就会看到这个页面了,网页上的功能也很全。
可能遇到的问题
Starting Supervisor daemon manager…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.
解决方案[]http://serverfault.com/questions/114477/supervisor-http-server-port-issue]
sudo unlink /tmp/supervisor.sock sudo unlink /var/run/supervisor.sock
官网:
http://supervisord.org/introduction.html
【转】
http://my.oschina.net/goskyblue/blog/380828
/article/4513117.html
http://blog.chedushi.com/archives/10462
相关文章推荐
- Python 汉字转拼音库 pypinyin
- Python--面向对象程序设计
- Python--字符串和对象
- Python--选择语句-循环语句-函数
- Python中sorted函数的用法
- 线性回归和批量梯度下降法python
- Python-层次聚类-Hierarchical clustering
- 【学神-RHEL7】P2-Python流程控制
- 转:Python K-means代码
- 【学神-RHEL7】 P1-Python基础
- Jenkins-测试自动化环境搭建(Python+RobotFramework+selenium)
- 2015年出现的十大流行 Python 库
- Python基本语法
- python正则
- Python爬虫实战五之模拟登录淘宝并获取所有订单
- 用python/java实现hmacmd5加密的一个示例
- python学习网址收集
- Python进阶01-05
- 基于Python实现文件大小输出
- Python Scrapy安装