I have an MQTT broker running in Ubuntu 16.04. My question is that how I can add users while the broker is running? When I add a user using
mosquitto_passwd -c /etc/mosquito/pwfile user2
The user does show up in pwfile but I am not able to access that user from an external source until I restart the broker. I have tried to use
sudo mosquitto -c /etc/mosquitto/mosquitto.conf
to reload the mosquitto.conf file but it gives this error
1483102542: Config loaded from /etc/mosquitto/mosquitto.conf.
1483102542: Opening ipv4 listen socket on port 1883.
1483102542: Error: Address already in use
So what should I do to add users to broker and load them without restarting the broker?(I am using ESP8266 devices to access this broker and I have also tried to access the newly added user using MQTTLens(a chrome extension) but I was unable to access)
There are 2 options for this.
mosquitto_passwd
. You can force mosquitto to re-read the file by sending the mosquitto broker a HUP signal