supervisor 进程管理工具

supervisor(一)基础篇 Supervisor安装与配置(Linux/Unix进程管理工具)

; Sample supervisor config file.
;
; For more information on the config file, please see:
; http://supervisord.org/configuration.html
;
; Note: shell expansion ("~" or "$HOME") is not supported. Environment
; variables can be expanded using this syntax: "%(ENV_HOME)s".

[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)

[supervisord]
logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
loglevel=info ; (log level;default info; others: debug,warn,trace)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
nodaemon=false ; (start in foreground if true;default false)
minfds=1024 ; (min. avail startup file descriptors;default 1024)
minprocs=200 ; (min. avail process descriptors;default 200)

; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket

; The below sample program section shows all possible program subsection values,
; create one or more 'real' program: sections to be able to control them under
; supervisor.

[program:watchmedo]
command=/usr/local/bin/watchmedo shell-command --patterns "*.py;*.txt" --recursive --command='/
usr/local/bin/supervisorctl restart gunicorn' /var/www/html
process_name=%(program_name)s
directory=/var/www/html
autostart=true
autorestart=true
redirect_stderr=true

[program:gunicorn]
command=/usr/local/bin/gunicorn appname:app -c /opt/appname/gunicorn.conf.py
process_name=%(program_name)s
directory=/var/www/html
user=ubuntu
autostart=true
autorestart=true
redirect_stderr=true
environment=DATABASE_URL='mysql://user:password@appname.crrk2qi8kbp
v.us-east-1.rds.amazonaws.com/appname',ANOTHER_ENV_VARL='http://api.url.com'

发表评论

电子邮件地址不会被公开。 必填项已用*标注