chirpstack-gateway-os
chirpstack-gateway-os copied to clipboard
Mosquitto doesn't load the configuration file at startup
Hello!
I encountered the following problem (with Chirpstack Gateway OS full 3.1.0test1).
I prepared my own customized configuration file for the Mosquitto bridge that allows me to connect with my cloud service.
I placed this bridge.conf file in /etc/mosquitto/conf.d directory which I included to the main configuration file as include_dir /etc/mosquitto/conf.d.
When I reloaded the configuration for Mosquitto by command:
sudo /etc/init.d/mosquitto reload
and I restarted the Mosquitto daemon:
sudo /etc/init.d/mosquitto restart
the connection to the cloud service was established correctly (I was able to read the messages on selected topics on both sites - cloud and gateway).
But when I rebooted the system, the connection wasn't re-established (automatically) even though the configuration file wasn't changed.
I short investigated this problem and noticed that in /etc/init.d/mosquitto script, in case when it is called with start parameter, the configuration file isn't loaded as in the case of a call with the restart parameter:
if start-stop-daemon --start --quiet --oknodo --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON} -- -c /etc/mosquitto/mosquitto.conf ; then
So if I add -- -c /etc/mosquitto/mosquitto.conf flag also to the case of a call with the start parameter, connection with the cloud service is establishing correctly - even if I reboot the system.
So - is this a bug? Or did I do something incorrectly?
maybe need check "include_dir" in your mosquitto.conf to add /etc/mosquitto/conf.d directory
please ref. https://mosquitto.org/man/mosquitto-conf-5.html and check "" for add your conf.d folder I testing on Chirpstack Gateway OS v3.3.2 is success