What does the suffix .d mean in Linux?

Posted on

What does the suffix .d mean in Linux? – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, apache-2.2, , , .

I am configuring apache and by default I have the directories /etc/httpd/conf and /etc/httpd/conf.d. What is the difference?

Also you can see the suffix in many other directories like /etc/init.d, /etc/cron.d, etc…

Solution :

“d” stands for directory and such a directory is a collection of configuration files which are often fragments that are included in the main configuration file. The point is to compartmentalize configuration concerns to increase maintainability.

When you have a distinction such as /etc/httpd/conf vs /etc/httpd/conf.d, it is usually the case that /etc/httpd/conf contains various different kinds of configuration files, while a .d directory contains multiple instances of the same configuration file type (such as “modules to load”, “sites to enable” etc), and the administrator can add and remove as needed.

The main driving force behind the existence of this directory naming convention is for easier package management of configuration files. Whether its rpm, deb or whatever, it is much easier (and probably safer) to be able to drop a file into a directory so that it is auto included into a program’s configuration instead of trying to edit a global config file.

A good example of this is logrotate. In the directory /etc/logrotate.d are config files for practically every application you have installed that keeps a log in /var/log. Some are bunched into the syslog config because nearly every system has a messages, wtmp and lastlog file. But if you install Apache on your system, you need an easy way of automatically adding the config for rotating Apache’s logs, so it just drops a config file called httpd in /etc/logrotate.d and logrotate is configured to include the files in that directory. Each one is owned by the package for the daemon and if you remove the package it will remove the file. Its basically a way of modularizing config files. Note that this needs to be supported by the program, its not something automatic that the system does for you or something. Usually programs that do it have a config directive called include that specify where that directory is located on the filesystem.

logrotate.d might even be the first place this convention was used outside of the init.d and rc.d directories for init scripts.

Leave a Reply

Your email address will not be published.