Debian Codegraph @

upstream/debian-unstable/man7/systemd.syntax.7

raw
1 '\" t
2 .TH "SYSTEMD\&.SYNTAX" "7" "" "systemd 261~rc3" "systemd.syntax"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 systemd.syntax \- General syntax of systemd configuration files
24 .SH "INTRODUCTION"
25 .PP
26 This page describes the basic principles of configuration files used by
27 \fBsystemd\fR(1)
28 and related programs for:
29 .sp
30 .RS 4
31 .ie n \{\
32 \h'-04'\(bu\h'+03'\c
33 .\}
34 .el \{\
35 .sp -1
36 .IP \(bu 2.3
37 .\}
38 systemd unit files, see
39 \fBsystemd.unit\fR(5),
40 \fBsystemd.service\fR(5),
41 \fBsystemd.socket\fR(5),
42 \fBsystemd.device\fR(5),
43 \fBsystemd.mount\fR(5),
44 \fBsystemd.automount\fR(5),
45 \fBsystemd.swap\fR(5),
46 \fBsystemd.target\fR(5),
47 \fBsystemd.path\fR(5),
48 \fBsystemd.timer\fR(5),
49 \fBsystemd.slice\fR(5),
50 \fBsystemd.scope\fR(5)
51 .RE
52 .sp
53 .RS 4
54 .ie n \{\
55 \h'-04'\(bu\h'+03'\c
56 .\}
57 .el \{\
58 .sp -1
59 .IP \(bu 2.3
60 .\}
61 link files, see
62 \fBsystemd.link\fR(5)
63 .RE
64 .sp
65 .RS 4
66 .ie n \{\
67 \h'-04'\(bu\h'+03'\c
68 .\}
69 .el \{\
70 .sp -1
71 .IP \(bu 2.3
72 .\}
73 netdev and network files, see
74 \fBsystemd.netdev\fR(5),
75 \fBsystemd.network\fR(5)
76 .RE
77 .sp
78 .RS 4
79 .ie n \{\
80 \h'-04'\(bu\h'+03'\c
81 .\}
82 .el \{\
83 .sp -1
84 .IP \(bu 2.3
85 .\}
86 daemon config files, see
87 \fBsystemd-system.conf\fR(5),
88 \fBsystemd-user.conf\fR(5),
89 \fBlogind.conf\fR(5),
90 \fBjournald.conf\fR(5),
91 \fBjournal-remote.conf\fR(5),
92 \fBjournal-upload.conf\fR(5),
93 \fBsystemd-sleep.conf\fR(5),
94 \fBtimesyncd.conf\fR(5)
95 .RE
96 .sp
97 .RS 4
98 .ie n \{\
99 \h'-04'\(bu\h'+03'\c
100 .\}
101 .el \{\
102 .sp -1
103 .IP \(bu 2.3
104 .\}
105 nspawn files, see
106 \fBsystemd.nspawn\fR(5)
107 .RE
108 .PP
109 The syntax is inspired by
110 \m[blue]\fBXDG Desktop Entry Specification\fR\m[]\&\s-2\u[1]\d\s+2
111 \&.desktop
112 files, which are in turn inspired by Microsoft Windows
113 \&.ini
114 files\&.
115 .PP
116 Each file is a plain text file divided into sections, with configuration entries in the style
117 \fIkey\fR=\fIvalue\fR\&. Whitespace immediately before or after the
118 "="
119 is ignored\&. Empty lines and lines starting with
120 "#"
121 or
122 ";"
123 are ignored, which may be used for commenting\&.
124 .PP
125 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\&. When a comment line or lines follow a line ending with a backslash, the comment block is ignored, so the continued line is concatenated with whatever follows the comment block\&.
126 .sp
127 .if n \{\
128 .RS 4
129 .\}
130 .nf
131 [Section A]
132 KeyOne=value 1
133 KeyTwo=value 2
134
135 # a comment
136
137 [Section B]
138 Setting="something" "some thing" "\&..."
139 KeyTwo=value 2 \e
140 value 2 continued
141
142 [Section C]
143 KeyThree=value 3\e
144 # this line is ignored
145 ; this line is ignored too
146 value 3 continued
147 .fi
148 .if n \{\
149 .RE
150 .\}
151 .PP
152 Boolean arguments used in configuration files can be written in various formats\&. For positive settings the strings
153 \fB1\fR,
154 \fByes\fR,
155 \fBtrue\fR
156 and
157 \fBon\fR
158 are equivalent\&. For negative settings, the strings
159 \fB0\fR,
160 \fBno\fR,
161 \fBfalse\fR
162 and
163 \fBoff\fR
164 are equivalent\&.
165 .PP
166 Time span values encoded in configuration files can be written in various formats\&. A stand\-alone number specifies a time in seconds\&. If suffixed with a time unit, the unit is honored\&. A concatenation of multiple values with units is supported, in which case the values are added up\&. Example:
167 "50"
168 refers to 50 seconds;
169 "2min\ \&200ms"
170 refers to 2 minutes and 200 milliseconds, i\&.e\&. 120200\ \&ms\&. The following time units are understood:
171 "s",
172 "min",
173 "h",
174 "d",
175 "w",
176 "ms",
177 "us"\&. For details see
178 \fBsystemd.time\fR(7)\&.
179 .PP
180 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
181 \&.desktop
182 file format\&.
183 .SH "QUOTING"
184 .PP
185 For settings where quoting is allowed, the following general rules apply: double quotes ("\&...") and single quotes (\*(Aq\&...\*(Aq) may be used to wrap a whole item (the opening quote may appear only at the beginning or after whitespace that is not quoted, and the closing quote must be followed by whitespace or the end of line), in which case everything until the next matching quote becomes part of the same item\&. Quotes themselves are removed\&. C\-style escapes are supported\&. The table below contains the list of known escape patterns\&. Only escape patterns which match the syntax in the table are allowed; other patterns may be added in the future and unknown patterns will result in a warning\&. In particular, any backslashes should be doubled\&. Finally, a trailing backslash ("\e") may be used to merge lines, as described above\&. UTF\-8 is accepted, and hence typical unicode characters do not need to be escaped\&.
186 .sp
187 .it 1 an-trap
188 .nr an-no-space-flag 1
189 .nr an-break-flag 1
190 .br
191 .B Table\ \&1.\ \&Supported escapes
192 .TS
193 allbox tab(:);
194 lB lB.
195 T{
196 Literal
197 T}:T{
198 Actual value
199 T}
200 .T&
201 l l
202 l l
203 l l
204 l l
205 l l
206 l l
207 l l
208 l l
209 l l
210 l l
211 l l
212 l l
213 l l
214 l l
215 l l.
216 T{
217 "\ea"
218 T}:T{
219 bell
220 T}
221 T{
222 "\eb"
223 T}:T{
224 backspace
225 T}
226 T{
227 "\ef"
228 T}:T{
229 form feed
230 T}
231 T{
232 "\en"
233 T}:T{
234 newline
235 T}
236 T{
237 "\er"
238 T}:T{
239 carriage return
240 T}
241 T{
242 "\et"
243 T}:T{
244 tab
245 T}
246 T{
247 "\ev"
248 T}:T{
249 vertical tab
250 T}
251 T{
252 "\e\e"
253 T}:T{
254 backslash
255 T}
256 T{
257 "\e""
258 T}:T{
259 double quotation mark
260 T}
261 T{
262 "\e\*(Aq"
263 T}:T{
264 single quotation mark
265 T}
266 T{
267 "\es"
268 T}:T{
269 space
270 T}
271 T{
272 "\ex\fIxx\fR"
273 T}:T{
274 character number \fIxx\fR in hexadecimal encoding
275 T}
276 T{
277 "\e\fInnn\fR"
278 T}:T{
279 character number \fInnn\fR in octal encoding
280 T}
281 T{
282 "\eu\fInnnn\fR"
283 T}:T{
284 unicode code point \fInnnn\fR in hexadecimal encoding
285 T}
286 T{
287 "\eU\fInnnnnnnn\fR"
288 T}:T{
289 unicode code point \fInnnnnnnn\fR in hexadecimal encoding
290 T}
291 .TE
292 .sp 1
293 .SH "SEE ALSO"
294 .PP
295 \fBsystemd\fR(1), \fBsystemd.time\fR(7)
296 .SH "NOTES"
297 .IP " 1." 4
298 XDG Desktop Entry Specification
299 .RS 4
300 \%https://standards.freedesktop.org/desktop-entry-spec/latest/
301 .RE