mosquitto icon indicating copy to clipboard operation
mosquitto copied to clipboard

`include_dir` behavior mismatch with documentation

Open zcattacz opened this issue 8 months ago • 3 comments

The document claimed:

include_dir dir External configuration files may be included by using the include_dir option. This defines a directory that will be searched for config files. ** All files that end in '.conf' ** will be loaded as a configuration file. It is best to have this as the last option in the main file. This option will only be processed from the main configuration file. The directory specified must not contain the main configuration file.

In practice, all files with ext name starting with .conf will be included. If a.conf is renamed to a.conf~~, it will still be loaded.

zcattacz avatar Apr 28 '25 11:04 zcattacz

I tested this on ubuntu x64 machine. And was not able to reproduce this. I started mosquitto using mosquitto -c ../mosquitto.conf. In the conf file I specified include_dir. In this folder, I made 3 files, abc.conf, def.conf, abc.conf~~, It loads only two, just like It's supposed to.

`1745910525: Loading config file ../test_dir/abc.conf

1745910525: Loading config file ../test_dir/def.conf

1745910525: mosquitto version 2.0.22 starting

1745910525: Config loaded from ../mosquitto.conf.`

abtom87 avatar Apr 29 '25 07:04 abtom87

Thanks for testing, @abtom87. I get the same results.

@zcattacz What version are you running, and on what platform?

ralight avatar May 01 '25 00:05 ralight

It was on a Debian bullseye server, when I was trying to disable the bridge setting (one .conf for each bridge configured) I found the external bridge constantly get connecting entry in log, until I moved the .conf~~ into a different folder. The version was 1.18 ? (I am only sure about the last 2 digit, it's now updated to 2.0.20)

There may be some differences from the test:

  • abc.conf~~ could be shadowed by abc.conf depending on the mechanisms behind the scene
  • reload/restart via systemd service, not sure about the switches it used to load mosquitto. (and I don't see Loading config file message in mosquitto.log, not any.)

I will double check next when I am back work, and report back.

zcattacz avatar May 01 '25 03:05 zcattacz