#以下启动顺序由上到下优先级,依次递减 $CWD/supervisord.conf $CWD/etc/supervisord.conf /etc/supervisord.conf /etc/supervisor/supervisord.conf (since Supervisor 3.3.0) ../etc/supervisord.conf (Relative to the executable) ../supervisord.conf (Relative to the executable)
[unix_http_server] file=/tmp/supervisor.sock ; #建议修改为 /var/run 目录,避免被系统删除包括 pid / ;chmod=0700 ; socket file mode (default 0700) ;chown=nobody:nogroup ; socket file uid:gid owner username=user ; default is no username (open server) #设置sock账号密码 password=123 ; default is no password (open server)
[inet_http_server] ; inet (TCP) server disabled by default port=192.168.56.102:9001 ; ip_address:port specifier, *:port for all iface username=user ; default is no username (open server) password=123 ; default is no password (open server)
[supervisord] logfile=/tmp/supervisord.log ; main log file; default $CWD/supervisord.log logfile_maxbytes=50MB ; 最大主日志文件字节;默认50 mb logfile_backups=10 ; 主日志文件备份;0表示没有,默认为10 loglevel=info ; log level; default info; others: debug,warn,trace pidfile=/tmp/supervisord.pid ; supervisord pidfile; default supervisord.pid nodaemon=false ; start in foreground iftrue; default false minfds=1024 ; min. avail startup file descriptors; default 1024 minprocs=200 ; min. avail process descriptors;default 200 umask=022 ; process file creation umask; default 022 ;user=supervisord ; setuid to this UNIX account at startup; recommended if root ;identifier=supervisor ; supervisord identifier, default is 'supervisor' ;directory=/tmp ; default is not to cd during start ;nocleanup=true ; don't clean up tempfiles at start; default false' ;childlogdir=/tmp ; 'AUTO' child log dir, default $TEMP ;environment=KEY="value" ; key value pairs to add to environment ;strip_ansi=false ; strip ansi escape codes in logs; def. false
; The rpcinterface:supervisor 部分必须保留在配置文件中 ;以便RPC (supervisorctl/web interface)工作。 ;可以通过在单独的[rpcinterface:x]小节中定义它们来添加其他接口。
; The supervisorctl section :设置supervisorctl连接交互到本机的参数 ; supervisord. configure it match the settings in either the unix_http_server inet_http_server section.
[supervisorctl] serverurl=unix:///tmp/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 in [*_http_server] ifset ;password=123 ; should be same as in [*_http_server] ifset ;prompt=mysupervisor ; cmd line prompt (default "supervisor") ;history_file=~/.sc_history ; use readline historyif available
;stopasgroup=false ; #管理的子进程,这个子进程本身还有子进程 #如果仅仅干掉supervisord的子进程的话,子进程的子进程有可能会变成孤儿进程,所以咱们可以设置可个选项,把整个该子进程的整个进程组都干掉。 #设置为true的话,一般killasgroup也会被设置为true。需要注意的是,该选项发送的是stop信号,默认为false。。非必须设置 ;killasgroup=false ; SIGKILL the UNIX process group (def false),同不过上发送的是KILL信号 ;user=chrism ; #脚本运行的用户身份 ;redirect_stderr=true ; #如果为true,则stderr的日志会被写入stdout日志文件中,默认 false
#标准输出 日志 ;stdout_logfile=/a/path ; stdout log path, NONE for none; default AUTO ;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) ;stdout_logfile_backups=10 ; # of stdout logfile backups (0 means none, default 10) ;stdout_capture_maxbytes=1MB ; number of bytes in'capturemode' (default 0) ;stdout_events_enabled=false ; emit events on stdout writes (default false) ;stdout_syslog=false ; send stdout to syslog with process name (default false)
#标准错误 日志 ;stderr_logfile=/a/path ; stderr log path, NONE for none; default AUTO ;stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) ;stderr_logfile_backups=10 ; # of stderr logfile backups (0 means none, default 10) ;stderr_capture_maxbytes=1MB ; number of bytes in'capturemode' (default 0) ;stderr_events_enabled=false ; emit events on stderr writes (default false) ;stderr_syslog=false ; send stderr to syslog with process name (default false) ;environment=A="1",B="2" ; process environment additions (def no adds) ,该子进程的环境变量,和别的子进程是不共享的 ;serverurl=AUTO ; override serverurl computation (childutils)
; The sample eventlistener section below shows all possible eventlistener ; subsection values. Create one or more 'real' eventlistener: sections to be ; able to handle event notifications sent by supervisord.
;[eventlistener:theeventlistenername] ;command=/bin/eventlistener ; the program (relative uses PATH, can take args) ;process_name=%(program_name)s ; process_name expr (default %(program_name)s) ;numprocs=1 ; number of processes copies to start (def 1) ;events=EVENT ; event notif. types to subscribe to (req'd)' ;buffer_size=10 ; event buffer queue size (default 10) ;directory=/tmp ; directory to cwd to before exec (def no cwd) ;umask=022 ; umaskfor process (default None) ;priority=-1 ; the relative start priority (default -1) ;autostart=true ; start at supervisord start (default: true) ;startsecs=1 ; # of secs prog must stay up to be running (def. 1) ;startretries=3 ; max # of serial start failures when starting (default 3) ;autorestart=unexpected ; autorestart if exited after running (def: unexpected) ;exitcodes=0 ; 'expected'exit codes used with autorestart (default 0) ;stopsignal=QUIT ; signal used to kill process (default TERM) ;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 ; setuid to this UNIX account to run the program ;redirect_stderr=false ; redirect_stderr=true is not allowed for eventlisteners ;stdout_logfile=/a/path ; stdout log path, NONE for none; default AUTO ;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) ;stdout_logfile_backups=10 ; # of stdout logfile backups (0 means none, default 10) ;stdout_events_enabled=false ; emit events on stdout writes (default false) ;stdout_syslog=false ; send stdout to syslog with process name (default false) ;stderr_logfile=/a/path ; stderr log path, NONE for none; default AUTO ;stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) ;stderr_logfile_backups=10 ; # of stderr logfile backups (0 means none, default 10) ;stderr_events_enabled=false ; emit events on stderr writes (default false) ;stderr_syslog=false ; send stderr to syslog with process name (default false) ;environment=A="1",B="2" ; process environment additions ;serverurl=AUTO ; override serverurl computation (childutils)
;设置我们上面程序设置控制,并将它们放入特定得我组
;[group:thegroupname] ;programs=progname1,progname2 ; each refers to 'x'in [program:x] definitions ;priority=999 ; 相对启动优先级(默认999)
; The [include] section can just contain the "files" setting. This ; setting can list multiple files (separated by whitespace or ; newlines). It can also contain wildcards. The filenames are ; interpreted as relative to this file. Included files *cannot* ; include files themselves.
>>> server.supervisor.readLog(1,1024) "019-05-24 15:53:38,086 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.\n2019-05-24 15:53:38,190 INFO RPC interface 'su' >>> server.supervisor.tailProcessLog('weiyigeek',1,1024) #指定监控名称产生的线程日志 [u' should be root.)\n\u5f53\u524dTCP\u8fde\u63a5\u6570\u91cf\uff1a4\n(No info could be read for "-p": geteuid()=994 but you should be root.)\n\u5f53\u524dTCP\u8fde\u63a5\u6570\u91cf\uff1a4\n(No info could be read for "-p": geteuid()=994 but you should be root.)\n\u5f53\u524dTCP\ >>> server.supervisor.startAllProcesses(); #启动所有线程 [{'status': 80, 'group': 'weiyigeek', 'name': 'weiyigeek', 'description': 'OK'}]
方式1.请访问本博主的B站【WeiyiGeek】首页关注UP主, 将自动随机获取解锁验证码。
Method 2.Please visit 【My Twitter】. There is an article verification code in the homepage.
方式3.扫一扫下方二维码,关注本站官方公众号
回复:验证码
将获取解锁(有效期7天)本站所有技术文章哟!