-
安装:
pip install supervisor
-
配置文件:app.conf
[program:app] command=/usr/bin/gunicorn -w 1 -b 0.0.0.0:5000 old_id_server:app directory=/mnt/disk1/project/crawl/find_id_web autostart=true autorestart=true user=bashou stdout_logfile=/mnt/disk1/project/crawl/find_id_web/gunicorn.log stderr_logfile=/mnt/disk1/project/crawl/find_id_web/gunicorn.err
[supervisord]
[inet_http_server] ; inet (TCP) server disabled by default port=192.168.1.10:9001 ; (ip_address:port specifier, *:port for alliface) username=admin ; (default is no username (open server) password=admin ; (default is no password (open server))
[supervisorctl] serverurl=http://192.168.1.10:9001 ; use an http:// url to specify an inet socket username=bashou ; should be same as http_username if set password=admin ; should be same as http_password if set
[rpcinterface:supervisor] supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
-
启动 supervisord -c app.conf
-
管理任务:supervisorctl:
supervisorctl status
转载于:https://my.oschina.net/u/145106/blog/831901