Linked by Thom Holwerda on Wed 21st Apr 2010 23:01 UTC
Linux The tools used to boot Linux are changing. Specifically, the Grand Unified Bootloader is now officially in maintenance mode only, and GRUB's developers have abandoned the original GRUB in favor of an entirely rewritten package, known as GRUB 2. Discover GRUB 2's new capabilities and how to use it.
Thread beginning with comment 420338
To read all comments associated with this story, please click here.
phoenix
Member since:
2005-07-11

Why do all Linux developers have a hard-on for spreading config options into dozens of different files, in multiple sub-directories? What is wrong with a single, simple config file?

First it was xinetd. Then Apache 2.x. Then a bunch of other software followed suit. Now Grub2. ProFTPd took it to the extreme (1 option per file, filename is the option name, contents are the option values).

It's irritating in the extreme, and makes it *VERY* hard to manage from the CLI. I thought software was supposed to get *easier* to manage as time went on.

Reply Score: 5

Zifre Member since:
2009-10-04

First it was xinetd. Then Apache 2.x. Then a bunch of other software followed suit. Now Grub2. ProFTPd took it to the extreme (1 option per file, filename is the option name, contents are the option values).

Personally, that way is my favorite way. I have never used ProFTPd, but that is similar to Linux's procfs or sysfs. I think it makes it extremely easy to manage with scripts, ex:

echo 42 > options/some_option

All of the programs I have written work this way. I then wrote a small GUI program that displays the options and lets you edit them, sort of like GConf. I think it is actually very easy to use. It also makes the programming a lot easier (no parsers needed).

Reply Parent Score: 2

phoenix Member since:
2005-07-11

It might makes things easy to automate ... but it makes it a royal pain in the arse to deal with manually. And when you're working on multiple servers across multiple network links, it becomes even more of a royal pain in the arse. And when things go wrong ... it's even worse.

Reply Parent Score: 2

AnyoneEB Member since:
2008-10-26

Personally, I find multiple config files much easier to deal with. They certainly make scripts that deal with config files easier, but I also like that I can, for example, enable or disable a site in Apache 2 using ln -s and rm and that to change a single site, I do not have to find it in a config file. (Admittedly, I am not a heavy user of Apache but I do similar things with apt.)

Apt also makes good use of it with the apt.conf.d and sources.list.d directories. Notably, apt will look for the files apt.conf and sources.list and check for the directories only if the files do not exist, so if you prefer to have everything in one file, you can.

I have not looked into the grub2 configuration much as the Debian install of it just worked for me. I just looked and (noting that it may be different on other distros) it appears to be made out of a single config file /boot/grub/grub.cfg which is built by running the shell scripts in /etc/grub.d/ in order, which seems like a pretty sane way to handle things, especially as it includes an example file which just dumps its contents into that place in the config file (which is empty by default) for adding your own directives. If you really wanted to, you could just replace that with a single file pretty easily.

Reply Parent Score: 1

phoenix Member since:
2005-07-11

Some things, it makes sense to split into separate files. Like Apache virtual hosts. But does everything else under /etc/apache2 have to be in separate files? Really?

Same with all the apt.sources.d directories. Is it really easier to manage all those files, then just firing up a text editor and adding/removing a simple # in the first column?

What's even worse, though, is when using separate config files actually breaks features ... like the mess that is logrotate (at least in Debian/Ubuntu). /etc/logrotate.conf is supposed to be the global config file that all the other files under /etc/logrotate.d/ pick up ... yet it doesn't actually work that way, and you still have to duplicate all your monthly/compress options in all the files. Which means you now have to edit dozens of files to change the rotation policy ... instead of just one.

There's a time and a place to separate config files and use includes. Grub configuration is not one of them.

Reply Parent Score: 2

darknexus Member since:
2008-07-15

Why do all Linux developers have a hard-on for spreading config options into dozens of different files, in multiple sub-directories? What is wrong with a single, simple config file?


Simple answer: automation. Most Linux systems these days focus on automation and scripting with GUI frontends. Separate files are much easier to deal with in automation and scripting tasks at least if done well.
That being said, there's a place for this and I don't believe the entire grub configuration is the best place for it. I could see splitting out each section, i.e. default config parameters and then each os entry being separate files, but the way they do it now is just overkill especially when it flies apart as it too often does.

Reply Parent Score: 2