Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a more robust example of how config files are parsed. #126

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions specs/configuration_files_specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,18 @@ Drop-ins are sorted in the lexicographic order using the file name without the p
regardless of the hierarchy under which they are stored.
The drop-ins that are later in this order have higher precedence.

For example, in addition to parsing `/etc/foo/bar.conf`,
`/etc/foo/bar.conf.d/a.conf` and `/usr/lib/foo/bar.conf.d/b.conf` must also be parsed,
in this order.
The configuration in `bar.conf` has the lowest priority,
and is overridden by `a.conf` and `b.conf`.
`b.conf` has the highest priority.
Considering the following files are present on the filesystem, this would be the order in which the
files are parsed. Note, that files with the same name override each other. The configuration in
`bar.conf` has the lowest priority, and is overridden by `a.conf` and `b.conf`.`b.conf` has the
highest priority.

```
/usr/lib/foo/bar.conf
/etc/foo/bar.conf (overrides /usr/lib/foo/bar.conf)
/usr/lib/foo/bar.conf.d/a.conf
/etc/foo/bar.conf.d/a.conf (/usr/lib/foo/bar.conf.d/a.conf)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"overrides" in the parentheses, just like above, would be a bit nicer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, i just missed that

/usr/lib/foo/bar.conf.d/b.conf
```

If a config file is masked, drop-ins must still be parsed, unless they are masked
themselves.
Expand Down
Loading