chirpstack-gateway-os icon indicating copy to clipboard operation
chirpstack-gateway-os copied to clipboard

Mosquitto doesn't load the configuration file at startup

Open splaw1k opened this issue 5 years ago • 1 comments

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?

splaw1k avatar Dec 16 '19 13:12 splaw1k

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

KunYi avatar Nov 23 '20 01:11 KunYi