Skip to content

Commit

Permalink
Add a more robust example of how config files are parsed.
Browse files Browse the repository at this point in the history
configuration_files_specification.md: show how configs are evaluated
from different drop-in dirs in combination with colliding names and
also having separate config files.

Signed-off-by: Ina Panova <[email protected]>
  • Loading branch information
ipanova authored and keszybz committed Oct 25, 2024
1 parent 2d7f554 commit ff86292
Showing 1 changed file with 12 additions and 6 deletions.
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)
/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

0 comments on commit ff86292

Please sign in to comment.