This is a typical
.d configuration directory. These directories replace or extend a configuration file so that you or a package maintainer can modify the configuration of a program without having to edit a central configuration file.
It's useful because it splits a configuration file into smaller, more manageable chunks which in turn makes it easier for packages to extend the configuration of programs. For example, imagine that you're a package maintainer, and your package has to extend
/etc/apt/apt.conf with some configuration directives. Now you have to worry about changes the user or other packages may have made to this file - you must be careful not to overwrite or break these changes, and in turn you have to expect that other changes may break your directives.
.d directories make this much easier. You just put your directives into a file
/etc/apt/apt.conf.d/20my-package-name.conf, and you're mostly done.
What do these files do?
Each file adds its own configuration directives to the
apt configuration. You'll have to look into each file if you want to know what it does exactly.
What do the numbers mean?
The files are read in alphabetical order, so you can prepend numbers to the file name if you prefer them to be read in a specific order. For example, if later directives overwrite earlier ones (that of course depends on the respective program that reads those files), you could use a low number like
00 to supply default values, a number in the middle like
40 for normal directives, and a high number like
90 to supply important directives that must overwrite all earlier directives.
Can I add new files to this dir so that they are loaded as well?
Yes, that's the idea of it.
If so, is there a convention for doing so?
Depends on the program, but essentially it's just
- use a unique name
- if there's an ordering system, choose a sensible number
- some programs only read files with a specific extension, so look at the other files to determine the correct extension
- be careful not to leave any junk files in the directory (for example old backups or temporary files), because those may break the
application if it includes every single file in the directory