]> git.proxmox.com Git - systemd.git/blob - man/systemd.unit.5
Imported Upstream version 217
[systemd.git] / man / systemd.unit.5
1 '\" t
2 .TH "SYSTEMD\&.UNIT" "5" "" "systemd 217" "systemd.unit"
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.unit \- Unit configuration
24 .SH "SYNOPSIS"
25 .PP
26 \fIservice\fR\&.service,
27 \fIsocket\fR\&.socket,
28 \fIdevice\fR\&.device,
29 \fImount\fR\&.mount,
30 \fIautomount\fR\&.automount,
31 \fIswap\fR\&.swap,
32 \fItarget\fR\&.target,
33 \fIpath\fR\&.path,
34 \fItimer\fR\&.timer,
35 \fIsnapshot\fR\&.snapshot,
36 \fIslice\fR\&.slice,
37 \fIscope\fR\&.scope
38 .PP
39 .nf
40 /etc/systemd/system/*
41 /run/systemd/system/*
42 /usr/lib/systemd/system/*
43 \&.\&.\&.
44
45 .fi
46 .PP
47 .nf
48 $XDG_CONFIG_HOME/systemd/user/*
49 $HOME/\&.config/systemd/user/*
50 /etc/systemd/user/*
51 $XDG_RUNTIME_DIR/systemd/user/*
52 /run/systemd/user/*
53 $XDG_DATA_HOME/systemd/user/*
54 $HOME/\&.local/share/systemd/user/*
55 /usr/lib/systemd/user/*
56 \&.\&.\&.
57
58 .fi
59 .SH "DESCRIPTION"
60 .PP
61 A unit configuration file encodes information about a service, a socket, a device, a mount point, an automount point, a swap file or partition, a start\-up target, a watched file system path, a timer controlled and supervised by
62 \fBsystemd\fR(1), a temporary system state snapshot, a resource management slice or a group of externally created processes\&. The syntax is inspired by
63 \m[blue]\fBXDG Desktop Entry Specification\fR\m[]\&\s-2\u[1]\d\s+2\&.desktop
64 files, which are in turn inspired by Microsoft Windows
65 \&.ini
66 files\&.
67 .PP
68 This man page lists the common configuration options of all the unit types\&. These options need to be configured in the [Unit] or [Install] sections of the unit files\&.
69 .PP
70 In addition to the generic [Unit] and [Install] sections described here, each unit may have a type\-specific section, e\&.g\&. [Service] for a service unit\&. See the respective man pages for more information:
71 \fBsystemd.service\fR(5),
72 \fBsystemd.socket\fR(5),
73 \fBsystemd.device\fR(5),
74 \fBsystemd.mount\fR(5),
75 \fBsystemd.automount\fR(5),
76 \fBsystemd.swap\fR(5),
77 \fBsystemd.target\fR(5),
78 \fBsystemd.path\fR(5),
79 \fBsystemd.timer\fR(5),
80 \fBsystemd.snapshot\fR(5)\&.
81 \fBsystemd.slice\fR(5)\&.
82 \fBsystemd.scope\fR(5)\&.
83 .PP
84 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 unit file incompatible with parsers for the XDG
85 \&.desktop
86 file format\&.
87 .PP
88 Unit files are loaded from a set of paths determined during compilation, described in the next section\&.
89 .PP
90 Unit files may contain additional options on top of those listed here\&. If systemd encounters an unknown option, it will write a warning log message but continue loading the unit\&. If an option or section name is prefixed with
91 \fBX\-\fR, it is ignored completely by systemd\&. Options within an ignored section do not need the prefix\&. Applications may use this to include additional information in the unit files\&.
92 .PP
93 Boolean arguments used in unit files can be written in various formats\&. For positive settings the strings
94 \fB1\fR,
95 \fByes\fR,
96 \fBtrue\fR
97 and
98 \fBon\fR
99 are equivalent\&. For negative settings, the strings
100 \fB0\fR,
101 \fBno\fR,
102 \fBfalse\fR
103 and
104 \fBoff\fR
105 are equivalent\&.
106 .PP
107 Time span values encoded in unit 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: "50" refers to 50 seconds; "2min 200ms" refers to 2 minutes plus 200 milliseconds, i\&.e\&. 120200ms\&. The following time units are understood: s, min, h, d, w, ms, us\&. For details see
108 \fBsystemd.time\fR(7)\&.
109 .PP
110 Empty lines and lines starting with # or ; are ignored\&. This 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\&.
111 .PP
112 Along with a unit file
113 foo\&.service, the directory
114 foo\&.service\&.wants/
115 may exist\&. All unit files symlinked from such a directory are implicitly added as dependencies of type
116 \fIWants=\fR
117 to the unit\&. This is useful to hook units into the start\-up of other units, without having to modify their unit files\&. For details about the semantics of
118 \fIWants=\fR, see below\&. The preferred way to create symlinks in the
119 \&.wants/
120 directory of a unit file is with the
121 \fBenable\fR
122 command of the
123 \fBsystemctl\fR(1)
124 tool which reads information from the [Install] section of unit files (see below)\&. A similar functionality exists for
125 \fIRequires=\fR
126 type dependencies as well, the directory suffix is
127 \&.requires/
128 in this case\&.
129 .PP
130 Along with a unit file
131 foo\&.service, a directory
132 foo\&.service\&.d/
133 may exist\&. All files with the suffix
134 "\&.conf"
135 from this directory will be parsed after the file itself is parsed\&. This is useful to alter or add configuration settings to a unit, without having to modify their unit files\&. Make sure that the file that is included has the appropriate section headers before any directive\&. Note that for instanced units this logic will first look for the instance
136 "\&.d/"
137 subdirectory and read its
138 "\&.conf"
139 files, followed by the template
140 "\&.d/"
141 subdirectory and reads its
142 "\&.conf"
143 files\&.
144 .PP
145 Note that while systemd offers a flexible dependency system between units it is recommended to use this functionality only sparingly and instead rely on techniques such as bus\-based or socket\-based activation which make dependencies implicit, resulting in a both simpler and more flexible system\&.
146 .PP
147 Some unit names reflect paths existing in the file system namespace\&. Example: a device unit
148 dev\-sda\&.device
149 refers to a device with the device node
150 /dev/sda
151 in the file system namespace\&. If this applies, a special way to escape the path name is used, so that the result is usable as part of a filename\&. Basically, given a path, "/" is replaced by "\-", and all unprintable characters and the "\-" are replaced by C\-style "\ex2d" escapes\&. The root directory "/" is encoded as single dash, while otherwise the initial and ending "/" is removed from all paths during transformation\&. This escaping is reversible\&.
152 .PP
153 Optionally, units may be instantiated from a template file at runtime\&. This allows creation of multiple units from a single configuration file\&. If systemd looks for a unit configuration file, it will first search for the literal unit name in the file system\&. If that yields no success and the unit name contains an
154 "@"
155 character, systemd will look for a unit template that shares the same name but with the instance string (i\&.e\&. the part between the
156 "@"
157 character and the suffix) removed\&. Example: if a service
158 getty@tty3\&.service
159 is requested and no file by that name is found, systemd will look for
160 getty@\&.service
161 and instantiate a service from that configuration file if it is found\&.
162 .PP
163 To refer to the instance string from within the configuration file you may use the special
164 "%i"
165 specifier in many of the configuration options\&. See below for details\&.
166 .PP
167 If a unit file is empty (i\&.e\&. has the file size 0) or is symlinked to
168 /dev/null, its configuration will not be loaded and it appears with a load state of
169 "masked", and cannot be activated\&. Use this as an effective way to fully disable a unit, making it impossible to start it even manually\&.
170 .PP
171 The unit file format is covered by the
172 \m[blue]\fBInterface Stability Promise\fR\m[]\&\s-2\u[2]\d\s+2\&.
173 .SH "UNIT LOAD PATH"
174 .PP
175 Unit files are loaded from a set of paths determined during compilation, described in the two tables below\&. Unit files found in directories listed earlier override files with the same name in directories lower in the list\&.
176 .PP
177 When systemd is running in user mode (\fB\-\-user\fR) and the variable
178 \fI$SYSTEMD_UNIT_PATH\fR
179 is set, this contents of this variable overrides the unit load path\&. If
180 \fI$SYSTEMD_UNIT_PATH\fR
181 ends with an empty component (":"), the usual unit load path will be appended to the contents of the variable\&.
182 .sp
183 .it 1 an-trap
184 .nr an-no-space-flag 1
185 .nr an-break-flag 1
186 .br
187 .B Table\ \&1.\ \& Load path when running in system mode (\-\-system).
188 .TS
189 allbox tab(:);
190 lB lB.
191 T{
192 Path
193 T}:T{
194 Description
195 T}
196 .T&
197 l l
198 l l
199 l l.
200 T{
201 /etc/systemd/system
202 T}:T{
203 Local configuration
204 T}
205 T{
206 /run/systemd/system
207 T}:T{
208 Runtime units
209 T}
210 T{
211 /usr/lib/systemd/system
212 T}:T{
213 Units of installed packages
214 T}
215 .TE
216 .sp 1
217 .sp
218 .it 1 an-trap
219 .nr an-no-space-flag 1
220 .nr an-break-flag 1
221 .br
222 .B Table\ \&2.\ \& Load path when running in user mode (\-\-user).
223 .TS
224 allbox tab(:);
225 lB lB.
226 T{
227 Path
228 T}:T{
229 Description
230 T}
231 .T&
232 l l
233 l l
234 l l
235 l l
236 l l
237 l l
238 l l
239 l l.
240 T{
241 $XDG_CONFIG_HOME/systemd/user
242 T}:T{
243 User configuration (only used when $XDG_CONFIG_HOME is set)
244 T}
245 T{
246 $HOME/\&.config/systemd/user
247 T}:T{
248 User configuration (only used when $XDG_CONFIG_HOME is not set)
249 T}
250 T{
251 /etc/systemd/user
252 T}:T{
253 Local configuration
254 T}
255 T{
256 $XDG_RUNTIME_DIR/systemd/user
257 T}:T{
258 Runtime units (only used when $XDG_RUNTIME_DIR is set)
259 T}
260 T{
261 /run/systemd/user
262 T}:T{
263 Runtime units
264 T}
265 T{
266 $XDG_DATA_HOME/systemd/user
267 T}:T{
268 Units of packages that have been installed in the home directory (only used when $XDG_DATA_HOME is set)
269 T}
270 T{
271 $HOME/\&.local/share/systemd/user
272 T}:T{
273 Units of packages that have been installed in the home directory (only used when $XDG_DATA_HOME is not set)
274 T}
275 T{
276 /usr/lib/systemd/user
277 T}:T{
278 Units of packages that have been installed system\-wide
279 T}
280 .TE
281 .sp 1
282 .PP
283 Additional units might be loaded into systemd ("linked") from directories not on the unit load path\&. See the
284 \fBlink\fR
285 command for
286 \fBsystemctl\fR(1)\&. Also, some units are dynamically created via generators
287 \m[blue]\fBGenerators\fR\m[]\&\s-2\u[3]\d\s+2\&.
288 .SH "[UNIT] SECTION OPTIONS"
289 .PP
290 Unit file may include a [Unit] section, which carries generic information about the unit that is not dependent on the type of unit:
291 .PP
292 \fIDescription=\fR
293 .RS 4
294 A free\-form string describing the unit\&. This is intended for use in UIs to show descriptive information along with the unit name\&. The description should contain a name that means something to the end user\&.
295 "Apache2 Web Server"
296 is a good example\&. Bad examples are
297 "high\-performance light\-weight HTTP server"
298 (too generic) or
299 "Apache2"
300 (too specific and meaningless for people who do not know Apache)\&.
301 .RE
302 .PP
303 \fIDocumentation=\fR
304 .RS 4
305 A space\-separated list of URIs referencing documentation for this unit or its configuration\&. Accepted are only URIs of the types
306 "http://",
307 "https://",
308 "file:",
309 "info:",
310 "man:"\&. For more information about the syntax of these URIs, see
311 \fBuri\fR(7)\&. The URIs should be listed in order of relevance, starting with the most relevant\&. It is a good idea to first reference documentation that explains what the unit\*(Aqs purpose is, followed by how it is configured, followed by any other related documentation\&. This option may be specified more than once, in which case the specified list of URIs is merged\&. If the empty string is assigned to this option, the list is reset and all prior assignments will have no effect\&.
312 .RE
313 .PP
314 \fIRequires=\fR
315 .RS 4
316 Configures requirement dependencies on other units\&. If this unit gets activated, the units listed here will be activated as well\&. If one of the other units gets deactivated or its activation fails, this unit will be deactivated\&. This option may be specified more than once or multiple space\-separated units may be specified in one option in which case requirement dependencies for all listed names will be created\&. Note that requirement dependencies do not influence the order in which services are started or stopped\&. This has to be configured independently with the
317 \fIAfter=\fR
318 or
319 \fIBefore=\fR
320 options\&. If a unit
321 foo\&.service
322 requires a unit
323 bar\&.service
324 as configured with
325 \fIRequires=\fR
326 and no ordering is configured with
327 \fIAfter=\fR
328 or
329 \fIBefore=\fR, then both units will be started simultaneously and without any delay between them if
330 foo\&.service
331 is activated\&. Often it is a better choice to use
332 \fIWants=\fR
333 instead of
334 \fIRequires=\fR
335 in order to achieve a system that is more robust when dealing with failing services\&.
336 .sp
337 Note that dependencies of this type may also be configured outside of the unit configuration file by adding a symlink to a
338 \&.requires/
339 directory accompanying the unit file\&. For details see above\&.
340 .RE
341 .PP
342 \fIRequiresOverridable=\fR
343 .RS 4
344 Similar to
345 \fIRequires=\fR\&. Dependencies listed in
346 \fIRequiresOverridable=\fR
347 which cannot be fulfilled or fail to start are ignored if the startup was explicitly requested by the user\&. If the start\-up was pulled in indirectly by some dependency or automatic start\-up of units that is not requested by the user, this dependency must be fulfilled and otherwise the transaction fails\&. Hence, this option may be used to configure dependencies that are normally honored unless the user explicitly starts up the unit, in which case whether they failed or not is irrelevant\&.
348 .RE
349 .PP
350 \fIRequisite=\fR, \fIRequisiteOverridable=\fR
351 .RS 4
352 Similar to
353 \fIRequires=\fR
354 and
355 \fIRequiresOverridable=\fR, respectively\&. However, if the units listed here are not started already, they will not be started and the transaction will fail immediately\&.
356 .RE
357 .PP
358 \fIWants=\fR
359 .RS 4
360 A weaker version of
361 \fIRequires=\fR\&. Units listed in this option will be started if the configuring unit is\&. However, if the listed units fail to start or cannot be added to the transaction, this has no impact on the validity of the transaction as a whole\&. This is the recommended way to hook start\-up of one unit to the start\-up of another unit\&.
362 .sp
363 Note that dependencies of this type may also be configured outside of the unit configuration file by adding symlinks to a
364 \&.wants/
365 directory accompanying the unit file\&. For details, see above\&.
366 .RE
367 .PP
368 \fIBindsTo=\fR
369 .RS 4
370 Configures requirement dependencies, very similar in style to
371 \fIRequires=\fR, however in addition to this behavior, it also declares that this unit is stopped when any of the units listed suddenly disappears\&. Units can suddenly, unexpectedly disappear if a service terminates on its own choice, a device is unplugged or a mount point unmounted without involvement of systemd\&.
372 .RE
373 .PP
374 \fIPartOf=\fR
375 .RS 4
376 Configures dependencies similar to
377 \fIRequires=\fR, but limited to stopping and restarting of units\&. When systemd stops or restarts the units listed here, the action is propagated to this unit\&. Note that this is a one\-way dependency\ \&\(em changes to this unit do not affect the listed units\&.
378 .RE
379 .PP
380 \fIConflicts=\fR
381 .RS 4
382 A space\-separated list of unit names\&. Configures negative requirement dependencies\&. If a unit has a
383 \fIConflicts=\fR
384 setting on another unit, starting the former will stop the latter and vice versa\&. Note that this setting is independent of and orthogonal to the
385 \fIAfter=\fR
386 and
387 \fIBefore=\fR
388 ordering dependencies\&.
389 .sp
390 If a unit A that conflicts with a unit B is scheduled to be started at the same time as B, the transaction will either fail (in case both are required part of the transaction) or be modified to be fixed (in case one or both jobs are not a required part of the transaction)\&. In the latter case, the job that is not the required will be removed, or in case both are not required, the unit that conflicts will be started and the unit that is conflicted is stopped\&.
391 .RE
392 .PP
393 \fIBefore=\fR, \fIAfter=\fR
394 .RS 4
395 A space\-separated list of unit names\&. Configures ordering dependencies between units\&. If a unit
396 foo\&.service
397 contains a setting
398 \fBBefore=bar\&.service\fR
399 and both units are being started,
400 bar\&.service\*(Aqs start\-up is delayed until
401 foo\&.service
402 is started up\&. Note that this setting is independent of and orthogonal to the requirement dependencies as configured by
403 \fIRequires=\fR\&. It is a common pattern to include a unit name in both the
404 \fIAfter=\fR
405 and
406 \fIRequires=\fR
407 option, in which case the unit listed will be started before the unit that is configured with these options\&. This option may be specified more than once, in which case ordering dependencies for all listed names are created\&.
408 \fIAfter=\fR
409 is the inverse of
410 \fIBefore=\fR, i\&.e\&. while
411 \fIAfter=\fR
412 ensures that the configured unit is started after the listed unit finished starting up,
413 \fIBefore=\fR
414 ensures the opposite, i\&.e\&. that the configured unit is fully started up before the listed unit is started\&. Note that when two units with an ordering dependency between them are shut down, the inverse of the start\-up order is applied\&. i\&.e\&. if a unit is configured with
415 \fIAfter=\fR
416 on another unit, the former is stopped before the latter if both are shut down\&. If one unit with an ordering dependency on another unit is shut down while the latter is started up, the shut down is ordered before the start\-up regardless of whether the ordering dependency is actually of type
417 \fIAfter=\fR
418 or
419 \fIBefore=\fR\&. If two units have no ordering dependencies between them, they are shut down or started up simultaneously, and no ordering takes place\&.
420 .RE
421 .PP
422 \fIOnFailure=\fR
423 .RS 4
424 A space\-separated list of one or more units that are activated when this unit enters the
425 "failed"
426 state\&.
427 .RE
428 .PP
429 \fIPropagatesReloadTo=\fR, \fIReloadPropagatedFrom=\fR
430 .RS 4
431 A space\-separated list of one or more units where reload requests on this unit will be propagated to, or reload requests on the other unit will be propagated to this unit, respectively\&. Issuing a reload request on a unit will automatically also enqueue a reload request on all units that the reload request shall be propagated to via these two settings\&.
432 .RE
433 .PP
434 \fIJoinsNamespaceOf=\fR
435 .RS 4
436 For units that start processes (such as service units), lists one or more other units whose network and/or temporary file namespace to join\&. This only applies to unit types which support the
437 \fIPrivateNetwork=\fR
438 and
439 \fIPrivateTmp=\fR
440 directives (see
441 \fBsystemd.exec\fR(5)
442 for details)\&. If a unit that has this setting set is started, its processes will see the same
443 /tmp,
444 /tmp/var
445 and network namespace as one listed unit that is started\&. If multiple listed units are already started, it is not defined which namespace is joined\&. Note that this setting only has an effect if
446 \fIPrivateNetwork=\fR
447 and/or
448 \fIPrivateTmp=\fR
449 is enabled for both the unit that joins the namespace and the unit whose namespace is joined\&.
450 .RE
451 .PP
452 \fIRequiresMountsFor=\fR
453 .RS 4
454 Takes a space\-separated list of absolute paths\&. Automatically adds dependencies of type
455 \fIRequires=\fR
456 and
457 \fIAfter=\fR
458 for all mount units required to access the specified path\&.
459 .sp
460 Mount points marked with
461 \fBnoauto\fR
462 are not mounted automatically and will be ignored for the purposes of this option\&. If such a mount should be a requirement for this unit, direct dependencies on the mount units may be added (\fIRequires=\fR
463 and
464 \fIAfter=\fR
465 or some other combination)\&.
466 .RE
467 .PP
468 \fIOnFailureJobMode=\fR
469 .RS 4
470 Takes a value of
471 "fail",
472 "replace",
473 "replace\-irreversibly",
474 "isolate",
475 "flush",
476 "ignore\-dependencies"
477 or
478 "ignore\-requirements"\&. Defaults to
479 "replace"\&. Specifies how the units listed in
480 \fIOnFailure=\fR
481 will be enqueued\&. See
482 \fBsystemctl\fR(1)\*(Aqs
483 \fB\-\-job\-mode=\fR
484 option for details on the possible values\&. If this is set to
485 "isolate", only a single unit may be listed in
486 \fIOnFailure=\fR\&.\&.
487 .RE
488 .PP
489 \fIIgnoreOnIsolate=\fR
490 .RS 4
491 Takes a boolean argument\&. If
492 \fBtrue\fR, this unit will not be stopped when isolating another unit\&. Defaults to
493 \fBfalse\fR\&.
494 .RE
495 .PP
496 \fIIgnoreOnSnapshot=\fR
497 .RS 4
498 Takes a boolean argument\&. If
499 \fBtrue\fR, this unit will not be included in snapshots\&. Defaults to
500 \fBtrue\fR
501 for device and snapshot units,
502 \fBfalse\fR
503 for the others\&.
504 .RE
505 .PP
506 \fIStopWhenUnneeded=\fR
507 .RS 4
508 Takes a boolean argument\&. If
509 \fBtrue\fR, this unit will be stopped when it is no longer used\&. Note that in order to minimize the work to be executed, systemd will not stop units by default unless they are conflicting with other units, or the user explicitly requested their shut down\&. If this option is set, a unit will be automatically cleaned up if no other active unit requires it\&. Defaults to
510 \fBfalse\fR\&.
511 .RE
512 .PP
513 \fIRefuseManualStart=\fR, \fIRefuseManualStop=\fR
514 .RS 4
515 Takes a boolean argument\&. If
516 \fBtrue\fR, this unit can only be activated or deactivated indirectly\&. In this case, explicit start\-up or termination requested by the user is denied, however if it is started or stopped as a dependency of another unit, start\-up or termination will succeed\&. This is mostly a safety feature to ensure that the user does not accidentally activate units that are not intended to be activated explicitly, and not accidentally deactivate units that are not intended to be deactivated\&. These options default to
517 \fBfalse\fR\&.
518 .RE
519 .PP
520 \fIAllowIsolate=\fR
521 .RS 4
522 Takes a boolean argument\&. If
523 \fBtrue\fR, this unit may be used with the
524 \fBsystemctl isolate\fR
525 command\&. Otherwise, this will be refused\&. It probably is a good idea to leave this disabled except for target units that shall be used similar to runlevels in SysV init systems, just as a precaution to avoid unusable system states\&. This option defaults to
526 \fBfalse\fR\&.
527 .RE
528 .PP
529 \fIDefaultDependencies=\fR
530 .RS 4
531 Takes a boolean argument\&. If
532 \fBtrue\fR, (the default), a few default dependencies will implicitly be created for the unit\&. The actual dependencies created depend on the unit type\&. For example, for service units, these dependencies ensure that the service is started only after basic system initialization is completed and is properly terminated on system shutdown\&. See the respective man pages for details\&. Generally, only services involved with early boot or late shutdown should set this option to
533 \fBfalse\fR\&. It is highly recommended to leave this option enabled for the majority of common units\&. If set to
534 \fBfalse\fR, this option does not disable all implicit dependencies, just non\-essential ones\&.
535 .RE
536 .PP
537 \fIJobTimeoutSec=\fR, \fIJobTimeoutAction=\fR, \fIJobTimeoutRebootArgument=\fR
538 .RS 4
539 When a job for this unit is queued a time\-out may be configured\&. If this time limit is reached, the job will be cancelled, the unit however will not change state or even enter the
540 "failed"
541 mode\&. This value defaults to 0 (job timeouts disabled), except for device units\&. NB: this timeout is independent from any unit\-specific timeout (for example, the timeout set with
542 \fIStartTimeoutSec=\fR
543 in service units) as the job timeout has no effect on the unit itself, only on the job that might be pending for it\&. Or in other words: unit\-specific timeouts are useful to abort unit state changes, and revert them\&. The job timeout set with this option however is useful to abort only the job waiting for the unit state to change\&.
544 .sp
545 \fIJobTimeoutAction=\fR
546 optionally configures an additional action to take when the time\-out is hit\&. It takes the same values as the per\-service
547 \fIStartLimitAction=\fR
548 setting, see
549 \fBsystemd.service\fR(5)
550 for details\&. Defaults to
551 \fBnone\fR\&.
552 \fIJobTimeoutRebootArgument=\fR
553 configures an optional reboot string to pass to the
554 \fBreboot\fR(2)
555 system call\&.
556 .RE
557 .PP
558 \fIConditionArchitecture=\fR, \fIConditionVirtualization=\fR, \fIConditionHost=\fR, \fIConditionKernelCommandLine=\fR, \fIConditionSecurity=\fR, \fIConditionCapability=\fR, \fIConditionACPower=\fR, \fIConditionNeedsUpdate=\fR, \fIConditionFirstBoot=\fR, \fIConditionPathExists=\fR, \fIConditionPathExistsGlob=\fR, \fIConditionPathIsDirectory=\fR, \fIConditionPathIsSymbolicLink=\fR, \fIConditionPathIsMountPoint=\fR, \fIConditionPathIsReadWrite=\fR, \fIConditionDirectoryNotEmpty=\fR, \fIConditionFileNotEmpty=\fR, \fIConditionFileIsExecutable=\fR, \fIConditionNull=\fR
559 .RS 4
560 Before starting a unit verify that the specified condition is true\&. If it is not true, the starting of the unit will be skipped, however all ordering dependencies of it are still respected\&. A failing condition will not result in the unit being moved into a failure state\&. The condition is checked at the time the queued start job is to be executed\&.
561 .sp
562 \fIConditionArchitecture=\fR
563 may be used to check whether the system is running on a specific architecture\&. Takes one of
564 \fIx86\fR,
565 \fIx86\-64\fR,
566 \fIppc\fR,
567 \fIppc\-le\fR,
568 \fIppc64\fR,
569 \fIppc64\-le\fR,
570 \fIia64\fR,
571 \fIparisc\fR,
572 \fIparisc64\fR,
573 \fIs390\fR,
574 \fIs390x\fR,
575 \fIsparc\fR,
576 \fIsparc64\fR,
577 \fImips\fR,
578 \fImips\-le\fR,
579 \fImips64\fR,
580 \fImips64\-le\fR,
581 \fIalpha\fR,
582 \fIarm\fR,
583 \fIarm\-be\fR,
584 \fIarm64\fR,
585 \fIarm64\-be\fR,
586 \fIsh\fR,
587 \fIsh64\fR,
588 \fIm86k\fR,
589 \fItilegx\fR,
590 \fIcris\fR
591 to test against a specific architecture\&. The architecture is determined from the information returned by
592 \fBuname\fR(2)
593 and is thus subject to
594 \fBpersonality\fR(2)\&. Note that a
595 \fIPersonality=\fR
596 setting in the same unit file has no effect on this condition\&. A special architecture name
597 \fInative\fR
598 is mapped to the architecture the system manager itself is compiled for\&. The test may be negated by prepending an exclamation mark\&.
599 .sp
600 \fIConditionVirtualization=\fR
601 may be used to check whether the system is executed in a virtualized environment and optionally test whether it is a specific implementation\&. Takes either boolean value to check if being executed in any virtualized environment, or one of
602 \fIvm\fR
603 and
604 \fIcontainer\fR
605 to test against a generic type of virtualization solution, or one of
606 \fIqemu\fR,
607 \fIkvm\fR,
608 \fIzvm\fR,
609 \fIvmware\fR,
610 \fImicrosoft\fR,
611 \fIoracle\fR,
612 \fIxen\fR,
613 \fIbochs\fR,
614 \fIuml\fR,
615 \fIopenvz\fR,
616 \fIlxc\fR,
617 \fIlxc\-libvirt\fR,
618 \fIsystemd\-nspawn\fR,
619 \fIdocker\fR
620 to test against a specific implementation\&. See
621 \fBsystemd-detect-virt\fR(1)
622 for a full list of known virtualization technologies and their identifiers\&. If multiple virtualization technologies are nested, only the innermost is considered\&. The test may be negated by prepending an exclamation mark\&.
623 .sp
624 \fIConditionHost=\fR
625 may be used to match against the hostname or machine ID of the host\&. This either takes a hostname string (optionally with shell style globs) which is tested against the locally set hostname as returned by
626 \fBgethostname\fR(2), or a machine ID formatted as string (see
627 \fBmachine-id\fR(5))\&. The test may be negated by prepending an exclamation mark\&.
628 .sp
629 \fIConditionKernelCommandLine=\fR
630 may be used to check whether a specific kernel command line option is set (or if prefixed with the exclamation mark unset)\&. The argument must either be a single word, or an assignment (i\&.e\&. two words, separated
631 "=")\&. In the former case the kernel command line is searched for the word appearing as is, or as left hand side of an assignment\&. In the latter case, the exact assignment is looked for with right and left hand side matching\&.
632 .sp
633 \fIConditionSecurity=\fR
634 may be used to check whether the given security module is enabled on the system\&. Currently the recognized values values are
635 \fIselinux\fR,
636 \fIapparmor\fR,
637 \fIima\fR
638 and
639 \fIsmack\fR\&. The test may be negated by prepending an exclamation mark\&.
640 .sp
641 \fIConditionCapability=\fR
642 may be used to check whether the given capability exists in the capability bounding set of the service manager (i\&.e\&. this does not check whether capability is actually available in the permitted or effective sets, see
643 \fBcapabilities\fR(7)
644 for details)\&. Pass a capability name such as
645 "CAP_MKNOD", possibly prefixed with an exclamation mark to negate the check\&.
646 .sp
647 \fIConditionACPower=\fR
648 may be used to check whether the system has AC power, or is exclusively battery powered at the time of activation of the unit\&. This takes a boolean argument\&. If set to
649 \fItrue\fR, the condition will hold only if at least one AC connector of the system is connected to a power source, or if no AC connectors are known\&. Conversely, if set to
650 \fIfalse\fR, the condition will hold only if there is at least one AC connector known and all AC connectors are disconnected from a power source\&.
651 .sp
652 \fIConditionNeedsUpdate=\fR
653 takes one of
654 /var
655 or
656 /etc
657 as argument, possibly prefixed with a
658 "!"
659 (for inverting the condition)\&. This condition may be used to conditionalize units on whether the specified directory requires an update because
660 /usr\*(Aqs modification time is newer than the stamp file
661 \&.updated
662 in the specified directory\&. This is useful to implement offline updates of the vendor operating system resources in
663 /usr
664 that require updating of
665 /etc
666 or
667 /var
668 on the next following boot\&. Units making use of this condition should order themselves before
669 \fBsystemd-update-done.service\fR(8), to make sure they run before the stamp files\*(Aqs modification time gets reset indicating a completed update\&.
670 .sp
671 \fIConditionFirstBoot=\fR
672 takes a boolean argument\&. This condition may be used to conditionalize units on whether the system is booting up with an unpopulated
673 /etc
674 directory\&. This may be used to populate
675 /etc
676 on the first boot after factory reset, or when a new system instances boots up for the first time\&.
677 .sp
678 With
679 \fIConditionPathExists=\fR
680 a file existence condition is checked before a unit is started\&. If the specified absolute path name does not exist, the condition will fail\&. If the absolute path name passed to
681 \fIConditionPathExists=\fR
682 is prefixed with an exclamation mark ("!"), the test is negated, and the unit is only started if the path does not exist\&.
683 .sp
684 \fIConditionPathExistsGlob=\fR
685 is similar to
686 \fIConditionPathExists=\fR, but checks for the existence of at least one file or directory matching the specified globbing pattern\&.
687 .sp
688 \fIConditionPathIsDirectory=\fR
689 is similar to
690 \fIConditionPathExists=\fR
691 but verifies whether a certain path exists and is a directory\&.
692 .sp
693 \fIConditionPathIsSymbolicLink=\fR
694 is similar to
695 \fIConditionPathExists=\fR
696 but verifies whether a certain path exists and is a symbolic link\&.
697 .sp
698 \fIConditionPathIsMountPoint=\fR
699 is similar to
700 \fIConditionPathExists=\fR
701 but verifies whether a certain path exists and is a mount point\&.
702 .sp
703 \fIConditionPathIsReadWrite=\fR
704 is similar to
705 \fIConditionPathExists=\fR
706 but verifies whether the underlying file system is readable and writable (i\&.e\&. not mounted read\-only)\&.
707 .sp
708 \fIConditionDirectoryNotEmpty=\fR
709 is similar to
710 \fIConditionPathExists=\fR
711 but verifies whether a certain path exists and is a non\-empty directory\&.
712 .sp
713 \fIConditionFileNotEmpty=\fR
714 is similar to
715 \fIConditionPathExists=\fR
716 but verifies whether a certain path exists and refers to a regular file with a non\-zero size\&.
717 .sp
718 \fIConditionFileIsExecutable=\fR
719 is similar to
720 \fIConditionPathExists=\fR
721 but verifies whether a certain path exists, is a regular file and marked executable\&.
722 .sp
723 Finally,
724 \fIConditionNull=\fR
725 may be used to add a constant condition check value to the unit\&. It takes a boolean argument\&. If set to
726 \fIfalse\fR, the condition will always fail, otherwise succeed\&.
727 .sp
728 If multiple conditions are specified, the unit will be executed if all of them apply (i\&.e\&. a logical AND is applied)\&. Condition checks can be prefixed with a pipe symbol (|) in which case a condition becomes a triggering condition\&. If at least one triggering condition is defined for a unit, then the unit will be executed if at least one of the triggering conditions apply and all of the non\-triggering conditions\&. If you prefix an argument with the pipe symbol and an exclamation mark, the pipe symbol must be passed first, the exclamation second\&. Except for
729 \fIConditionPathIsSymbolicLink=\fR, all path checks follow symlinks\&. If any of these options is assigned the empty string, the list of conditions is reset completely, all previous condition settings (of any kind) will have no effect\&.
730 .RE
731 .PP
732 \fISourcePath=\fR
733 .RS 4
734 A path to a configuration file this unit has been generated from\&. This is primarily useful for implementation of generator tools that convert configuration from an external configuration file format into native unit files\&. This functionality should not be used in normal units\&.
735 .RE
736 .SH "[INSTALL] SECTION OPTIONS"
737 .PP
738 Unit file may include an
739 "[Install]"
740 section, which carries installation information for the unit\&. This section is not interpreted by
741 \fBsystemd\fR(1)
742 during runtime\&. It is used exclusively by the
743 \fBenable\fR
744 and
745 \fBdisable\fR
746 commands of the
747 \fBsystemctl\fR(1)
748 tool during installation of a unit:
749 .PP
750 \fIAlias=\fR
751 .RS 4
752 A space\-separated list of additional names this unit shall be installed under\&. The names listed here must have the same suffix (i\&.e\&. type) as the unit file name\&. This option may be specified more than once, in which case all listed names are used\&. At installation time,
753 \fBsystemctl enable\fR
754 will create symlinks from these names to the unit filename\&.
755 .RE
756 .PP
757 \fIWantedBy=\fR, \fIRequiredBy=\fR
758 .RS 4
759 This option may be used more than once, or a space\-separated list of unit names may be given\&. A symbolic link is created in the
760 \&.wants/
761 or
762 \&.requires/
763 directory of each of the listed units when this unit is installed by
764 \fBsystemctl enable\fR\&. This has the effect that a dependency of type
765 \fIWants=\fR
766 or
767 \fIRequires=\fR
768 is added from the listed unit to the current unit\&. The primary result is that the current unit will be started when the listed unit is started\&. See the description of
769 \fIWants=\fR
770 and
771 \fIRequires=\fR
772 in the [Unit] section for details\&.
773 .sp
774 \fBWantedBy=foo\&.service\fR
775 in a service
776 bar\&.service
777 is mostly equivalent to
778 \fBAlias=foo\&.service\&.wants/bar\&.service\fR
779 in the same file\&. In case of template units,
780 \fBsystemctl enable\fR
781 must be called with an instance name, and this instance will be added to the
782 \&.wants/
783 or
784 \&.requires/
785 list of the listed unit\&. E\&.g\&.
786 \fBWantedBy=getty\&.target\fR
787 in a service
788 getty@\&.service
789 will result in
790 \fBsystemctl enable getty@tty2\&.service\fR
791 creating a
792 getty\&.target\&.wants/getty@tty2\&.service
793 link to
794 getty@\&.service\&.
795 .RE
796 .PP
797 \fIAlso=\fR
798 .RS 4
799 Additional units to install/deinstall when this unit is installed/deinstalled\&. If the user requests installation/deinstallation of a unit with this option configured,
800 \fBsystemctl enable\fR
801 and
802 \fBsystemctl disable\fR
803 will automatically install/uninstall units listed in this option as well\&.
804 .sp
805 This option may be used more than once, or a space\-separated list of unit names may be given\&.
806 .RE
807 .PP
808 \fIDefaultInstance=\fR
809 .RS 4
810 In template unit files, this specifies for which instance the unit shall be enabled if the template is enabled without any explicitly set instance\&. This option has no effect in non\-template unit files\&. The specified string must be usable as instance identifier\&.
811 .RE
812 .PP
813 The following specifiers are interpreted in the Install section: %n, %N, %p, %i, %U, %u, %m, %H, %b, %v\&. For their meaning see the next section\&.
814 .SH "SPECIFIERS"
815 .PP
816 Many settings resolve specifiers which may be used to write generic unit files referring to runtime or unit parameters that are replaced when the unit files are loaded\&. The following specifiers are understood:
817 .sp
818 .it 1 an-trap
819 .nr an-no-space-flag 1
820 .nr an-break-flag 1
821 .br
822 .B Table\ \&3.\ \&Specifiers available in unit files
823 .TS
824 allbox tab(:);
825 lB lB lB.
826 T{
827 Specifier
828 T}:T{
829 Meaning
830 T}:T{
831 Details
832 T}
833 .T&
834 l l l
835 l l l
836 l l l
837 l l l
838 l l l
839 l l l
840 l l l
841 l l l
842 l l l
843 l l l
844 l l l
845 l l l
846 l l l
847 l l l
848 l l l
849 l l l
850 l l l
851 l l l
852 l l l
853 l l l.
854 T{
855 "%n"
856 T}:T{
857 Full unit name
858 T}:T{
859 \ \&
860 T}
861 T{
862 "%N"
863 T}:T{
864 Unescaped full unit name
865 T}:T{
866 Same as "%n", but with escaping undone
867 T}
868 T{
869 "%p"
870 T}:T{
871 Prefix name
872 T}:T{
873 For instantiated units, this refers to the string before the "@" character of the unit name\&. For non\-instantiated units, this refers to the name of the unit with the type suffix removed\&.
874 T}
875 T{
876 "%P"
877 T}:T{
878 Unescaped prefix name
879 T}:T{
880 Same as "%p", but with escaping undone
881 T}
882 T{
883 "%i"
884 T}:T{
885 Instance name
886 T}:T{
887 For instantiated units: this is the string between the "@" character and the suffix of the unit name\&.
888 T}
889 T{
890 "%I"
891 T}:T{
892 Unescaped instance name
893 T}:T{
894 Same as "%i", but with escaping undone
895 T}
896 T{
897 "%f"
898 T}:T{
899 Unescaped filename
900 T}:T{
901 This is either the unescaped instance name (if applicable) with / prepended (if applicable), or the prefix name prepended with /\&.
902 T}
903 T{
904 "%c"
905 T}:T{
906 Control group path of the unit
907 T}:T{
908 This path does not include the /sys/fs/cgroup/systemd/ prefix\&.
909 T}
910 T{
911 "%r"
912 T}:T{
913 Control group path of the slice the unit is placed in
914 T}:T{
915 This usually maps to the parent cgroup path of "%c"\&.
916 T}
917 T{
918 "%R"
919 T}:T{
920 Root control group path below which slices and units are placed
921 T}:T{
922 For system instances, this resolves to /, except in containers, where this maps to the container\*(Aqs root control group path\&.
923 T}
924 T{
925 "%t"
926 T}:T{
927 Runtime directory
928 T}:T{
929 This is either /run (for the system manager) or the path "$XDG_RUNTIME_DIR" resolves to (for user managers)\&.
930 T}
931 T{
932 "%u"
933 T}:T{
934 User name
935 T}:T{
936 This is the name of the configured user of the unit, or (if none is set) the user running the systemd instance\&.
937 T}
938 T{
939 "%U"
940 T}:T{
941 User UID
942 T}:T{
943 This is the numeric UID of the configured user of the unit, or (if none is set) the user running the systemd user instance\&. Note that this specifier is not available for units run by the systemd system instance (as opposed to those run by a systemd user instance), unless the user has been configured as a numeric UID in the first place or the configured user is the root user\&.
944 T}
945 T{
946 "%h"
947 T}:T{
948 User home directory
949 T}:T{
950 This is the home directory of the configured user of the unit, or (if none is set) the user running the systemd user instance\&. Similar to "%U", this specifier is not available for units run by the systemd system instance, unless the configured user is the root user\&.
951 T}
952 T{
953 "%s"
954 T}:T{
955 User shell
956 T}:T{
957 This is the shell of the configured user of the unit, or (if none is set) the user running the systemd user instance\&. Similar to "%U", this specifier is not available for units run by the systemd system instance, unless the configured user is the root user\&.
958 T}
959 T{
960 "%m"
961 T}:T{
962 Machine ID
963 T}:T{
964 The machine ID of the running system, formatted as string\&. See \fBmachine-id\fR(5) for more information\&.
965 T}
966 T{
967 "%b"
968 T}:T{
969 Boot ID
970 T}:T{
971 The boot ID of the running system, formatted as string\&. See \fBrandom\fR(4) for more information\&.
972 T}
973 T{
974 "%H"
975 T}:T{
976 Host name
977 T}:T{
978 The hostname of the running system at the point in time the unit configuation is loaded\&.
979 T}
980 T{
981 "%v"
982 T}:T{
983 Kernel release
984 T}:T{
985 Identical to \fBuname \-r\fR output
986 T}
987 T{
988 "%%"
989 T}:T{
990 Single percent sign
991 T}:T{
992 Use "%%" in place of "%" to specify a single percent sign\&.
993 T}
994 .TE
995 .sp 1
996 .SH "SEE ALSO"
997 .PP
998 \fBsystemd\fR(1),
999 \fBsystemctl\fR(1),
1000 \fBsystemd.special\fR(7),
1001 \fBsystemd.service\fR(5),
1002 \fBsystemd.socket\fR(5),
1003 \fBsystemd.device\fR(5),
1004 \fBsystemd.mount\fR(5),
1005 \fBsystemd.automount\fR(5),
1006 \fBsystemd.swap\fR(5),
1007 \fBsystemd.target\fR(5),
1008 \fBsystemd.path\fR(5),
1009 \fBsystemd.timer\fR(5),
1010 \fBsystemd.snapshot\fR(5),
1011 \fBsystemd.scope\fR(5),
1012 \fBsystemd.slice\fR(5),
1013 \fBsystemd.time\fR(7),
1014 \fBsystemd-verify\fR(1),
1015 \fBcapabilities\fR(7),
1016 \fBsystemd.directives\fR(7),
1017 \fBuname\fR(1)
1018 .SH "NOTES"
1019 .IP " 1." 4
1020 XDG Desktop Entry Specification
1021 .RS 4
1022 \%http://standards.freedesktop.org/desktop-entry-spec/latest/
1023 .RE
1024 .IP " 2." 4
1025 Interface Stability Promise
1026 .RS 4
1027 \%http://www.freedesktop.org/wiki/Software/systemd/InterfaceStabilityPromise
1028 .RE
1029 .IP " 3." 4
1030 Generators
1031 .RS 4
1032 \%http://www.freedesktop.org/wiki/Software/systemd/Generators/
1033 .RE