]>
Commit | Line | Data |
---|---|---|
514094f9 | 1 | <?xml version='1.0'?> |
0f943ae4 ZJS |
2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ | |
4 | <!ENTITY % entities SYSTEM "custom-entities.ent" > | |
5 | %entities; | |
6 | ]> | |
7 | ||
8 | <!-- SPDX-License-Identifier: LGPL-2.1+ --> | |
9 | ||
10 | <refentry id="systemd.syntax"> | |
11 | ||
12 | <refentryinfo> | |
13 | <title>systemd.syntax</title> | |
14 | <productname>systemd</productname> | |
0f943ae4 ZJS |
15 | </refentryinfo> |
16 | ||
17 | <refmeta> | |
18 | <refentrytitle>systemd.syntax</refentrytitle> | |
19 | <manvolnum>7</manvolnum> | |
20 | </refmeta> | |
21 | ||
22 | <refnamediv> | |
23 | <refname>systemd.syntax</refname> | |
24 | <refpurpose>General syntax of systemd configuration files</refpurpose> | |
25 | </refnamediv> | |
26 | ||
27 | <refsect1> | |
28 | <title>Introduction</title> | |
29 | ||
30 | <para>This page describes the basic principles of configuration files used by | |
31 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
32 | and related programs for: | |
33 | <itemizedlist> | |
34 | <listitem><para>systemd unit files, see | |
35 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
36 | <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
37 | <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
38 | <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
39 | <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
40 | <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
41 | <citerefentry><refentrytitle>systemd.swap</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
42 | <citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
43 | <citerefentry><refentrytitle>systemd.path</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
44 | <citerefentry><refentrytitle>systemd.timer</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
45 | <citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
46 | <citerefentry><refentrytitle>systemd.scope</refentrytitle><manvolnum>5</manvolnum></citerefentry></para></listitem> | |
47 | ||
48 | <listitem><para>daemon config files, see | |
49 | <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
50 | <citerefentry><refentrytitle>systemd-user.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
51 | <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
52 | <citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
53 | <citerefentry><refentrytitle>journal-remote.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
54 | <citerefentry><refentrytitle>journal-upload.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
55 | <citerefentry><refentrytitle>systemd-sleep.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
56 | <citerefentry><refentrytitle>timesyncd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
57 | </para></listitem> | |
58 | </itemizedlist> | |
59 | </para> | |
60 | ||
61 | <para>The syntax is inspired by | |
62 | <ulink url="http://standards.freedesktop.org/desktop-entry-spec/latest/">XDG Desktop Entry Specification</ulink> | |
63 | <filename>.desktop</filename> files, which are in turn inspired by Microsoft Windows | |
64 | <filename>.ini</filename> files. | |
65 | </para> | |
66 | ||
67 | <para>Each file is a plain text file divided into sections, with configuration entries in the | |
68 | style <replaceable>key</replaceable>=<replaceable>value</replaceable>. | |
69 | Empty lines and lines starting with <literal>#</literal> or <literal>;</literal> are | |
70 | ignored, which may be used for commenting.</para> | |
71 | ||
72 | <para>Lines ending in a backslash are concatenated with the following line while reading and the | |
73 | backslash is replaced by a space character. This may be used to wrap long lines. The limit on | |
74 | line length is very large (currently 1 MB), but it is recommended to avoid such long lines and | |
75 | use multiple directives, variable substitution, or other mechanism as appropriate for the given | |
76 | file type.</para> | |
77 | ||
78 | <example><programlisting>[Section A] | |
79 | KeyOne=value 1 | |
80 | KeyTwo=value 2 | |
81 | ||
82 | # a comment | |
83 | ||
84 | [Section B] | |
85 | Setting="something" "some thing" "…" | |
86 | KeyTwo=value 2 \ | |
87 | value 2 continued | |
88 | </programlisting></example> | |
89 | ||
90 | <para>Various settings are allowed to be specified more than once, in which case the | |
91 | interpretation depends on the setting. Often, multiple settings form a list, and setting to an | |
92 | empty value "resets", which means that previous assignments are ignored. When this is allowed, | |
93 | it is mentioned in the description of the setting. Note that using multiple assignments to the | |
94 | same value makes the file incompatible with parsers for the XDG <filename>.desktop</filename> | |
95 | file format.</para> | |
96 | </refsect1> | |
97 | ||
98 | </refentry> |