supervisor篇---后台程序监控

张开发
2026/4/16 23:59:03 15 分钟阅读

分享文章

supervisor篇---后台程序监控
文章目录一:安装二:配置三:程序配置四:启动 superviosr五:supervisorctl使用六:设置开机自启ubuntucentossupervisor 官网 http://supervisord.org/installing.html一:安装安装通过 apt-get 安装 (最好直接用root权限安装)sudo apt-get install supervisor二:配置echo_supervisord_conf/etc/supervisord.conf这行命令可以直接生成 supervisord.conf 的配置文件, 但是我不太建议用这个,会有很多问题files = relative/directory/*.ini ; 可以是 *.conf 或 *.ini注意: conf 或 ini 只能选择其中一种,(如果有多个配置文件的情况下), 并且要将 ;(分号)去掉本人的 /etc/supervisord.conf;supervisor configfile[unix_http_server]file=/var/run/supervisor.sock;(the path to the socketfile)chmod=0700;sockeffilemode(default0700)[supervisord]logfile=/var/log/supervisor/supervisord.log;(main logfile;default $CWD/supervisord.log)pidfile=/var/run/supervisord.pid;(supervisord pidfile;default supervisord.pid)childlogdir=/var/log/supervisor;('AUTO'child logdir,default $TEMP);the below section must remaininthe configfileforRPC;(supervisorctl/web interface)to work,additional interfaces may be;added by defining theminseparate rpcinterface:sections[rpcinterface:supervisor]supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface[supervisorctl]serverurl

更多文章