Linux: the configuration folders

Configuration files

Traditionally, Unix systems configuration were based on text files; you edit a file, sometime have to restart a service (rarely the entire system) and you’re in business. Most of the configuration files were located in the /etc folder.

This paradigm is good when you have few servers to manage, but quickly becomes a hell above a dozen of servers: you have to manually edit the files which is error-prone and very time-consuming. Manual editing introduces differences between servers, proscribing the use of tool to help you.

Configuration folders

Linux authors suggested another approach: the configuration folders. The idea is simple: the main configuration file is only a skeleton with few parameters and commands to include files located in a folder (generally named xxx.d, in xxx is the configuration file). Apache users knows this paradigm for years.

Examples:

/etc/sudoers  <-- main configuration file
/etc/sudoers.d  <-- configuration folder
/etc/sudoers.d/xxx.conf <-- sub configuration file 
This modular approach is much more efficient to deal with; each configuration or software has its own configuration file. Push this file onto the servers, and that’s it.

I recommend:

  • to use the configuration folders as much as possible
  • to write a configuration file per application/need
  • to keep the default settings in the main configuration file

Comments

Popular Posts