102-400 · Question #104
The X11 configuration file xorg.conf is grouped into sections. How is the content of the section SectionName associated with that section?
The correct answer is B. It is placed between a line containing Section "SectionName" and a line containing EndSection. See the full explanation below for the reasoning.
Question
Options
- AIt is placed in curly brackets as in Section SectionName { ... }.
- BIt is placed between a line containing Section "SectionName" and a line containing EndSection.
- CIt is placed between the tags <Section name="SectionName"> and </Section>
- DIt is placed after the row [SectionName].
- EIt is placed after an initial unindented Section "SectionName" and must be indented by exactly
How the community answered
(26 responses)- A4% (1)
- B81% (21)
- C12% (3)
- D4% (1)
Community Discussion
4B is your answer, no question about it. The xorg.conf file uses a plain text block structure where you open with Section "SectionName" on its own line and close with EndSection, and everything in between belongs to that section. That is just how X11 has always done it, going back decades, and the LPIC-1 exam absolutely tests whether you know that syntax cold. The other options are traps borrowing syntax from other config formats, curly braces are more of a thing you see in stuff like nginx or older C-style configs, the angle bracket tags are XML, and the square bracket format is INI-style like you find in smb.conf or systemd unit files, none of which are xorg.conf.
B is the one. If you actually open /etc/X11/xorg.conf on a system that still uses it, you will see lines like Section "Monitor" followed by all the options, then EndSection closing it out, no brackets, no XML, no INI-style headers. The man page, xorg.conf(5), lays this out clearly in the FILE FORMAT section, and it is consistent across every section type: Device, Screen, InputDevice, ServerLayout, all of them follow that same pattern. The parser is line-oriented and just looks for those two keywords as delimiters, which is why indentation does not matter at all and you can technically write the whole file flat. Quick question for you though: given that the Section/EndSection block can contain Option lines with arbitrary key-value pairs, what happens when the same option appears more than once inside a single section, does the last one win, the first one, or does the server throw a parse error?
I keep going back to A on this one. The curly bracket syntax just makes the most sense structurally, and I swear I have seen config file formats like this all over Linux tooling, where you define a block with the section name and wrap the contents in braces. It feels consistent with how a lot of other system config files work, and when I was labbing this out I could picture the xorg.conf laid out that way visually. If you think about how clean and unambiguous the curly bracket approach is for a parser to read, it makes total sense that X11 would go that route rather than some start/end tag system.
Lena, xorg.conf actually uses the Section/EndSection keyword block format, so B is correct here. The curly brace style feels intuitive but X11 went with explicit named tags like "Section Screen" and "EndSection" to open and close each block.