MQTT connection error not handled
If the MQTT broker is not reachable if the daemon starts, it crashes. If the connection drops while the daemon is running, the daemon continues running without any reconnect attempt.
Simple solution would be to terminate the daemon on connection loss with an special error code and let systemd do the restart.