; MQTT Broker 常驻守护(Supervisor / 宝塔「进程守护管理器」通用) ; 安装: ; 1) 复制到 supervisor 配置目录,例如 /etc/supervisor/conf.d/iot-broker.conf ; 宝塔:软件商店 → 进程守护管理器 → 添加守护进程,把下面 program 段落逐项填进去 ; 2) supervisorctl reread && supervisorctl update && supervisorctl start iot-broker ; 3) 查看:supervisorctl status iot-broker | tail -f runtime/iot-broker.log ; 注意:改下面 3 处占位路径;Linux 下 iot start 单进程同时开 TCP 1883 + WS 8083 [program:iot-broker] command=/www/server/php/74/bin/php think iot start directory=/www/wwwroot/ywxapp_dev user=www ; 与 runtime/iot.pid 协作:被守护进程异常退出由 supervisor 拉起,正常 stop 走 SIGINT autostart=true autorestart=true startsecs=5 startretries=10 stopwaitsecs=30 stopsignal=INT stopasgroup=true killasgroup=true redirect_stderr=true stdout_logfile=/www/wwwroot/ywxapp_dev/runtime/iot-broker.log stdout_logfile_maxbytes=10MB stdout_logfile_backups=5 environment=HOME="/www/wwwroot/ywxapp_dev",PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"