I want to update some settings of mosquitto MQTT broker without stop running. There is a way to meet the goal.
First, you need to setup pid_file setting of mosquitto.conf. pid_file setting will set pid content such as process identifier in the file under assigned path.
And then I can setup a setting that I want process execution of mosquitto to reload configurations, for example acl_file. After I confirming a setting of a reloadable setting is correct, I will type command in the command line: kill -SIGHUP MOSQUITTO_PID. kill command with -SIGHUP PID will tell mosquitto to reload configuration and its-related settings to execution context.
Notice_1: You should change MOSQUITTO_PID as you find identifier in actual content in pid_file file.
Notice_2: It needs to adapt call kill slightly if you use mosquitto with docker. For example,docker exec -it <container> kill -SIGHUP MOSQUITTO_PID or docker container exec <container> -it kill -SIGHUP MOSQUITTO_PID And you must ensure there is a file mounted in pid_file path into the container.
You can find following by search Reloaded on Reload signal
acl_file, Warning: The currently loaded ACLs will be freed and reloaded. Existing subscriptions will be affected after the reload.allow_duplicate_messagesallow_zero_length_clientidauto_id_prefixautosave_intervalautosave_on_changescertfileclientid_prefixes, Notice: currently connected clients will be unaffected by any changes.connection_messageslog_destlog_timestamplog_timestamp_formatlog_typemax_inflight_bytesmax_inflight_messagesmax_keepalivemax_packet_sizemax_queued_bytesmax_queued_messagesmemory_limit, Warning: Setting to a lower value and reloading will not result in memory being freed.message_size_limitpassword_file, Notice: The currently loaded username and password data will be freed and reloaded. Clients that are already connected will not be affected.per_listener_settingspersistencepersistence_filepersistence_locationpersistent_client_expirationpsk_filequeue_qos0_messagesretain_availableset_tcp_nodelaysys_intervalupgrade_outgoing_qos
Reference link: