From 00bccdb21c62a8336fbef6c21180e2d1a66b99d7 Mon Sep 17 00:00:00 2001 From: xyj <1090822794@qq.com> Date: Tue, 5 Mar 2024 11:10:00 +0800 Subject: [PATCH] update --- MQTT.py | 2 ++ conf/common/push_stream.conf | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/MQTT.py b/MQTT.py index b232d8d..fde5136 100644 --- a/MQTT.py +++ b/MQTT.py @@ -33,6 +33,7 @@ class MQTTClient: self.client.subscribe(self.topic) client.publish(info_topic, payload=publish_payload(code=200, msg='成功订阅' + self.topic), qos=0) + subprocess.Popen(['/bin/bash /home/pi/agri_xumu/bash/start_push_stream.sh'], shell=True) def on_message(self, client, userdata, msg): if not valid(msg, client): @@ -79,4 +80,5 @@ if __name__ == '__main__': MQTT.client.loop_forever() except Exception as e: # 异常等待时间在进行连接 + subprocess.Popen(['/bin/bash /home/pi/agri_xumu/bash/stop_push_stream.sh'], shell=True) time.sleep(30) diff --git a/conf/common/push_stream.conf b/conf/common/push_stream.conf index d3fe8ab..eb3f8e8 100644 --- a/conf/common/push_stream.conf +++ b/conf/common/push_stream.conf @@ -2,8 +2,8 @@ directory=/home/pi/agri_xumu/bash command=/usr/bin/bash stream.sh user=pi -autostart=true -autorestart=true +autostart=false +autorestart=false redirect_stderr=true stopsignal=TERM stopasgroup=True