问题
I want to reload the mosquitto password file when it is changed. Is possible to send SIGHUP ("signal hang up") or some equivalent to mosquitto server on windows?
回答1:
It is possible to do so. First you have to set your mosquitto.conf to save the pid in a file by specifying the pid_file.
pid_file your/pid/file
Then you can call
$kill -SIGHUP $(cat your/pid/file).
Or else if you already know the PID of the mosquitoo, then you can do
$kill -SIGHUP PID
This will send sighup signal and reload the pwfile. More info can be found at mosquitto conf
回答2:
I don't think you can, but you could use the mosquitto-auth-plugin which allows you to keep the ACL in a database that you can update while mosquitto is running.
This lets you a range of different database backends and you can add, remove, change ACL and users on the fly.
回答3:
Since I found this thread looking for an answer on Linux I think this reply is relevant for some.
I think I found a simplified version of dulaj's answer (for Linux). If you look at /etc/init.d/mosquitto (found on Mosquitto v.31) you'll see there is a "reload" option which has adds "--signal HUP" to the start-stop-daemon and it listed as "Reloading network daemon configuration: mosquitto".
So you should be able to run "sudo service mosquitto reload"
来源:https://stackoverflow.com/questions/39126688/mosquitto-reload-config-file