您的位置:首页 > 编程语言 > Python开发

【记录】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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: