Mosquitto not loading correctly

Hello,

My mosquitto service loads on boot, but with wrong config (maybe a default one?)

I tried a workarround by running i local startup the following

/etc/init.d/mosquitto stop
mosquitto -c /etc/mosquitto/mosquitto.conf

boot log tells me that

Sun Jun 23 11:25:11 2024 daemon.notice procd: /etc/rc.d/S95done: 1719138311: mosquitto version 2.0.18 starting
Sun Jun 23 11:25:11 2024 daemon.notice procd: /etc/rc.d/S95done: 1719138311: Config loaded from /etc/mosquitto/mosquitto.conf.
Sun Jun 23 11:25:11 2024 daemon.notice procd: /etc/rc.d/S95done: 1719138311: Opening ipv4 listen socket on port 1883.
Sun Jun 23 11:25:11 2024 daemon.notice procd: /etc/rc.d/S95done: 1719138311: Error: Address in use

ssh into the machine and running the same commands will deliver

root@fire:~# /etc/init.d/mosquitto stop
itto -c /etc/mosquitto/mosquitto.confCommand failed: Not found
root@fire:~# mosquitto -c /etc/mosquitto/mosquitto.conf
1719138430: mosquitto version 2.0.18 starting
1719138430: Config loaded from /etc/mosquitto/mosquitto.conf.
1719138430: Opening ipv4 listen socket on port 1883.
1719138430: Opening ipv6 listen socket on port 1883.
1719138430: Opening ipv4 listen socket on port 9001.
1719138430: Opening ipv6 listen socket on port 9001.
1719138430: mosquitto version 2.0.18 running

How can i bypass this issue?

Thanks in advance

Mosquitto will use /etc/mosquitto/mosquitto.conf as the default configuration file if you set option use_uci 0 in /etc/config/mosquitto.

with that line on mosquitto.conf i get the following

root@fire:~# dmesg | mosquitto
1719140049: mosquitto version 2.0.18 starting
1719140049: Using default config.
1719140049: Starting in local only mode. Connections will only be possible from clients running on this machine.
1719140049: Create a configuration file which defines a listener to allow remote access.
1719140049: For more details see https://mosquitto.org/documentation/authentication-methods/
1719140049: Opening ipv4 listen socket on port 1883.
1719140049: Opening ipv6 listen socket on port 1883.
1719140049: mosquitto version 2.0.18 running

Open

and change the value of option use_uci from 1 to 0.

Remove what you added to /etc/mosquitto/mosquitto.conf

1 Like

That's my /etc/config/mosquitto

config owrt owrt
    option use_uci 0

config mosquitto mosquitto

config persistence persistence

Already has the option enabled

Still the same

Shouldn't i edit /etc/config/mosquitto and point the location of my config file?

After another boot it's working..

Thanks for helping

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.