首页 > 代码库 > supervisor备忘

supervisor备忘

supervisor是把普通app变成deamon的工具,虽然没有erlang的supervise粒度那么细,但是已经非常方便了

 

安装

sudo apt-get install supervisor

 

修改配置文件

sudo gvim /etc/supervisor/supervisord.conf

 

添加下面的以支持web管理

[inet_http_server]port=9001username=adminpassword=admin

 

新建单独的配置

sudo gvim /etc/supervisor/conf.d/ss.conf
[program:ss]command=/home/mmc/tools/ss/cli/ss -c="/home/mmc/tools/ss/cli/config.json"autorstart=truestdout_logfile=/home/mmc/tools/ss/cli/supervisor.log

 

supervisor的命令

sudo invoke-rc.d supervisor startsudo supervisorctl status ss

 

如果启动的时候报错

 * 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.For help, use /usr/bin/supervisord -h   ...fail!

解决办法

sudo find / -name supervisor.socksudo unlink /***/supervisor.sock

 

supervisor备忘