Assuming you are running both mosquitto and SIP on the same Pi and using system.d unit files to start both programs you should be able to edit the unit file for sip (/etc/systemd/system/sip.system) and set mosquitto as a dependency.
e.g. add a line like:
After=mosquitto.target
near the top of the sip.service unit file.
The idea is to set the boot order so that mosquitto starts before SIP does during a restart of the system. I think that may eliminate the problem.
There is an answer to a similar question here:
https://serverfault.com/questions/482730...boot-order
This link may be even more helpful:
https://fedoramagazine.org/systemd-unit-...and-order/
I have not tested this but I think it could work. If you try it, let us know your result.
Dan
e.g. add a line like:
After=mosquitto.target
near the top of the sip.service unit file.
The idea is to set the boot order so that mosquitto starts before SIP does during a restart of the system. I think that may eliminate the problem.
There is an answer to a similar question here:
https://serverfault.com/questions/482730...boot-order
This link may be even more helpful:
https://fedoramagazine.org/systemd-unit-...and-order/
I have not tested this but I think it could work. If you try it, let us know your result.
Dan