You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Without modifying the original configuration file, we can drop in a directory /etc/systemd/network/wlan0.network.d/ with additional configuration files, such as new-address.network:
[Network]
Address=REDACTED IP/24
These drop in configuration files are merged with the original configuration. Note that a drop-in directory can contain multiple configuration files, which are processed in alphabetical order. The drop-in directory can also reside in a different place: see the documentation for details.
Proposal
Add support for drop-in configuration as an extension to the systemd configuration parser, or as a new parser.
Open problems:
It is a bit unclear how values are merged exactly. Some sections and keys are allowed to occur multiple times, in which case the additional configuration extends the original, whereas other sections / keys only occur once. When keys occur only once, does the drop-in file overwrite the original value?
Answer, from the doc: Yes. When multiple files specify the same option, for options which accept just a single value, the entry in the file sorted last takes precedence, and for options which accept a list of values, entries are collected as they occur in the sorted files.
This would imply that the parser needs to know which keys / sections are singletons, and which ones can occur multiple times.
Additionally, some keys can be cleared by assigning it an empty string:
Address=
The text was updated successfully, but these errors were encountered:
Introduction
systemd
supports "drop-in" configuration directories (see https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html)Suppose we have the following network configuration file in
/etc/systemd/network/wlan0.network
Without modifying the original configuration file, we can drop in a directory
/etc/systemd/network/wlan0.network.d/
with additional configuration files, such asnew-address.network
:These drop in configuration files are merged with the original configuration. Note that a drop-in directory can contain multiple configuration files, which are processed in alphabetical order. The drop-in directory can also reside in a different place: see the documentation for details.
Proposal
Add support for drop-in configuration as an extension to the systemd configuration parser, or as a new parser.
Open problems:
Answer, from the doc: Yes. When multiple files specify the same option, for options which accept just a single value, the entry in the file sorted last takes precedence, and for options which accept a list of values, entries are collected as they occur in the sorted files.
This would imply that the parser needs to know which keys / sections are singletons, and which ones can occur multiple times.
Additionally, some keys can be cleared by assigning it an empty string:
The text was updated successfully, but these errors were encountered: