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