[unix_http_server]
;file=/tmp/supervisor.sock ; (the path to the socket file)
;修改为 /var/run 目录,避免被系统删除
file=/var/run/supervisor.sock
;chmod=0700 ; socket file mode (default 0700)
;chown=nobody:nogroup ; socket file uid:gid owner
;username=user ; (default is no username (open server))
;password=123 ; (default is no password (open server))
;[inet_http_server] ; inet (TCP) server disabled by default
;port=127.0.0.1:9001 ; (ip_address:port specifier, *:port for ;all iface)
;在后面远程可视化管理中会用到
username=calypso ; (default is no username (open server))
password=123456 ; (default is no password (open server))
…
[supervisord]
;logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
;修改为 /var/log 目录,避免被系统删除
logfile=/var/log/supervisor/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=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
;修改为 /var/run 目录,避免被系统删除
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
…
[supervisorctl]
;修改为 /var/run 目录,避免被系统删除
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket
;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket
;username=chris ; should be same as http_username if set
;password=123 ; should be same as http_password if set
[include]
files = /etc/supervisord.d/*.ini ;对应需要管理的进程配置文件
;[eventlistener:theeventlistenername]
;是suopervisor启动的子进程,是订阅supervisord发送的event,比如报警等,后续将写一篇发送事件报警的实践文章
;command=/bin/eventlistener ;listener的可执行文件的路径
;process_name=%(program_name)s ;进程名,当下面的numprocs为多个的时候,才需要。
;numprocs=1 ; 相同的listener启动的个数
;events=EVENT ; event事件的类型,指定类型才会被发送
;buffer_size=10 ; 这个是event队列缓存大小
;directory=/tmp ; 进程执行前,会切换到这个目录下执行默认为不切换。。。非必须
;umask=022 ; 默认为none
;priority=-1 ; 启动优先级,默认-1
;autostart=true ; 是否随supervisord启动一起启动,默认true
;autorestart=unexpected ; 是否自动重启,分true,false,unexpected等
;startsecs=1 ; 也是一样,进程启动后跑了几秒钟,才被认定为成功启动,默认1
;startretries=3 ; 失败最大尝试次数,默认3
;exitcodes=0,2 ; 期望或者说预料中的进程退出码,
;stopsignal=QUIT ; 干掉进程的信号,默认为TERM,比如设置为QUIT,那么如果QUIT来干这个进程那么会被认为是正常维护,退出码也被认为是expected中的
;stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10)
;stopasgroup=false ; send stop signal to the UNIX process group (default false)
;killasgroup=false ; SIGKILL the UNIX process group (def false)
;user=chrism ;设置普通用户,可以用来管理该listener进程。默认为空
;redirect_stderr=true ; 为true的话,stderr的log会并入stdout的log里面默认为false
……
;[group:thegroupname] ;programs分组
;programs=progname1,progname2 ; 组成员,用逗号分开这个是个必须的设置项
;priority=999 ; 优先级,相对于组和组之间说的默认999