0

This is a super basic question, but one of those things that is hard to Google. It seems like configuration through /etc/*.d isn't supported on all linux Kernels. I'd like to understand, first, how to properly refer to the .d paradigm, and second, (probably beyond the scope of this site) the history behind it and why different config strategies were chosen.

Thanks.

0

1 Answer 1

1

This is apparently a really common question. As far as I can tell, yours is the first one on Stack Exchange to ask about the benefits and/or history, rather than just asking what it means, so I'll answer it here directly.

So .d just means "directory". As far as I can tell, this became a thing with sysvinit, with the /etc/init.d/ or /etc/rc.d folders. These, always contain separated configuration files that are parsed or invoked by some other process.

As to why this is done, a few reasons:

  1. Imagine if your init process was controlled by a single configuration file. That file would become large and unwieldy. Web services like nginx use this paradigm to encourage separation of individual websites or vhosts into their own configuration files. (This folder is called sites-available in most distros Nginx packages, but it also has a conf.d folder that generally applies to settings that apply everywhere)

  2. Security separation (somewhat). Separate config files allow different permissions on each file. If one user were trusted to modify a service or setting relevant to them, they could modify only the files they have rights to, rather than giving them the rights to the "one file to rule them all"

  3. Ease of troubleshooting/reconfiguring. Going back to nginx, say you needed to disable a specific subdomain. With each site broken out into its own configuration file, you can just rename or remove that one file rather than going into a single large file and commenting things out. The same applies to init - usually on sysv systems, init scripts are taken into and out of service by adding or removing symbolic links. This handles runlevels and so forth. No need to invoke a text editor.

All of these benefits are gained for a very minute increase in complexity.

Terminology? I don't think there is anything official for this design, everyone just calls them "dot d folders".

Some further reading:

1
  • Thanks for explaining, and the links!
    – Freeman
    Feb 2, 2020 at 22:32

Not the answer you're looking for? Browse other questions tagged .