Mosquitto reconnect after power outage on broker?

Bo Berglund bo.berglund at gmail.com
Tue Apr 23 09:06:31 UTC 2024


I have a script running on boot on an Ubuntu server 20.04 LTS and its purpose is
to log all activity on an MQTT broker. The script command is this (newsreader
does word wrap..):

CMD="mosquitto_sub -h ${BROKERIP} -i ${MQTTID} -F '@Y- at m-@d @H:@M:@S ; %t ; %p'
-t '#' >> ${FULLOG}"
...
eval "$CMD"

It works well so far, but I am wondering if mosquitto will reconnect if the
broker system experiences a power outage and is restarted when power returns?

Is there some setting to control this or how does it work?

-- 
Bo Berglund
Developer in Sweden




More information about the ubuntu-users mailing list