I have configured some mosquitto options, which cause a mosquitto systemd service to spawn.
However, I need to use the contents of a file in the file system on the target device, and use it’s value as the mosquitto clientid.
The file (on our embedded devices) might look like this:
In any case, I now created the mosquitto config file by hand, without using the mosquitto options.
On system activation, this config file is copied to a writable dir, and the device’s serial number is appended as client_id.
Then, I enable mosquitto and rewrite the ExecStart command line, pointing to my patched config file.