Web lists-archives.com

Re: Can somebody explain the benefits of .d directories

On Mon, Nov 27, 2017 at 05:09:49PM -0500, Hans-Peter wrote:
>    I have an honest question which is dead-simple: Why do we have ".d"
>    directories, such as "sources.d" or "grub.d", note that with grub, the
>    defaults are in another directory tree - this is simply beyond insane.
>    (Sorry to quote Linus)
>    I am sure this question has been asked before (I have googled for many
>    years and have not found an acceptable answer, the downside being having
>    to parse several files vs a single file) and I am more than happy to
>    accept "change", except that in this case it needlessly increases my
>    workload. With ancient UNIX systems, a sed oneliner is enough, with Linux,
>    I have to use "grep -r" or use "find" in combination with "sed". I
>    seriously think this is nonsense, there is no "logical" reason for doing
>    this, afaict. Have I missed something ? I have asked the question on
>    unix.stackexchange.com and got silly answers trying to defend the "it is
>    so much easier to parse x files in a directory than a single file" stance
>    (you gotta be kidding!).

For me, I deploy a file called /etc/sudoers.d/local on every system that
I maintain which ensures that my own local user account, as well as
those of other admins, always have sudo access regardless of their group

Deploying that as part of a profile package that gets distributed via an
internal apt repository is far simpler than monkeying with sed.

It also works well for apt sources in /etc/apt/sources.list.d, dpkg
preferences in /etc/dpkg/dpkg.cfg.d, and syslog configurations in
/etc/rsyslog.d to name a few.



Roberto C. Sánchez