systemd.syntax — General syntax of systemd configuration files
This page describes the basic principles of configuration files used by systemd(1) and related programs for:
systemd unit files, see systemd.unit(5), systemd.service(5), systemd.socket(5), systemd.device(5), systemd.mount(5), systemd.automount(5), systemd.swap(5), systemd.target(5), systemd.path(5), systemd.timer(5), systemd.slice(5), systemd.scope(5)
The syntax is inspired by
XDG Desktop Entry Specification
.desktop files, which are in turn inspired by Microsoft Windows
Each file is a plain text file divided into sections, with configuration entries in the
Empty lines and lines starting with "
#" or "
ignored, which may be used for commenting.
Lines ending in a backslash are concatenated with the following line while reading and the backslash is replaced by a space character. This may be used to wrap long lines. The limit on line length is very large (currently 1 MB), but it is recommended to avoid such long lines and use multiple directives, variable substitution, or other mechanism as appropriate for the given file type.
[Section A] KeyOne=value 1 KeyTwo=value 2 # a comment [Section B] Setting="something" "some thing" "…" KeyTwo=value 2 \ value 2 continued
Various settings are allowed to be specified more than once, in which case the
interpretation depends on the setting. Often, multiple settings form a list, and setting to an
empty value "resets", which means that previous assignments are ignored. When this is allowed,
it is mentioned in the description of the setting. Note that using multiple assignments to the
same value makes the file incompatible with parsers for the XDG