Closed reubenmiller closed 4 months ago
Interesting enough, in Yocto, the mosquitto recipe includes a patch for using the network-online.target
over network.target
. https://patchwork.yoctoproject.org/project/oe/patch/20231006210507.556767-5-peter.marko@siemens.com/
https://github.com/thin-edge/tedge-rugpi-core/pull/23 fixes this issue in the tedge-rugpi-core layer.
tedge-rugpi-image v20240620.1234 includes the fix.
On device startup/boot, the mosquitto service fails to start (maybe because the network is not fully up?), and since the default mosquitto.service settings are to restart as quick as possible, this results in the service tripping the systemd "Start request repeated too quickly", and systemd then gives up trying to start the service.
Below shows how the mosquitto.service looks in this state (notice the "failed" status).
The journald logs (since boot) for the mosquitto.service show the failed start attempts:
Workaround
You can edit the mosquitto service to define how long it should wait before restarting the service, so that it does not trip the "too many starts" systemd mechanism.
The suggestion was posed from a mosquitto issue: https://github.com/eclipse/mosquitto/issues/2878
Add a drop-in for the mosquitto.service by using:
And add the following text:
Alternatively, the RestartSec property could set prevent quick restarts of mosquitto: