Debian Codegraph @

upstream/debian-unstable/man5/systemd.exec.5

raw
1 '\" t
2 .TH "SYSTEMD\&.EXEC" "5" "" "systemd 261~rc3" "systemd.exec"
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.exec \- Execution environment configuration
24 .SH "SYNOPSIS"
25 .PP
26 \fIservice\fR\&.service,
27 \fIsocket\fR\&.socket,
28 \fImount\fR\&.mount,
29 \fIswap\fR\&.swap
30 .SH "DESCRIPTION"
31 .PP
32 Unit configuration files for services, sockets, mount points, and swap devices share a subset of configuration options which define the execution environment of spawned processes\&.
33 .PP
34 This man page lists the configuration options shared by these four unit types\&. See
35 \fBsystemd.unit\fR(5)
36 for the common options of all unit configuration files, and
37 \fBsystemd.service\fR(5),
38 \fBsystemd.socket\fR(5),
39 \fBsystemd.swap\fR(5), and
40 \fBsystemd.mount\fR(5)
41 for more information on the specific unit configuration files\&. The execution specific configuration options are configured in the [Service], [Socket], [Mount], or [Swap] sections, depending on the unit type\&.
42 .PP
43 In addition, options which control resources through Linux Control Groups (cgroups) are listed in
44 \fBsystemd.resource-control\fR(5)\&. Those options complement options listed here\&.
45 .SH "IMPLICIT DEPENDENCIES"
46 .PP
47 A few execution parameters result in additional, automatic dependencies to be added:
48 .sp
49 .RS 4
50 .ie n \{\
51 \h'-04'\(bu\h'+03'\c
52 .\}
53 .el \{\
54 .sp -1
55 .IP \(bu 2.3
56 .\}
57 Units with
58 \fIWorkingDirectory=\fR,
59 \fIRootDirectory=\fR,
60 \fIRootImage=\fR,
61 \fIRuntimeDirectory=\fR,
62 \fIStateDirectory=\fR,
63 \fICacheDirectory=\fR,
64 \fILogsDirectory=\fR
65 or
66 \fIConfigurationDirectory=\fR
67 set automatically gain dependencies of type
68 \fIRequires=\fR
69 and
70 \fIAfter=\fR
71 on all mount units required to access the specified paths\&. This is equivalent to having them listed explicitly in
72 \fIRequiresMountsFor=\fR\&.
73 .RE
74 .sp
75 .RS 4
76 .ie n \{\
77 \h'-04'\(bu\h'+03'\c
78 .\}
79 .el \{\
80 .sp -1
81 .IP \(bu 2.3
82 .\}
83 Units with
84 \fIPrivateTmp=yes\fR
85 automatically gain dependencies of type
86 \fIWants=\fR
87 and
88 \fIAfter=\fR
89 on all mounts required to access
90 /tmp/
91 and
92 /var/tmp/
93 and an automatic
94 \fIAfter=\fR
95 dependency on
96 \fBsystemd-tmpfiles-setup.service\fR(8), unless
97 \fIDefaultDependencies=no\fR
98 is specified\&. If
99 \fIDefaultDependencies=no\fR
100 is specified, and a
101 \fIRequiresMountsFor=/tmp/\fR,
102 \fIWantsMountsFor=/tmp/\fR,
103 \fIAfter=tmp\&.mount\fR, or
104 \fIRootDirectory=\fR/\fIRootImage=\fR
105 are not specified,
106 \fIPrivateTmp=yes\fR
107 is converted to
108 \fIPrivateTmp=disconnected\fR\&.
109 .RE
110 .sp
111 .RS 4
112 .ie n \{\
113 \h'-04'\(bu\h'+03'\c
114 .\}
115 .el \{\
116 .sp -1
117 .IP \(bu 2.3
118 .\}
119 Units with
120 \fIPrivateTmp=disconnected\fR
121 automatically gain dependencies of type
122 \fIWants=\fR
123 and
124 \fIAfter=\fR
125 on the mount required to access
126 /var/, unless
127 \fIDefaultDependencies=no\fR
128 and/or
129 \fIRootDirectory=\fR/\fIRootImage=\fR
130 are specified\&. If
131 \fIDefaultDependencies=no\fR
132 is specified, and a
133 \fIRequiresMountsFor=/var/\fR,
134 \fIWantsMountsFor=/var/\fR,
135 \fIAfter=var\&.mount\fR,
136 \fIRootDirectory=\fR/\fIRootImage=\fR
137 are not specified, the private mount on
138 /tmp/
139 is reused for
140 /var/tmp/
141 by setting
142 \fI$TMPDIR\fR
143 appropriately\&.
144 .RE
145 .sp
146 .RS 4
147 .ie n \{\
148 \h'-04'\(bu\h'+03'\c
149 .\}
150 .el \{\
151 .sp -1
152 .IP \(bu 2.3
153 .\}
154 Units whose standard output or error output is connected to
155 \fBjournal\fR
156 or
157 \fBkmsg\fR
158 (or their combinations with console output, see below) automatically acquire dependencies of type
159 \fIAfter=\fR
160 on
161 systemd\-journald\&.socket\&.
162 .RE
163 .sp
164 .RS 4
165 .ie n \{\
166 \h'-04'\(bu\h'+03'\c
167 .\}
168 .el \{\
169 .sp -1
170 .IP \(bu 2.3
171 .\}
172 Units using
173 \fILogNamespace=\fR
174 will automatically gain ordering and requirement dependencies on the two socket units associated with
175 systemd\-journald@\&.service
176 instances\&.
177 .RE
178 .SH "PATHS"
179 .PP
180 The following settings may be used to change a service\*(Aqs view of the filesystem\&. Please note that the paths must be absolute and must not contain a
181 "\&.\&."
182 path component\&.
183 .PP
184 \fIExecSearchPath=\fR
185 .RS 4
186 Takes a colon separated list of absolute paths relative to which the executable used by the
187 \fIExec*=\fR
188 (e\&.g\&.
189 \fIExecStart=\fR,
190 \fIExecStop=\fR, etc\&.) properties can be found\&.
191 \fIExecSearchPath=\fR
192 overrides
193 \fI$PATH\fR
194 if
195 \fI$PATH\fR
196 is not supplied by the user through
197 \fIEnvironment=\fR,
198 \fIEnvironmentFile=\fR
199 or
200 \fIPassEnvironment=\fR\&. Assigning an empty string removes previous assignments and setting
201 \fIExecSearchPath=\fR
202 to a value multiple times will append to the previous setting\&.
203 .sp
204 Added in version 250\&.
205 .RE
206 .PP
207 \fIWorkingDirectory=\fR
208 .RS 4
209 Takes a directory path relative to the service\*(Aqs root directory specified by
210 \fIRootDirectory=\fR, or the special value
211 "~"\&. Sets the working directory for executed processes\&. If set to
212 "~", the home directory of the user specified in
213 \fIUser=\fR
214 is used\&. If not set, defaults to the root directory when systemd is running as a system instance and the respective user\*(Aqs home directory if run as user\&. If the setting is prefixed with the
215 "\-"
216 character, a missing working directory is not considered fatal\&. If
217 \fIRootDirectory=\fR/\fIRootImage=\fR
218 is not set, then
219 \fIWorkingDirectory=\fR
220 is relative to the root of the system running the service manager\&. Note that setting this parameter might result in additional dependencies to be added to the unit (see above)\&.
221 .RE
222 .PP
223 \fIRootDirectory=\fR
224 .RS 4
225 Takes a directory path relative to the host\*(Aqs root directory (i\&.e\&. the root of the system running the service manager)\&. Sets the root directory for executed processes, with the
226 \fBpivot_root\fR(2)
227 or
228 \fBchroot\fR(2)
229 system call\&. If this is used, it must be ensured that the process binary and all its auxiliary files are available in the new root\&. Note that setting this parameter might result in additional dependencies to be added to the unit (see above)\&.
230 .sp
231 The
232 \fIMountAPIVFS=\fR
233 and
234 \fIPrivateUsers=\fR
235 settings are particularly useful in conjunction with
236 \fIRootDirectory=\fR\&. For details, see below\&.
237 .sp
238 If
239 \fIRootDirectory=\fR/\fIRootImage=\fR
240 are used together with
241 \fINotifyAccess=\fR
242 the notification socket is automatically mounted from the host into the root environment, to ensure the notification interface can work correctly\&.
243 .sp
244 Note that services using
245 \fIRootDirectory=\fR/\fIRootImage=\fR
246 will not be able to log via the syslog or journal protocols to the host logging infrastructure, unless the relevant sockets are mounted from the host, specifically:
247 .sp
248 The host\*(Aqs
249 \fBos-release\fR(5)
250 file will be made available for the service (read\-only) as
251 /run/host/os\-release\&. It will be updated automatically on soft reboot (see:
252 \fBsystemd-soft-reboot.service\fR(8)), in case the service is configured to survive it\&.
253 .PP
254 \fBExample\ \&1.\ \&Mounting logging sockets into root environment\fR
255 .sp
256 .if n \{\
257 .RS 4
258 .\}
259 .nf
260 BindReadOnlyPaths=/dev/log /run/systemd/journal/socket /run/systemd/journal/stdout
261 .fi
262 .if n \{\
263 .RE
264 .\}
265
266 In place of the directory path a
267 "\&.v/"
268 versioned directory may be specified, see
269 \fBsystemd.v\fR(7)
270 for details\&.
271 .sp
272 This option is only available for system services, or for services running in per\-user instances of the service manager in which case
273 \fIPrivateUsers=\fR
274 is implicitly enabled (requires unprivileged user namespaces support to be enabled in the kernel via the
275 "kernel\&.unprivileged_userns_clone="
276 sysctl)\&.
277 .RE
278 .PP
279 \fIRootImage=\fR
280 .RS 4
281 Takes a path to a block device node or regular file as argument\&. This call is similar to
282 \fIRootDirectory=\fR
283 however mounts a file system hierarchy from a block device node or loopback file instead of a directory\&. The device node or file system image file needs to contain a file system without a partition table, or a file system within an MBR/MS\-DOS or GPT partition table with only a single Linux\-compatible partition, or a set of file systems within a GPT partition table that follows the
284 \m[blue]\fBUAPI\&.2 Discoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2\&.
285 .sp
286 When
287 \fIDevicePolicy=\fR
288 is set to
289 "closed"
290 or
291 "strict", or set to
292 "auto"
293 and
294 \fIDeviceAllow=\fR
295 is set, then this setting adds
296 /dev/loop\-control
297 with
298 \fBrw\fR
299 mode,
300 "block\-loop"
301 and
302 "block\-blkext"
303 with
304 \fBrwm\fR
305 mode to
306 \fIDeviceAllow=\fR\&. See
307 \fBsystemd.resource-control\fR(5)
308 for the details about
309 \fIDevicePolicy=\fR
310 or
311 \fIDeviceAllow=\fR\&. Also, see
312 \fIPrivateDevices=\fR
313 below, as it may change the setting of
314 \fIDevicePolicy=\fR\&.
315 .sp
316 Units making use of
317 \fIRootImage=\fR
318 automatically gain an
319 \fIAfter=\fR
320 dependency on
321 systemd\-udevd\&.service\&.
322 .sp
323 The host\*(Aqs
324 \fBos-release\fR(5)
325 file will be made available for the service (read\-only) as
326 /run/host/os\-release\&. It will be updated automatically on soft reboot (see:
327 \fBsystemd-soft-reboot.service\fR(8)), in case the service is configured to survive it\&.
328 .sp
329 In place of the image path a
330 "\&.v/"
331 versioned directory may be specified, see
332 \fBsystemd.v\fR(7)
333 for details\&.
334 .sp
335 When enabled for services running in per\-user instances of the service manager this option implicitly enables
336 \fIPrivateUsers=\fR
337 (requires unprivileged user namespaces support to be enabled in the kernel via the
338 "kernel\&.unprivileged_userns_clone="
339 sysctl) and also relies on
340 \fBsystemd-mountfsd.service\fR(8)\&.
341 .sp
342 Added in version 233\&.
343 .RE
344 .PP
345 \fIRootImageOptions=\fR
346 .RS 4
347 Takes a comma\-separated list of mount options that will be used on disk images specified by
348 \fIRootImage=\fR\&. Optionally a partition name can be prefixed, followed by colon, in case the image has multiple partitions, otherwise partition name
349 "root"
350 is implied\&. Options for multiple partitions can be specified in a single line with space separators\&. Assigning an empty string removes previous assignments\&. For a list of valid mount options, please refer to
351 \fBmount\fR(8)\&.
352 .sp
353 Valid partition names follow the
354 \m[blue]\fBDiscoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2:
355 \fBroot\fR,
356 \fBusr\fR,
357 \fBhome\fR,
358 \fBsrv\fR,
359 \fBesp\fR,
360 \fBxbootldr\fR,
361 \fBtmp\fR,
362 \fBvar\fR\&.
363 .sp
364 This option is only available for system services and is not supported for services running in per\-user instances of the service manager\&.
365 .sp
366 When enabled for services running in per\-user instances of the service manager using mount options is disabled by default, due to the security implications\&. It is possible to use a
367 \m[blue]\fBpolkit\fR\m[]\&\s-2\u[2]\d\s+2
368 policy to allow specific mount options, for example:
369 .PP \fBExample\ \&2.\ \&A polkit policy that allows mounting the root partition with nosuid\fR /etc/polkit\-1/rules\&.d/mountoptions\&.rules: .sp .if n \{\ .RS 4 .\} .nf polkit\&.addRule(function(action, subject) { if (action\&.id == "io\&.systemd\&.mount\-file\-system\&.mount\-untrusted\-image\-privately" && action\&.lookup("mount_options") == "root:nosuid") { return polkit\&.Result\&.YES; } }); .fi .if n \{\ .RE .\}
370 .PP
371 \fBExample\ \&3.\ \&A polkit policy that allows mounting the root partition with nosuid\fR
372 /etc/polkit\-1/rules\&.d/mountoptions\&.rules:
373 .sp
374 .if n \{\
375 .RS 4
376 .\}
377 .nf
378 polkit\&.addRule(function(action, subject) {
379 if (action\&.id == "io\&.systemd\&.mount\-file\-system\&.mount\-untrusted\-image\-privately" &&
380 action\&.lookup("mount_options") == "root:nosuid") {
381 return polkit\&.Result\&.YES;
382 }
383 });
384 .fi
385 .if n \{\
386 .RE
387 .\}
388
389 Added in version 247\&.
390 .RE
391 .PP
392 \fIRootEphemeral=\fR
393 .RS 4
394 Takes a boolean argument\&. If enabled, executed processes will run in an ephemeral copy of the root directory or root image\&. The ephemeral copy is placed in
395 /var/lib/systemd/ephemeral\-trees/
396 while the service is active and is cleaned up when the service is stopped or restarted\&. If
397 \fIRootDirectory=\fR
398 is used and the root directory is a subvolume, the ephemeral copy will be created by making a snapshot of the subvolume\&.
399 .sp
400 To make sure making ephemeral copies can be made efficiently, the root directory or root image should be located on the same filesystem as
401 /var/lib/systemd/ephemeral\-trees/\&. When using
402 \fIRootEphemeral=\fR
403 with root directories,
404 \fBbtrfs\fR(5)
405 should be used as the filesystem and the root directory should ideally be a subvolume which
406 \fBsystemd\fR
407 can snapshot to make the ephemeral copy\&. For root images, a filesystem with support for reflinks should be used to ensure an efficient ephemeral copy\&.
408 .sp
409 This option is only available for system services and is not supported for services running in per\-user instances of the service manager\&.
410 .sp
411 Added in version 254\&.
412 .RE
413 .PP
414 \fIRootHash=\fR
415 .RS 4
416 Takes a data integrity (dm\-verity) root hash specified in hexadecimal, or the path to a file containing a root hash in ASCII hexadecimal format\&. This option enables data integrity checks using dm\-verity, if the used image contains the appropriate integrity data (see above) or if
417 \fIRootVerity=\fR
418 is used\&. The specified hash must match the root hash of integrity data, and is usually at least 256 bits (and hence 64 formatted hexadecimal characters) long (in case of SHA256 for example)\&. If this option is not specified, but the image file carries the
419 "user\&.verity\&.roothash"
420 extended file attribute (see
421 \fBxattr\fR(7)), then the root hash is read from it, also as formatted hexadecimal characters\&. If the extended file attribute is not found (or is not supported by the underlying file system), but a file with the
422 \&.roothash
423 suffix is found next to the image file, bearing otherwise the same name (except if the image has the
424 \&.raw
425 suffix, in which case the root hash file must not have it in its name), the root hash is read from it and automatically used, also as formatted hexadecimal characters\&.
426 .sp
427 If the disk image contains a separate
428 /usr/
429 partition it may also be Verity protected, in which case the root hash may configured via an extended attribute
430 "user\&.verity\&.usrhash"
431 or a
432 \&.usrhash
433 file adjacent to the disk image\&. There\*(Aqs currently no option to configure the root hash for the
434 /usr/
435 file system via the unit file directly\&.
436 .sp
437 When enabled for services running in per\-user instances of the service manager this option implicitly enables
438 \fIPrivateUsers=\fR
439 (requires unprivileged user namespaces support to be enabled in the kernel via the
440 "kernel\&.unprivileged_userns_clone="
441 sysctl) and also relies on
442 \fBsystemd-mountfsd.service\fR(8)\&.
443 .sp
444 Added in version 246\&.
445 .RE
446 .PP
447 \fIRootHashSignature=\fR
448 .RS 4
449 Takes a PKCS7 signature of the
450 \fIRootHash=\fR
451 option as a path to a DER\-encoded signature file, or as an ASCII base64 string encoding of a DER\-encoded signature prefixed by
452 "base64:"\&. The dm\-verity volume will only be opened if the signature of the root hash is valid and signed by a public key present in the kernel keyring\&. If this option is not specified, but a file with the
453 \&.roothash\&.p7s
454 suffix is found next to the image file, bearing otherwise the same name (except if the image has the
455 \&.raw
456 suffix, in which case the signature file must not have it in its name), the signature is read from it and automatically used\&.
457 .sp
458 If the disk image contains a separate
459 /usr/
460 partition it may also be Verity protected, in which case the signature for the root hash may configured via a
461 \&.usrhash\&.p7s
462 file adjacent to the disk image\&. There\*(Aqs currently no option to configure the root hash signature for the
463 /usr/
464 via the unit file directly\&.
465 .sp
466 When enabled for services running in per\-user instances of the service manager this option implicitly enables
467 \fIPrivateUsers=\fR
468 (requires unprivileged user namespaces support to be enabled in the kernel via the
469 "kernel\&.unprivileged_userns_clone="
470 sysctl) and also relies on
471 \fBsystemd-mountfsd.service\fR(8)\&.
472 .sp
473 Added in version 246\&.
474 .RE
475 .PP
476 \fIRootVerity=\fR
477 .RS 4
478 Takes the path to a data integrity (dm\-verity) file\&. This option enables data integrity checks using dm\-verity, if
479 \fIRootImage=\fR
480 is used and a root\-hash is passed and if the used image itself does not contain the integrity data\&. The integrity data must be matched by the root hash\&. If this option is not specified, but a file with the
481 \&.verity
482 suffix is found next to the image file, bearing otherwise the same name (except if the image has the
483 \&.raw
484 suffix, in which case the verity data file must not have it in its name), the verity data is read from it and automatically used\&.
485 .sp
486 This option is supported only for disk images that contain a single file system, without an enveloping partition table\&. Images that contain a GPT partition table should instead include both root file system and matching Verity data in the same image, implementing the
487 \m[blue]\fBDiscoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2\&.
488 .sp
489 When enabled for services running in per\-user instances of the service manager this option implicitly enables
490 \fIPrivateUsers=\fR
491 (requires unprivileged user namespaces support to be enabled in the kernel via the
492 "kernel\&.unprivileged_userns_clone="
493 sysctl) and also relies on
494 \fBsystemd-mountfsd.service\fR(8)\&.
495 .sp
496 Added in version 246\&.
497 .RE
498 .PP
499 \fIRootImagePolicy=\fR, \fIMountImagePolicy=\fR, \fIExtensionImagePolicy=\fR
500 .RS 4
501 Takes an image policy string as per
502 \fBsystemd.image-policy\fR(7)
503 to use when mounting the disk images (DDI) specified in
504 \fIRootImage=\fR,
505 \fIMountImage=\fR,
506 \fIExtensionImage=\fR, respectively\&. If not specified the following policy string is the default for
507 \fIRootImagePolicy=\fR
508 and
509 \fIMountImagePolicy\fR:
510 .sp
511 .if n \{\
512 .RS 4
513 .\}
514 .nf
515 root=verity+signed+encrypted+unprotected+absent: \e
516 usr=verity+signed+encrypted+unprotected+absent: \e
517 home=encrypted+unprotected+absent: \e
518 srv=encrypted+unprotected+absent: \e
519 tmp=encrypted+unprotected+absent: \e
520 var=encrypted+unprotected+absent
521 .fi
522 .if n \{\
523 .RE
524 .\}
525 .sp
526 The default policy for
527 \fIExtensionImagePolicy=\fR
528 is:
529 .sp
530 .if n \{\
531 .RS 4
532 .\}
533 .nf
534 root=verity+signed+encrypted+unprotected+absent: \e
535 usr=verity+signed+encrypted+unprotected+absent
536 .fi
537 .if n \{\
538 .RE
539 .\}
540 .sp
541 Added in version 254\&.
542 .RE
543 .PP
544 \fIRootMStack=\fR
545 .RS 4
546 Takes a path to a
547 \fBsystemd.mstack\fR(7)
548 directory encapsulating a mount stack consisting of layers and bind mounts\&. Similar to
549 \fIRootDirectory=\fR
550 and
551 \fIRootImage=\fR
552 this runs the service off a distinct root file system, in this case set up via
553 "overlayfs"\&.
554 .sp
555 Since
556 \&.mstack/
557 directories may reference disk images (DDIs) similar device policy extensions and dependencies are in effect when
558 \fIRootMStack=\fR
559 is used as are if
560 \fIRootImage=\fR
561 is used\&.
562 .sp
563 In place of the image path a
564 "\&.v/"
565 versioned directory may be specified, see
566 \fBsystemd.v\fR(7)
567 for details\&.
568 .sp
569 When enabled for services running in per\-user instances of the service manager this option implicitly enables
570 \fIPrivateUsers=\fR
571 (requires unprivileged user namespaces support to be enabled in the kernel via the
572 "kernel\&.unprivileged_userns_clone="
573 sysctl) and also relies on
574 \fBsystemd-mountfsd.service\fR(8)\&.
575 .sp
576 Added in version 260\&.
577 .RE
578 .PP
579 \fIMountAPIVFS=\fR
580 .RS 4
581 Takes a boolean argument\&. If on, a private mount namespace for the unit\*(Aqs processes is created and the API file systems
582 /proc/,
583 /sys/,
584 /dev/
585 and
586 /run/
587 (as an empty
588 "tmpfs") are mounted inside of it, unless they are already mounted\&. Note that this option has no effect unless used in conjunction with
589 \fIRootDirectory=\fR/\fIRootImage=\fR
590 as these four mounts are generally mounted in the host anyway, and unless the root directory is changed, the private mount namespace will be a 1:1 copy of the host\*(Aqs, and include these four mounts\&. Note that the
591 /dev/
592 file system of the host is bind mounted if this option is used without
593 \fIPrivateDevices=\fR\&. To run the service with a private, minimal version of
594 /dev/, combine this option with
595 \fIPrivateDevices=\fR\&.
596 .sp
597 In order to allow propagating mounts at runtime in a safe manner,
598 /run/systemd/propagate/
599 on the host will be used to set up new mounts, and
600 /run/host/incoming/
601 in the private namespace will be used as an intermediate step to store them before being moved to the final mount point\&.
602 .sp
603 Added in version 233\&.
604 .RE
605 .PP
606 \fIBindLogSockets=\fR
607 .RS 4
608 Takes a boolean argument\&. If true, sockets from
609 \fBsystemd-journald.socket\fR(8)
610 will be bind mounted into the mount namespace\&. This is particularly useful when a different instance of
611 /run/
612 is employed, to make sure processes running in the namespace can still make use of
613 \fBsd-journal\fR(3)\&.
614 .sp
615 This option is implied when
616 \fILogNamespace=\fR
617 is used, when
618 \fIMountAPIVFS=yes\fR, or when
619 \fIPrivateDevices=yes\fR
620 is used in conjunction with either
621 \fIRootDirectory=\fR
622 or
623 \fIRootImage=\fR\&.
624 .sp
625 Added in version 257\&.
626 .RE
627 .PP
628 \fIProtectProc=\fR
629 .RS 4
630 Takes one of
631 "noaccess",
632 "invisible",
633 "ptraceable"
634 or
635 "default"
636 (which it defaults to)\&. When set, this controls the
637 "hidepid="
638 mount option of the
639 "procfs"
640 instance for the unit that controls which directories with process metainformation (/proc/\fIPID\fR) are visible and accessible: when set to
641 "noaccess"
642 the ability to access most of other users\*(Aq process metadata in
643 /proc/
644 is taken away for processes of the service\&. When set to
645 "invisible"
646 processes owned by other users are hidden from
647 /proc/\&. If
648 "ptraceable"
649 all processes that cannot be
650 \fBptrace()\fR\*(Aqed by a process are hidden to it\&. If
651 "default"
652 no restrictions on
653 /proc/
654 access or visibility are made\&. For further details see
655 \m[blue]\fBThe /proc Filesystem\fR\m[]\&\s-2\u[3]\d\s+2\&. It is generally recommended to run most system services with this option set to
656 "invisible"\&. This option is implemented via file system namespacing, and thus cannot be used with services that shall be able to install mount points in the host file system hierarchy\&. Note that the root user is unaffected by this option, so to be effective it has to be used together with
657 \fIUser=\fR
658 or
659 \fIDynamicUser=yes\fR, and also without the
660 "CAP_SYS_PTRACE"
661 capability, which also allows a process to bypass this feature\&. It cannot be used for services that need to access metainformation about other users\*(Aq processes\&. This option implies
662 \fIMountAPIVFS=\fR\&.
663 .sp
664 If the kernel does not support per\-mount point
665 \fBhidepid=\fR
666 mount options this setting remains without effect, and the unit\*(Aqs processes will be able to access and see other process as if the option was not used\&.
667 .sp
668 This option is only available for system services and is not supported for services running in per\-user instances of the service manager\&.
669 .sp
670 Added in version 247\&.
671 .RE
672 .PP
673 \fIProcSubset=\fR
674 .RS 4
675 Takes one of
676 "all"
677 (the default) and
678 "pid"\&. If
679 "pid", all files and directories not directly associated with process management and introspection are made invisible in the
680 /proc/
681 file system configured for the unit\*(Aqs processes\&. This controls the
682 "subset="
683 mount option of the
684 "procfs"
685 instance for the unit\&. For further details see
686 \m[blue]\fBThe /proc Filesystem\fR\m[]\&\s-2\u[3]\d\s+2\&. Note that Linux exposes various kernel APIs via
687 /proc/, which are made unavailable with this setting\&. Since these APIs are used frequently this option is useful only in a few, specific cases, and is not suitable for most non\-trivial programs\&.
688 .sp
689 Much like
690 \fIProtectProc=\fR
691 above, this is implemented via file system mount namespacing, and hence the same restrictions apply: it is only available to system services, it disables mount propagation to the host mount table, and it implies
692 \fIMountAPIVFS=\fR\&. Also, like
693 \fIProtectProc=\fR
694 this setting is gracefully disabled if the used kernel does not support the
695 "subset="
696 mount option of
697 "procfs"\&.
698 .sp
699 Added in version 247\&.
700 .RE
701 .PP
702 \fIBindPaths=\fR, \fIBindReadOnlyPaths=\fR
703 .RS 4
704 Configures unit\-specific bind mounts\&. A bind mount makes a particular file or directory available at an additional place in the unit\*(Aqs view of the file system\&. Any bind mounts created with this option are specific to the unit, and are not visible in the host\*(Aqs mount table\&. This option expects a whitespace separated list of bind mount definitions\&. Each definition consists of a colon\-separated triple of source path, destination path and option string, where the latter two are optional\&. If only a source path is specified the source and destination is taken to be the same\&. The option string may be either
705 "rbind"
706 or
707 "norbind"
708 for configuring a recursive or non\-recursive bind mount\&. If the destination path is omitted, the option string must be omitted too\&. Each bind mount definition may be prefixed with
709 "\-", in which case it will be ignored when its source path does not exist or is not accessible\&.
710 .sp
711 \fIBindPaths=\fR
712 creates regular writable bind mounts (unless the source file system mount is already marked read\-only), while
713 \fIBindReadOnlyPaths=\fR
714 creates read\-only bind mounts\&. These settings may be used more than once, each usage appends to the unit\*(Aqs list of bind mounts\&. If the empty string is assigned to either of these two options the entire list of bind mounts defined prior to this is reset\&. Note that, in this case, both read\-only and regular bind mounts are reset, regardless which of the two settings is used\&.
715 .sp
716 Using this option implies that a mount namespace is allocated for the unit, i\&.e\&. it implies the effect of
717 \fIPrivateMounts=\fR
718 (see below)\&.
719 .sp
720 This option is particularly useful when
721 \fIRootDirectory=\fR/\fIRootImage=\fR
722 is used\&. In this case, the source path refers to a path on the host file system, while the destination path refers to a path below the root directory of the unit\&.
723 .sp
724 Note that the destination directory must exist or systemd must be able to create it\&. Thus, it is not possible to use those options for mount points nested underneath paths specified in
725 \fIInaccessiblePaths=\fR, or under
726 /home/
727 and other protected directories if
728 \fIProtectHome=yes\fR
729 is specified\&.
730 \fITemporaryFileSystem=\fR
731 with
732 ":ro"
733 or
734 \fIProtectHome=tmpfs\fR
735 should be used instead\&.
736 .sp
737 Added in version 233\&.
738 .RE
739 .PP
740 \fIMountImages=\fR
741 .RS 4
742 This setting is similar to
743 \fIRootImage=\fR
744 in that it mounts a file system hierarchy from a block device node or loopback file, but the destination directory can be specified as well as mount options\&. This option expects a whitespace separated list of mount definitions\&. Each definition consists of a colon\-separated tuple of source path and destination definitions, optionally followed by another colon and a list of mount options\&.
745 .sp
746 Mount options may be defined as a single comma\-separated list of options, in which case they will be implicitly applied to the root partition on the image, or a series of colon\-separated tuples of partition name and mount options\&. Valid partition names and mount options are the same as for
747 \fIRootImageOptions=\fR
748 setting described above\&.
749 .sp
750 Each mount definition may be prefixed with
751 "\-", in which case it will be ignored when its source path does not exist\&. The source argument is a path to a block device node or regular file\&. If source or destination contain a
752 ":", it needs to be escaped as
753 "\e:"\&. The device node or file system image file needs to follow the same rules as specified for
754 \fIRootImage=\fR\&. Any mounts created with this option are specific to the unit, and are not visible in the host\*(Aqs mount table\&.
755 .sp
756 These settings may be used more than once, each usage appends to the unit\*(Aqs list of mount paths\&. If the empty string is assigned, the entire list of mount paths defined prior to this is reset\&.
757 .sp
758 Note that the destination directory must exist or systemd must be able to create it\&. Thus, it is not possible to use those options for mount points nested underneath paths specified in
759 \fIInaccessiblePaths=\fR, or under
760 /home/
761 and other protected directories if
762 \fIProtectHome=yes\fR
763 is specified\&.
764 .sp
765 When
766 \fIDevicePolicy=\fR
767 is set to
768 "closed"
769 or
770 "strict", or set to
771 "auto"
772 and
773 \fIDeviceAllow=\fR
774 is set, then this setting adds
775 /dev/loop\-control
776 with
777 \fBrw\fR
778 mode,
779 "block\-loop"
780 and
781 "block\-blkext"
782 with
783 \fBrwm\fR
784 mode to
785 \fIDeviceAllow=\fR\&. See
786 \fBsystemd.resource-control\fR(5)
787 for the details about
788 \fIDevicePolicy=\fR
789 or
790 \fIDeviceAllow=\fR\&. Also, see
791 \fIPrivateDevices=\fR
792 below, as it may change the setting of
793 \fIDevicePolicy=\fR\&.
794 .sp
795 When enabled for services running in per\-user instances of the service manager this option implicitly enables
796 \fIPrivateUsers=\fR
797 (requires unprivileged user namespaces support to be enabled in the kernel via the
798 "kernel\&.unprivileged_userns_clone="
799 sysctl) and also relies on
800 \fBsystemd-mountfsd.service\fR(8)\&.
801 .sp
802 When enabled for services running in per\-user instances of the service manager using mount options is disabled by default, due to the security implications\&. It is possible to use a
803 \m[blue]\fBpolkit\fR\m[]\&\s-2\u[2]\d\s+2
804 policy to allow specific mount options, for example:
805 .PP \fBExample\ \&4.\ \&A polkit policy that allows mounting the root partition with nosuid\fR /etc/polkit\-1/rules\&.d/mountoptions\&.rules: .sp .if n \{\ .RS 4 .\} .nf polkit\&.addRule(function(action, subject) { if (action\&.id == "io\&.systemd\&.mount\-file\-system\&.mount\-untrusted\-image\-privately" && action\&.lookup("mount_options") == "root:nosuid") { return polkit\&.Result\&.YES; } }); .fi .if n \{\ .RE .\}
806 .PP
807 \fBExample\ \&5.\ \&A polkit policy that allows mounting the root partition with nosuid\fR
808 /etc/polkit\-1/rules\&.d/mountoptions\&.rules:
809 .sp
810 .if n \{\
811 .RS 4
812 .\}
813 .nf
814 polkit\&.addRule(function(action, subject) {
815 if (action\&.id == "io\&.systemd\&.mount\-file\-system\&.mount\-untrusted\-image\-privately" &&
816 action\&.lookup("mount_options") == "root:nosuid") {
817 return polkit\&.Result\&.YES;
818 }
819 });
820 .fi
821 .if n \{\
822 .RE
823 .\}
824
825 Added in version 247\&.
826 .RE
827 .PP
828 \fIExtensionImages=\fR
829 .RS 4
830 This setting is similar to
831 \fIMountImages=\fR
832 in that it mounts a file system hierarchy from a block device node or loopback file, but instead of providing a destination path, an overlay will be set up\&. This option expects a whitespace separated list of mount definitions\&. Each definition consists of a source path, optionally followed by a colon and a list of mount options\&.
833 .sp
834 A read\-only OverlayFS will be set up on top of
835 /usr/
836 and
837 /opt/
838 hierarchies for sysext images and
839 /etc/
840 hierarchy for confext images\&. The order in which the images are listed will determine the order in which the overlay is laid down: images specified first to last will result in overlayfs layers bottom to top\&.
841 .sp
842 Mount options may be defined as a single comma\-separated list of options, in which case they will be implicitly applied to the root partition on the image, or a series of colon\-separated tuples of partition name and mount options\&. Valid partition names and mount options are the same as for
843 \fIRootImageOptions=\fR
844 setting described above\&.
845 .sp
846 Each mount definition may be prefixed with
847 "\-", in which case it will be ignored when its source path does not exist\&. The source argument is a path to a block device node or regular file\&. If the source path contains a
848 ":", it needs to be escaped as
849 "\e:"\&. The device node or file system image file needs to follow the same rules as specified for
850 \fIRootImage=\fR\&. Any mounts created with this option are specific to the unit, and are not visible in the host\*(Aqs mount table\&.
851 .sp
852 These settings may be used more than once, each usage appends to the unit\*(Aqs list of image paths\&. If the empty string is assigned, the entire list of mount paths defined prior to this is reset\&.
853 .sp
854 Each sysext image must carry a
855 /usr/lib/extension\-release\&.d/extension\-release\&.IMAGE
856 file while each confext image must carry a
857 /etc/extension\-release\&.d/extension\-release\&.IMAGE
858 file, with the appropriate metadata which matches
859 \fIRootImage=\fR/\fIRootDirectory=\fR
860 or the host\&. See:
861 \fBos-release\fR(5)\&. To disable the safety check that the extension\-release file name matches the image file name, the
862 \fIx\-systemd\&.relax\-extension\-release\-check\fR
863 mount option may be appended\&.
864 .sp
865 If a service employs this option with
866 \fBsystemd.v\fR(7), and has
867 \fBRefreshOnReload=extensions\fR
868 enabled (the default), the confexts will be refreshed to pick up any changes on service reload\&. This only applies to confext extensions\&. Note that in case a service has this configuration enabled at first, and then it is subsequently removed in an update followed by a daemon\-reload operation, reloading the confexts will be a no\-op, and a full service restart is required instead\&. See
869 \fBsystemd.service\fR(5)
870 also for details\&.
871 .sp
872 When
873 \fIDevicePolicy=\fR
874 is set to
875 "closed"
876 or
877 "strict", or set to
878 "auto"
879 and
880 \fIDeviceAllow=\fR
881 is set, then this setting adds
882 /dev/loop\-control
883 with
884 \fBrw\fR
885 mode,
886 "block\-loop"
887 and
888 "block\-blkext"
889 with
890 \fBrwm\fR
891 mode to
892 \fIDeviceAllow=\fR\&. See
893 \fBsystemd.resource-control\fR(5)
894 for the details about
895 \fIDevicePolicy=\fR
896 or
897 \fIDeviceAllow=\fR\&. Also, see
898 \fIPrivateDevices=\fR
899 below, as it may change the setting of
900 \fIDevicePolicy=\fR\&.
901 .sp
902 In place of the image path a
903 "\&.v/"
904 versioned directory may be specified, see
905 \fBsystemd.v\fR(7)
906 for details\&.
907 .sp
908 When enabled for services running in per\-user instances of the service manager this option implicitly enables
909 \fIPrivateUsers=\fR
910 (requires unprivileged user namespaces support to be enabled in the kernel via the
911 "kernel\&.unprivileged_userns_clone="
912 sysctl) and also relies on
913 \fBsystemd-mountfsd.service\fR(8)\&.
914 .sp
915 When enabled for services running in per\-user instances of the service manager using mount options is disabled by default, due to the security implications\&. It is possible to use a
916 \m[blue]\fBpolkit\fR\m[]\&\s-2\u[2]\d\s+2
917 policy to allow specific mount options, for example:
918 .PP \fBExample\ \&6.\ \&A polkit policy that allows mounting the root partition with nosuid\fR /etc/polkit\-1/rules\&.d/mountoptions\&.rules: .sp .if n \{\ .RS 4 .\} .nf polkit\&.addRule(function(action, subject) { if (action\&.id == "io\&.systemd\&.mount\-file\-system\&.mount\-untrusted\-image\-privately" && action\&.lookup("mount_options") == "root:nosuid") { return polkit\&.Result\&.YES; } }); .fi .if n \{\ .RE .\}
919 .PP
920 \fBExample\ \&7.\ \&A polkit policy that allows mounting the root partition with nosuid\fR
921 /etc/polkit\-1/rules\&.d/mountoptions\&.rules:
922 .sp
923 .if n \{\
924 .RS 4
925 .\}
926 .nf
927 polkit\&.addRule(function(action, subject) {
928 if (action\&.id == "io\&.systemd\&.mount\-file\-system\&.mount\-untrusted\-image\-privately" &&
929 action\&.lookup("mount_options") == "root:nosuid") {
930 return polkit\&.Result\&.YES;
931 }
932 });
933 .fi
934 .if n \{\
935 .RE
936 .\}
937
938 Added in version 248\&.
939 .RE
940 .PP
941 \fIExtensionDirectories=\fR
942 .RS 4
943 This setting is similar to
944 \fIBindReadOnlyPaths=\fR
945 in that it mounts a file system hierarchy from a directory, but instead of providing a destination path, an overlay will be set up\&. This option expects a whitespace separated list of source directories\&.
946 .sp
947 A read\-only OverlayFS will be set up on top of
948 /usr/
949 and
950 /opt/
951 hierarchies for sysext images and
952 /etc/
953 hierarchy for confext images\&. The order in which the directories are listed will determine the order in which the overlay is laid down: directories specified first to last will result in overlayfs layers bottom to top\&.
954 .sp
955 Each directory listed in
956 \fIExtensionDirectories=\fR
957 may be prefixed with
958 "\-", in which case it will be ignored when its source path does not exist\&. Any mounts created with this option are specific to the unit, and are not visible in the host\*(Aqs mount table\&.
959 .sp
960 These settings may be used more than once, each usage appends to the unit\*(Aqs list of directories paths\&. If the empty string is assigned, the entire list of mount paths defined prior to this is reset\&.
961 .sp
962 Each sysext directory must contain a
963 /usr/lib/extension\-release\&.d/extension\-release\&.IMAGE
964 file while each confext directory must carry a
965 /etc/extension\-release\&.d/extension\-release\&.IMAGE
966 file, with the appropriate metadata which matches
967 \fIRootImage=\fR/\fIRootDirectory=\fR
968 or the host\&. See:
969 \fBos-release\fR(5)\&.
970 .sp
971 If a service employs this option with
972 \fBsystemd.v\fR(7), and has
973 \fBRefreshOnReload=extensions\fR
974 enabled (the default), the confexts will be refreshed to pick up any changes on service reload\&. This only applies to confext extensions\&. Note that in case a service has this configuration enabled at first, and then it is subsequently removed in an update followed by a daemon\-reload operation, reloading the confexts will be a no\-op, and a full service restart is required instead\&. See
975 \fBsystemd.service\fR(5)
976 also for details\&.
977 .sp
978 Note that usage from user units requires overlayfs support in unprivileged user namespaces, which was first introduced in kernel v5\&.11\&.
979 .sp
980 In place of the directory path a
981 "\&.v/"
982 versioned directory may be specified, see
983 \fBsystemd.v\fR(7)
984 for details\&.
985 .sp
986 This option is only available for system services, or for services running in per\-user instances of the service manager in which case
987 \fIPrivateUsers=\fR
988 is implicitly enabled (requires unprivileged user namespaces support to be enabled in the kernel via the
989 "kernel\&.unprivileged_userns_clone="
990 sysctl)\&.
991 .sp
992 Added in version 251\&.
993 .RE
994 .SH "USER/GROUP IDENTITY"
995 .PP
996 These options are only available for system services and are not supported for services running in per\-user instances of the service manager\&.
997 .PP
998 \fIUser=\fR, \fIGroup=\fR
999 .RS 4
1000 Set the UNIX user or group that the processes are executed as, respectively\&. Takes a single user or group name, or a numeric ID as argument\&. For system services (services run by the system service manager, i\&.e\&. managed by PID 1) and for user services of the root user (services managed by root\*(Aqs instance of
1001 \fBsystemd \-\-user\fR), the default is
1002 "root", but
1003 \fIUser=\fR
1004 may be used to specify a different user\&. For user services of any other user, switching user identity is not permitted, hence the only valid setting is the same user the user\*(Aqs service manager is running as\&. If no group is set, the default group of the user is used\&. This setting does not affect commands whose command line is prefixed with
1005 "+"\&.
1006 .sp
1007 Note that this enforces only weak restrictions on the user/group name syntax, but will generate warnings in many cases where user/group names do not adhere to the following rules: the specified name should consist only of the characters a\-z, A\-Z, 0\-9,
1008 "_"
1009 and
1010 "\-", except for the first character which must be one of a\-z, A\-Z and
1011 "_"
1012 (i\&.e\&. digits and
1013 "\-"
1014 are not permitted as first character)\&. The user/group name must have at least one character, and at most 31\&. These restrictions are made in order to avoid ambiguities and to ensure user/group names and unit files remain portable among Linux systems\&. For further details on the names accepted and the names warned about see
1015 \m[blue]\fBUser/Group Name Syntax\fR\m[]\&\s-2\u[4]\d\s+2\&.
1016 .sp
1017 When used in conjunction with
1018 \fIDynamicUser=\fR
1019 the user/group name specified is dynamically allocated at the time the service is started, and released at the time the service is stopped \(em unless it is already allocated statically (see below)\&. If
1020 \fIDynamicUser=\fR
1021 is not used the specified user and group must have been created statically in the user database no later than the moment the service is started, for example using the
1022 \fBsysusers.d\fR(5)
1023 facility, which is applied at boot or package install time\&. If the user does not exist by then program invocation will fail\&.
1024 .sp
1025 If the
1026 \fIUser=\fR
1027 setting is used the supplementary group list is initialized from the specified user\*(Aqs default group list, as defined in the system\*(Aqs user and group database\&. Additional groups may be configured through the
1028 \fISupplementaryGroups=\fR
1029 setting (see below)\&.
1030 .RE
1031 .PP
1032 \fIDynamicUser=\fR
1033 .RS 4
1034 Takes a boolean parameter\&. If set, a UNIX user and group pair is allocated dynamically when the unit is started, and released as soon as it is stopped\&. The user and group will not be added to
1035 /etc/passwd
1036 or
1037 /etc/group, but are managed transiently during runtime\&. The
1038 \fBnss-systemd\fR(8)
1039 glibc NSS module provides integration of these dynamic users/groups into the system\*(Aqs user and group databases\&. The user and group name to use may be configured via
1040 \fIUser=\fR
1041 and
1042 \fIGroup=\fR
1043 (see above)\&. If these options are not used and dynamic user/group allocation is enabled for a unit, the name of the dynamic user/group is implicitly derived from the unit name\&. If the unit name without the type suffix qualifies as valid user name it is used directly, otherwise a name incorporating a hash of it is used\&. If a statically allocated user or group of the configured name already exists, it is used and no dynamic user/group is allocated\&. Note that if
1044 \fIUser=\fR
1045 is specified and the static group with the name exists, then it is required that the static user with the name already exists\&. Similarly, if
1046 \fIGroup=\fR
1047 is specified and the static user with the name exists, then it is required that the static group with the name already exists\&. Dynamic users/groups are allocated from the UID/GID range 61184\&...65519\&. It is recommended to avoid this range for regular system or login users\&. At any point in time each UID/GID from this range is only assigned to zero or one dynamically allocated users/groups in use\&. However, UID/GIDs are recycled after a unit is terminated\&. Care should be taken that any processes running as part of a unit for which dynamic users/groups are enabled do not leave files or directories owned by these users/groups around, as a different unit might get the same UID/GID assigned later on, and thus gain access to these files or directories\&. If
1048 \fIDynamicUser=\fR
1049 is enabled,
1050 \fIRemoveIPC=\fR
1051 is implied (and cannot be turned off)\&. This ensures that the lifetime of IPC objects and temporary files created by the executed processes is bound to the runtime of the service, and hence the lifetime of the dynamic user/group\&. Since
1052 /tmp/
1053 and
1054 /var/tmp/
1055 are usually the only world\-writable directories on a system, unless
1056 \fIPrivateTmp=\fR
1057 is manually set to
1058 "true",
1059 "disconnected"
1060 would be implied\&. This ensures that a unit making use of dynamic user/group allocation cannot leave files around after unit termination\&. Furthermore
1061 \fINoNewPrivileges=\fR
1062 and
1063 \fIRestrictSUIDSGID=\fR
1064 are implicitly enabled (and cannot be disabled), to ensure that processes invoked cannot take benefit or create SUID/SGID files or directories\&. Moreover,
1065 \fIProtectSystem=strict\fR
1066 and
1067 \fIProtectHome=read\-only\fR
1068 are implied, thus prohibiting the service to write to arbitrary file system locations\&. In order to allow the service to write to certain directories, they have to be allow\-listed using
1069 \fIReadWritePaths=\fR, but care must be taken so that UID/GID recycling does not create security issues involving files created by the service\&. Use
1070 \fIRuntimeDirectory=\fR
1071 (see below) in order to assign a writable runtime directory to a service, owned by the dynamic user/group and removed automatically when the unit is terminated\&. Use
1072 \fIStateDirectory=\fR,
1073 \fICacheDirectory=\fR
1074 and
1075 \fILogsDirectory=\fR
1076 in order to assign a set of writable directories for specific purposes to the service in a way that they are protected from vulnerabilities due to UID reuse (see below)\&. If this option is enabled, care should be taken that the unit\*(Aqs processes do not get access to directories outside of these explicitly configured and managed ones\&. Specifically, do not use
1077 \fIBindPaths=\fR
1078 and be careful with
1079 \fBAF_UNIX\fR
1080 file descriptor passing for directory file descriptors, as this would permit processes to create files or directories owned by the dynamic user/group that are not subject to the lifecycle and access guarantees of the service\&. Note that this option is currently incompatible with D\-Bus policies, thus a service using this option may currently not allocate a D\-Bus service name (note that this does not affect calling into other D\-Bus services)\&. Defaults to off\&.
1081 .sp
1082 Added in version 232\&.
1083 .RE
1084 .PP
1085 \fISupplementaryGroups=\fR
1086 .RS 4
1087 Sets the supplementary Unix groups the processes are executed as\&. This takes a space\-separated list of group names or IDs\&. This option may be specified more than once, in which case all listed groups are set as supplementary groups\&. When the empty string is assigned, the list of supplementary groups is reset, and all assignments prior to this one will have no effect\&. In any way, this option does not override, but extends the list of supplementary groups configured in the system group database for the user\&. This does not affect commands prefixed with
1088 "+"\&.
1089 .RE
1090 .PP
1091 \fISetLoginEnvironment=\fR
1092 .RS 4
1093 Takes a boolean parameter that controls whether to set the
1094 \fI$HOME\fR,
1095 \fI$LOGNAME\fR, and
1096 \fI$SHELL\fR
1097 environment variables\&. If not set, this defaults to true if
1098 \fIUser=\fR,
1099 \fIDynamicUser=\fR
1100 or
1101 \fIPAMName=\fR
1102 are set, false otherwise\&. If set to true, the variables will always be set for system services, i\&.e\&. even when the default user
1103 "root"
1104 is used\&. If set to false, the mentioned variables are not set by the service manager, no matter whether
1105 \fIUser=\fR,
1106 \fIDynamicUser=\fR, or
1107 \fIPAMName=\fR
1108 are used or not\&. This option normally has no effect on services of the per\-user service manager, since in that case these variables are typically inherited from user manager\*(Aqs own environment anyway\&.
1109 .sp
1110 Added in version 255\&.
1111 .RE
1112 .PP
1113 \fIPAMName=\fR
1114 .RS 4
1115 Sets the PAM service name to set up a session as\&. If set, the executed process will be registered as a PAM session under the specified service name\&. This is only useful in conjunction with the
1116 \fIUser=\fR
1117 setting, and is otherwise ignored\&. If not set, no PAM session will be opened for the executed processes\&. See
1118 \fBpam\fR(8)
1119 for details\&.
1120 .sp
1121 Note that for each unit making use of this option a PAM session handler process will be maintained as part of the unit and stays around as long as the unit is active, to ensure that appropriate actions can be taken when the unit and hence the PAM session terminates\&. This process is named
1122 "(sd\-pam)"
1123 and is an immediate child process of the unit\*(Aqs main process\&.
1124 .sp
1125 Note that when this option is used for a unit it is very likely (depending on PAM configuration) that the main unit process will be migrated to its own session scope unit when it is activated\&. This process will hence be associated with two units: the unit it was originally started from (and for which
1126 \fIPAMName=\fR
1127 was configured), and the session scope unit\&. Any child processes of that process will however be associated with the session scope unit only\&. This has implications when used in combination with
1128 \fINotifyAccess=\fR\fBall\fR, as these child processes will not be able to affect changes in the original unit through notification messages\&. These messages will be considered belonging to the session scope unit and not the original unit\&. It is hence not recommended to use
1129 \fIPAMName=\fR
1130 in combination with
1131 \fINotifyAccess=\fR\fBall\fR\&.
1132 .sp
1133 If a PAM module interactively requests input (a password or suchlike) it will be attempted to be read from a service credential (as configured via
1134 \fISetCredential=\fR,
1135 \fIImportCredential=\fR
1136 and related calls) under the name
1137 \fIpam\&.authtok\&.\fR\fI\fIpamservice\fR\fR, where
1138 \fIpamservice\fR
1139 is replaced by the PAM service name as configured with
1140 \fIPAMName=\fR\&. (Note that the credential remains accessible for the runtime of the service!) If no matching credential is set, the user is prompted for it interactively via the
1141 \m[blue]\fBPassword Agent\fR\m[]\&\s-2\u[5]\d\s+2
1142 logic\&.
1143 .RE
1144 .SH "CAPABILITIES"
1145 .PP
1146 These options are only available for system services, or for services running in per\-user instances of the service manager in which case
1147 \fIPrivateUsers=\fR
1148 is implicitly enabled (requires unprivileged user namespaces support to be enabled in the kernel via the
1149 "kernel\&.unprivileged_userns_clone="
1150 sysctl)\&.
1151 .PP
1152 \fICapabilityBoundingSet=\fR
1153 .RS 4
1154 Controls which capabilities to include in the capability bounding set for the executed process\&. See
1155 \fBcapabilities\fR(7)
1156 for details\&. Takes a whitespace\-separated list of capability names, e\&.g\&.
1157 \fBCAP_SYS_ADMIN\fR,
1158 \fBCAP_DAC_OVERRIDE\fR,
1159 \fBCAP_SYS_PTRACE\fR\&. Capabilities listed will be included in the bounding set, all others are removed\&. If the list of capabilities is prefixed with
1160 "~", all but the listed capabilities will be included, the effect of the assignment inverted\&. Note that this option also affects the respective capabilities in the effective, permitted and inheritable capability sets\&. If this option is not used, the capability bounding set is not modified on process execution, hence no limits on the capabilities of the process are enforced\&. This option may appear more than once, in which case the bounding sets are merged by
1161 \fBOR\fR, or by
1162 \fBAND\fR
1163 if the lines are prefixed with
1164 "~"
1165 (see below)\&. If the empty string is assigned to this option, the bounding set is reset to the empty capability set, and all prior settings have no effect\&. If set to
1166 "~"
1167 (without any further argument), the bounding set is reset to the full set of available capabilities, also undoing any previous settings\&. This does not affect commands prefixed with
1168 "+"\&.
1169 .sp
1170 Use
1171 \fBsystemd-analyze\fR(1)\*(Aqs
1172 \fBcapability\fR
1173 command to retrieve a list of capabilities defined on the local system\&.
1174 .sp
1175 Example: if a unit has the following,
1176 .sp
1177 .if n \{\
1178 .RS 4
1179 .\}
1180 .nf
1181 CapabilityBoundingSet=CAP_A CAP_B
1182 CapabilityBoundingSet=CAP_B CAP_C
1183 .fi
1184 .if n \{\
1185 .RE
1186 .\}
1187 .sp
1188 then
1189 \fBCAP_A\fR,
1190 \fBCAP_B\fR, and
1191 \fBCAP_C\fR
1192 are set\&. If the second line is prefixed with
1193 "~", e\&.g\&.,
1194 .sp
1195 .if n \{\
1196 .RS 4
1197 .\}
1198 .nf
1199 CapabilityBoundingSet=CAP_A CAP_B
1200 CapabilityBoundingSet=~CAP_B CAP_C
1201 .fi
1202 .if n \{\
1203 .RE
1204 .\}
1205 .sp
1206 then, only
1207 \fBCAP_A\fR
1208 is set\&.
1209 .RE
1210 .PP
1211 \fIAmbientCapabilities=\fR
1212 .RS 4
1213 Controls which capabilities to include in the ambient capability set for the executed process\&. Takes a whitespace\-separated list of capability names, e\&.g\&.
1214 \fBCAP_SYS_ADMIN\fR,
1215 \fBCAP_DAC_OVERRIDE\fR,
1216 \fBCAP_SYS_PTRACE\fR\&. This option may appear more than once, in which case the ambient capability sets are merged (see the above examples in
1217 \fICapabilityBoundingSet=\fR)\&. If the list of capabilities is prefixed with
1218 "~", all but the listed capabilities will be included, the effect of the assignment inverted\&. If the empty string is assigned to this option, the ambient capability set is reset to the empty capability set, and all prior settings have no effect\&. If set to
1219 "~"
1220 (without any further argument), the ambient capability set is reset to the full set of available capabilities, also undoing any previous settings\&. Note that adding capabilities to the ambient capability set adds them to the process\*(Aqs inherited capability set\&.
1221 .sp
1222 Ambient capability sets are useful if you want to execute a process as a non\-privileged user but still want to give it some capabilities\&. Note that, in this case, option
1223 \fBkeep\-caps\fR
1224 is automatically added to
1225 \fISecureBits=\fR
1226 to retain the capabilities over the user change\&.
1227 \fIAmbientCapabilities=\fR
1228 does not affect commands prefixed with
1229 "+"\&.
1230 .sp
1231 Added in version 229\&.
1232 .RE
1233 .SH "SECURITY"
1234 .PP
1235 \fINoNewPrivileges=\fR
1236 .RS 4
1237 Takes a boolean argument\&. If true, ensures that the service process and all its children can never gain new privileges through
1238 \fBexecve()\fR
1239 (e\&.g\&. via setuid or setgid bits, or filesystem capabilities)\&. This is the simplest and most effective way to ensure that a process and its children can never elevate privileges again\&. Defaults to false\&. In case the service will be run in a new mount namespace anyway and SELinux is disabled, all file systems are mounted with
1240 \fBMS_NOSUID\fR
1241 flag\&. Also see
1242 \m[blue]\fBNo New Privileges Flag\fR\m[]\&\s-2\u[6]\d\s+2\&.
1243 .sp
1244 Note that this setting only has an effect on the unit\*(Aqs processes themselves (or any processes directly or indirectly forked off them)\&. It has no effect on processes potentially invoked on request of them through tools such as
1245 \fBat\fR(1),
1246 \fBcrontab\fR(1),
1247 \fBsystemd-run\fR(1), or arbitrary IPC services\&.
1248 .sp
1249 Added in version 187\&.
1250 .RE
1251 .PP
1252 \fISecureBits=\fR
1253 .RS 4
1254 Controls the secure bits set for the executed process\&. Takes a space\-separated combination of options from the following list:
1255 \fBkeep\-caps\fR,
1256 \fBkeep\-caps\-locked\fR,
1257 \fBno\-setuid\-fixup\fR,
1258 \fBno\-setuid\-fixup\-locked\fR,
1259 \fBnoroot\fR, and
1260 \fBnoroot\-locked\fR\&. This option may appear more than once, in which case the secure bits are ORed\&. If the empty string is assigned to this option, the bits are reset to 0\&. This does not affect commands prefixed with
1261 "+"\&. See
1262 \fBcapabilities\fR(7)
1263 for details\&.
1264 .RE
1265 .SH "MANDATORY ACCESS CONTROL"
1266 .PP
1267 \fISELinuxContext=\fR
1268 .RS 4
1269 Set the SELinux security context of the executed process\&. If set, this will override the automated domain transition\&. However, the policy still needs to authorize the transition\&. This directive is ignored if SELinux is disabled\&. If prefixed by
1270 "\-", failing to set the SELinux security context will be ignored, but it is still possible that the subsequent
1271 \fBexecve()\fR
1272 may fail if the policy does not allow the transition for the non\-overridden context\&. This does not affect commands prefixed with
1273 "+"\&. See
1274 \fBsetexeccon\fR(3)
1275 for details\&.
1276 .sp
1277 Added in version 209\&.
1278 .RE
1279 .PP
1280 \fIAppArmorProfile=\fR
1281 .RS 4
1282 Takes a profile name as argument\&. The process executed by the unit will switch to this profile when started\&. Profiles must already be loaded in the kernel, or the unit will fail\&. If prefixed by
1283 "\-", all errors will be ignored\&. This setting has no effect if AppArmor is not enabled\&. This setting does not affect commands prefixed with
1284 "+"\&.
1285 .sp
1286 This option is only available for system services and is not supported for services running in per\-user instances of the service manager\&.
1287 .sp
1288 Added in version 210\&.
1289 .RE
1290 .PP
1291 \fISmackProcessLabel=\fR
1292 .RS 4
1293 Takes a
1294 \fBSMACK64\fR
1295 security label as argument\&. The process executed by the unit will be started under this label and SMACK will decide whether the process is allowed to run or not, based on it\&. The process will continue to run under the label specified here unless the executable has its own
1296 \fBSMACK64EXEC\fR
1297 label, in which case the process will transition to run under that label\&. When not specified, the label that systemd is running under is used\&. This directive is ignored if SMACK is disabled\&.
1298 .sp
1299 The value may be prefixed by
1300 "\-", in which case all errors will be ignored\&. An empty value may be specified to unset previous assignments\&. This does not affect commands prefixed with
1301 "+"\&.
1302 .sp
1303 This option is only available for system services and is not supported for services running in per\-user instances of the service manager\&.
1304 .sp
1305 Added in version 218\&.
1306 .RE
1307 .SH "PROCESS PROPERTIES"
1308 .PP
1309 \fILimitCPU=\fR, \fILimitFSIZE=\fR, \fILimitDATA=\fR, \fILimitSTACK=\fR, \fILimitCORE=\fR, \fILimitRSS=\fR, \fILimitNOFILE=\fR, \fILimitAS=\fR, \fILimitNPROC=\fR, \fILimitMEMLOCK=\fR, \fILimitLOCKS=\fR, \fILimitSIGPENDING=\fR, \fILimitMSGQUEUE=\fR, \fILimitNICE=\fR, \fILimitRTPRIO=\fR, \fILimitRTTIME=\fR
1310 .RS 4
1311 Set soft and hard limits on various resources for executed processes\&. See
1312 \fBsetrlimit\fR(2)
1313 for details on the process resource limit concept\&. Process resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon\-separated pair
1314 \fBsoft:hard\fR
1315 to set both limits individually (e\&.g\&.
1316 "LimitAS=4G:16G")\&. Use the string
1317 \fBinfinity\fR
1318 to configure no limit on a specific resource\&. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e\&.g\&.
1319 "LimitAS=16G")\&. For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see
1320 \fBsystemd.time\fR(7)
1321 for details)\&. Note that if no time unit is specified for
1322 \fILimitCPU=\fR
1323 the default unit of seconds is implied, while for
1324 \fILimitRTTIME=\fR
1325 the default unit of microseconds is implied\&. Also, note that the effective granularity of the limits might influence their enforcement\&. For example, time limits specified for
1326 \fILimitCPU=\fR
1327 will be rounded up implicitly to multiples of 1s\&. For
1328 \fILimitNICE=\fR
1329 the value may be specified in two syntaxes: if prefixed with
1330 "+"
1331 or
1332 "\-", the value is understood as regular Linux nice value in the range \-20\&...19\&. If not prefixed like this the value is understood as raw resource limit parameter in the range 0\&...40 (with 0 being equivalent to 1)\&.
1333 .sp
1334 Note that most process resource limits configured with these options are per\-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set\&. Also note that
1335 \fILimitRSS=\fR
1336 is not implemented on Linux, and setting it has no effect\&. Often it is advisable to prefer the resource controls listed in
1337 \fBsystemd.resource-control\fR(5)
1338 over these per\-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive\&. For example,
1339 \fIMemoryMax=\fR
1340 is a more powerful (and working) replacement for
1341 \fILimitRSS=\fR\&.
1342 .sp
1343 Note that
1344 \fILimitNPROC=\fR
1345 will limit the number of processes from one (real) UID and not the number of processes started (forked) by the service\&. Therefore the limit is cumulative for all processes running under the same UID\&. Please also note that the
1346 \fILimitNPROC=\fR
1347 will not be enforced if the service is running as root (and not dropping privileges)\&. Due to these limitations,
1348 \fITasksMax=\fR
1349 (see
1350 \fBsystemd.resource-control\fR(5)) is typically a better choice than
1351 \fILimitNPROC=\fR\&.
1352 .sp
1353 Resource limits not configured explicitly for a unit default to the value configured in the various
1354 \fIDefaultLimitCPU=\fR,
1355 \fIDefaultLimitFSIZE=\fR, \&... options available in
1356 \fBsystemd-system.conf\fR(5), and \(en if not configured there \(en the kernel or per\-user defaults, as defined by the OS (the latter only for user services, see below)\&.
1357 .sp
1358 For system units these resource limits may be chosen freely\&. When these settings are configured in a user service (i\&.e\&. a service run by the per\-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user\*(Aqs service manager generally lacks the privileges to do so\&. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user\&. To raise the user\*(Aqs limits further, the available configuration mechanisms differ between operating systems, but typically require privileges\&. In most cases it is possible to configure higher per\-user resource limits via PAM or by setting limits on the system service encapsulating the user\*(Aqs service manager, i\&.e\&. the user\*(Aqs instance of
1359 user@\&.service\&. After making such changes, make sure to restart the user\*(Aqs service manager\&.
1360 .sp
1361 .it 1 an-trap
1362 .nr an-no-space-flag 1
1363 .nr an-break-flag 1
1364 .br
1365 .B Table\ \&1.\ \&Resource limit directives, their equivalent ulimit shell commands and the unit used
1366 .TS
1367 allbox tab(:);
1368 lB lB lB lB.
1369 T{
1370 Directive
1371 T}:T{
1372 \fBulimit\fR equivalent
1373 T}:T{
1374 Unit
1375 T}:T{
1376 Notes
1377 T}
1378 .T&
1379 l l l l
1380 l l l l
1381 l l l l
1382 l l l l
1383 l l l l
1384 l l l l
1385 l l l l
1386 l l l l
1387 l l l l
1388 l l l l
1389 l l l l
1390 l l l l
1391 l l l l
1392 l l l l
1393 l l l l
1394 l l l l.
1395 T{
1396 LimitCPU=
1397 T}:T{
1398 ulimit \-t
1399 T}:T{
1400 Seconds
1401 T}:T{
1402 \-
1403 T}
1404 T{
1405 LimitFSIZE=
1406 T}:T{
1407 ulimit \-f
1408 T}:T{
1409 Bytes
1410 T}:T{
1411 \-
1412 T}
1413 T{
1414 LimitDATA=
1415 T}:T{
1416 ulimit \-d
1417 T}:T{
1418 Bytes
1419 T}:T{
1420 Do not use\&. This limits the allowed address range, not memory use! Defaults to unlimited and should not be lowered\&. To limit memory use, see \fIMemoryMax=\fR in \fBsystemd.resource-control\fR(5)\&.
1421 T}
1422 T{
1423 LimitSTACK=
1424 T}:T{
1425 ulimit \-s
1426 T}:T{
1427 Bytes
1428 T}:T{
1429 \-
1430 T}
1431 T{
1432 LimitCORE=
1433 T}:T{
1434 ulimit \-c
1435 T}:T{
1436 Bytes
1437 T}:T{
1438 \-
1439 T}
1440 T{
1441 LimitRSS=
1442 T}:T{
1443 ulimit \-m
1444 T}:T{
1445 Bytes
1446 T}:T{
1447 Do not use\&. No effect on Linux\&.
1448 T}
1449 T{
1450 LimitNOFILE=
1451 T}:T{
1452 ulimit \-n
1453 T}:T{
1454 Number of File Descriptors
1455 T}:T{
1456 Do not use\&. Be careful when raising the soft limit above 1024, since \fBselect\fR(2) cannot function with file descriptors above 1023 on Linux\&. Nowadays, the hard limit defaults to 524288, a very high value compared to historical defaults\&. Typically applications should increase their soft limit to the hard limit on their own, if they are OK with working with file descriptors above 1023, i\&.e\&. do not use \fBselect\fR(2)\&. Note that file descriptors are nowadays accounted like any other form of memory, thus there should not be any need to lower the hard limit\&. Use \fIMemoryMax=\fR to control overall service memory use, including file descriptor memory\&.
1457 T}
1458 T{
1459 LimitAS=
1460 T}:T{
1461 ulimit \-v
1462 T}:T{
1463 Bytes
1464 T}:T{
1465 Do not use\&. This limits the allowed address range, not memory use! Defaults to unlimited and should not be lowered\&. To limit memory use, see \fIMemoryMax=\fR in \fBsystemd.resource-control\fR(5)\&.
1466 T}
1467 T{
1468 LimitNPROC=
1469 T}:T{
1470 ulimit \-u
1471 T}:T{
1472 Number of Processes
1473 T}:T{
1474 This limit is enforced based on the number of processes belonging to the user\&. Typically it is better to track processes per service, i\&.e\&. use \fITasksMax=\fR, see \fBsystemd.resource-control\fR(5)\&.
1475 T}
1476 T{
1477 LimitMEMLOCK=
1478 T}:T{
1479 ulimit \-l
1480 T}:T{
1481 Bytes
1482 T}:T{
1483 \-
1484 T}
1485 T{
1486 LimitLOCKS=
1487 T}:T{
1488 ulimit \-x
1489 T}:T{
1490 Number of Locks
1491 T}:T{
1492 \-
1493 T}
1494 T{
1495 LimitSIGPENDING=
1496 T}:T{
1497 ulimit \-i
1498 T}:T{
1499 Number of Queued Signals
1500 T}:T{
1501 \-
1502 T}
1503 T{
1504 LimitMSGQUEUE=
1505 T}:T{
1506 ulimit \-q
1507 T}:T{
1508 Bytes
1509 T}:T{
1510 \-
1511 T}
1512 T{
1513 LimitNICE=
1514 T}:T{
1515 ulimit \-e
1516 T}:T{
1517 Nice Level
1518 T}:T{
1519 \-
1520 T}
1521 T{
1522 LimitRTPRIO=
1523 T}:T{
1524 ulimit \-r
1525 T}:T{
1526 Realtime Priority
1527 T}:T{
1528 \-
1529 T}
1530 T{
1531 LimitRTTIME=
1532 T}:T{
1533 ulimit \-R
1534 T}:T{
1535 Microseconds
1536 T}:T{
1537 \-
1538 T}
1539 .TE
1540 .sp 1
1541 .RE
1542 .PP
1543 \fIUMask=\fR
1544 .RS 4
1545 Controls the file mode creation mask\&. Takes an access mode in octal notation\&. See
1546 \fBumask\fR(2)
1547 for details\&. Defaults to 0022 for system units\&. For user units the default value is inherited from the per\-user service manager (whose default is in turn inherited from the system service manager, and thus typically also is 0022 \(em unless overridden by a PAM module)\&. In order to change the per\-user mask for all user services, consider setting the
1548 \fIUMask=\fR
1549 setting of the user\*(Aqs
1550 user@\&.service
1551 system service instance\&. The per\-user umask may also be set via the
1552 \fIumask\fR
1553 field of a user\*(Aqs
1554 \m[blue]\fBJSON User Record\fR\m[]\&\s-2\u[7]\d\s+2
1555 (for users managed by
1556 \fBsystemd-homed.service\fR(8)
1557 this field may be controlled via
1558 \fBhomectl \-\-umask=\fR)\&. It may also be set via a PAM module, such as
1559 \fBpam_umask\fR(8)\&.
1560 .RE
1561 .PP
1562 \fICoredumpFilter=\fR
1563 .RS 4
1564 Controls which types of memory mappings will be saved if the process dumps core (using the
1565 /proc/\fIpid\fR/coredump_filter
1566 file)\&. Takes a whitespace\-separated combination of mapping type names or numbers (with the default base 16)\&. Mapping type names are
1567 \fBprivate\-anonymous\fR,
1568 \fBshared\-anonymous\fR,
1569 \fBprivate\-file\-backed\fR,
1570 \fBshared\-file\-backed\fR,
1571 \fBelf\-headers\fR,
1572 \fBprivate\-huge\fR,
1573 \fBshared\-huge\fR,
1574 \fBprivate\-dax\fR,
1575 \fBshared\-dax\fR, and the special values
1576 \fBall\fR
1577 (all types) and
1578 \fBdefault\fR
1579 (the kernel default of
1580 "\fBprivate\-anonymous\fR \fBshared\-anonymous\fR \fBelf\-headers\fR \fBprivate\-huge\fR")\&. See
1581 \fBcore\fR(5)
1582 for the meaning of the mapping types\&. When specified multiple times, all specified masks are ORed\&. When not set, or if the empty value is assigned, the inherited value is not changed\&.
1583 .PP
1584 \fBExample\ \&8.\ \&Add DAX pages to the dump filter\fR
1585 .sp
1586 .if n \{\
1587 .RS 4
1588 .\}
1589 .nf
1590 CoredumpFilter=default private\-dax shared\-dax
1591 .fi
1592 .if n \{\
1593 .RE
1594 .\}
1595
1596 Added in version 246\&.
1597 .RE
1598 .PP
1599 \fIKeyringMode=\fR
1600 .RS 4
1601 Controls how the kernel session keyring is set up for the service (see
1602 \fBsession-keyring\fR(7)
1603 for details on the session keyring)\&. Takes one of
1604 \fBinherit\fR,
1605 \fBprivate\fR,
1606 \fBshared\fR\&. If set to
1607 \fBinherit\fR
1608 no special keyring setup is done, and the kernel\*(Aqs default behaviour is applied\&. If
1609 \fBprivate\fR
1610 is used a new session keyring is allocated when a service process is invoked, and it is not linked up with any user keyring\&. This is the recommended setting for system services, as this ensures that multiple services running under the same system user ID (in particular the root user) do not share their key material among each other\&. If
1611 \fBshared\fR
1612 is used a new session keyring is allocated as for
1613 \fBprivate\fR, but the user keyring of the user configured with
1614 \fIUser=\fR
1615 is linked into it, so that keys assigned to the user may be requested by the unit\*(Aqs processes\&. In this mode multiple units running processes under the same user ID may share key material\&. Unless
1616 \fBinherit\fR
1617 is selected the unique invocation ID for the unit (see below) is added as a protected key by the name
1618 "invocation_id"
1619 to the newly created session keyring\&. Defaults to
1620 \fBprivate\fR
1621 for services of the system service manager and to
1622 \fBinherit\fR
1623 for non\-service units and for services of the user service manager\&.
1624 .sp
1625 Added in version 235\&.
1626 .RE
1627 .PP
1628 \fIOOMScoreAdjust=\fR
1629 .RS 4
1630 Sets the adjustment value for the Linux kernel\*(Aqs Out\-Of\-Memory (OOM) killer score for executed processes\&. Takes an integer between \-1000 (to disable OOM killing of processes of this unit) and 1000 (to make killing of processes of this unit under memory pressure very likely)\&. See
1631 \m[blue]\fBThe /proc Filesystem\fR\m[]\&\s-2\u[8]\d\s+2
1632 for details\&. If not specified, defaults to the OOM score adjustment level of the service manager itself, which is normally at 0\&.
1633 .sp
1634 Use the
1635 \fIOOMPolicy=\fR
1636 setting of service units to configure how the service manager shall react to the kernel OOM killer or
1637 \fBsystemd\-oomd\fR
1638 terminating a process of the service\&. See
1639 \fBsystemd.service\fR(5)
1640 for details\&.
1641 .RE
1642 .PP
1643 \fITimerSlackNSec=\fR
1644 .RS 4
1645 Sets the timer slack in nanoseconds for the executed processes\&. The timer slack controls the accuracy of wake\-ups triggered by timers\&. See
1646 \fBprctl\fR(2)
1647 for more information\&. Note that in contrast to most other time span definitions this parameter takes an integer value in nano\-seconds if no unit is specified\&. The usual time units are understood too\&.
1648 .RE
1649 .PP
1650 \fIPersonality=\fR
1651 .RS 4
1652 Controls which kernel architecture
1653 \fBuname\fR(2)
1654 shall report, when invoked by unit processes\&. Takes one of the architecture identifiers
1655 \fBarm64\fR,
1656 \fBarm64\-be\fR,
1657 \fBarm\fR,
1658 \fBarm\-be\fR,
1659 \fBx86\fR,
1660 \fBx86\-64\fR,
1661 \fBppc\fR,
1662 \fBppc\-le\fR,
1663 \fBppc64\fR,
1664 \fBppc64\-le\fR,
1665 \fBs390\fR
1666 or
1667 \fBs390x\fR\&. Which personality architectures are supported depends on the kernel\*(Aqs native architecture\&. Usually the 64\-bit versions of the various system architectures support their immediate 32\-bit personality architecture counterpart, but no others\&. For example,
1668 \fBx86\-64\fR
1669 systems support the
1670 \fBx86\-64\fR
1671 and
1672 \fBx86\fR
1673 personalities but no others\&. The personality feature is useful when running 32\-bit services on a 64\-bit host system\&. If not specified, the personality is left unmodified and thus reflects the personality of the host system\*(Aqs kernel\&. This option is not useful on architectures for which only one native word width was ever available, such as
1674 \fBm68k\fR
1675 (32\-bit only) or
1676 \fBalpha\fR
1677 (64\-bit only)\&.
1678 .sp
1679 Added in version 209\&.
1680 .RE
1681 .PP
1682 \fIIgnoreSIGPIPE=\fR
1683 .RS 4
1684 Takes a boolean argument\&. If true,
1685 \fBSIGPIPE\fR
1686 is ignored in the executed process\&. Defaults to true since
1687 \fBSIGPIPE\fR
1688 is generally only useful in shell pipelines\&.
1689 .RE
1690 .SH "SCHEDULING"
1691 .PP
1692 \fINice=\fR
1693 .RS 4
1694 Sets the default nice level (scheduling priority) for executed processes\&. Takes an integer between \-20 (highest priority) and 19 (lowest priority)\&. In case of resource contention, smaller values mean more resources will be made available to the unit\*(Aqs processes, larger values mean less resources will be made available\&. See
1695 \fBsetpriority\fR(2)
1696 for details\&.
1697 .RE
1698 .PP
1699 \fICPUSchedulingPolicy=\fR
1700 .RS 4
1701 Sets the CPU scheduling policy for executed processes\&. Takes one of
1702 \fBother\fR,
1703 \fBbatch\fR,
1704 \fBidle\fR,
1705 \fBfifo\fR,
1706 \fBrr\fR
1707 or
1708 \fBext\fR\&. See
1709 \fBsched_setscheduler\fR(2)
1710 for details\&.
1711 .RE
1712 .PP
1713 \fICPUSchedulingPriority=\fR
1714 .RS 4
1715 Sets the CPU scheduling priority for executed processes\&. The available priority range depends on the selected CPU scheduling policy (see above)\&. For real\-time scheduling policies an integer between 1 (lowest priority) and 99 (highest priority) can be used\&. In case of CPU resource contention, smaller values mean less CPU time is made available to the service, larger values mean more\&. See
1716 \fBsched_setscheduler\fR(2)
1717 for details\&.
1718 .RE
1719 .PP
1720 \fICPUSchedulingResetOnFork=\fR
1721 .RS 4
1722 Takes a boolean argument\&. If true, elevated CPU scheduling priorities and policies will be reset when the executed processes call
1723 \fBfork\fR(2), and can hence not leak into child processes\&. See
1724 \fBsched_setscheduler\fR(2)
1725 for details\&. Defaults to false\&.
1726 .RE
1727 .PP
1728 \fICPUAffinity=\fR
1729 .RS 4
1730 Controls the CPU affinity of the executed processes\&. Takes a list of CPU indices or ranges separated by either whitespace or commas\&. Alternatively, takes a special "numa" value in which case systemd automatically derives allowed CPU range based on the value of
1731 \fINUMAMask=\fR
1732 option\&. CPU ranges are specified by the lower and upper CPU indices separated by a dash\&. This option may be specified more than once, in which case the specified CPU affinity masks are merged\&. If the empty string is assigned, the mask is reset, all assignments prior to this will have no effect\&. See
1733 \fBsched_setaffinity\fR(2)
1734 for details\&.
1735 .RE
1736 .PP
1737 \fINUMAPolicy=\fR
1738 .RS 4
1739 Controls the NUMA memory policy of the executed processes\&. Takes a policy type, one of:
1740 \fBdefault\fR,
1741 \fBpreferred\fR,
1742 \fBbind\fR,
1743 \fBinterleave\fR
1744 and
1745 \fBlocal\fR\&. A list of NUMA nodes that should be associated with the policy must be specified in
1746 \fINUMAMask=\fR\&. For more details on each policy please see,
1747 \fBset_mempolicy\fR(2)\&. For overall overview of NUMA support in Linux see,
1748 \fBnuma\fR(7)\&.
1749 .sp
1750 Added in version 243\&.
1751 .RE
1752 .PP
1753 \fINUMAMask=\fR
1754 .RS 4
1755 Controls the NUMA node list which will be applied alongside with selected NUMA policy\&. Takes a list of NUMA nodes and has the same syntax as a list of CPUs for
1756 \fICPUAffinity=\fR
1757 option or special "all" value which will include all available NUMA nodes in the mask\&. Note that the list of NUMA nodes is not required for
1758 \fBdefault\fR
1759 and
1760 \fBlocal\fR
1761 policies and for
1762 \fBpreferred\fR
1763 policy we expect a single NUMA node\&.
1764 .sp
1765 Added in version 243\&.
1766 .RE
1767 .PP
1768 \fIIOSchedulingClass=\fR
1769 .RS 4
1770 Sets the I/O scheduling class for executed processes\&. Takes one of the strings
1771 \fBrealtime\fR,
1772 \fBbest\-effort\fR
1773 or
1774 \fBidle\fR\&. The kernel\*(Aqs default scheduling class is
1775 \fBbest\-effort\fR
1776 at a priority of 4\&. If the empty string is assigned to this option, all prior assignments to both
1777 \fIIOSchedulingClass=\fR
1778 and
1779 \fIIOSchedulingPriority=\fR
1780 have no effect\&. See
1781 \fBioprio_set\fR(2)
1782 for details\&.
1783 .RE
1784 .PP
1785 \fIIOSchedulingPriority=\fR
1786 .RS 4
1787 Sets the I/O scheduling priority for executed processes\&. Takes an integer between 0 (highest priority) and 7 (lowest priority)\&. In case of I/O contention, smaller values mean more I/O bandwidth is made available to the unit\*(Aqs processes, larger values mean less bandwidth\&. The available priorities depend on the selected I/O scheduling class (see above)\&. If the empty string is assigned to this option, all prior assignments to both
1788 \fIIOSchedulingClass=\fR
1789 and
1790 \fIIOSchedulingPriority=\fR
1791 have no effect\&. For the kernel\*(Aqs default scheduling class (\fBbest\-effort\fR) this defaults to 4\&. See
1792 \fBioprio_set\fR(2)
1793 for details\&.
1794 .RE
1795 .SH "SANDBOXING"
1796 .PP
1797 The following sandboxing options are an effective way to limit the exposure of the system towards the unit\*(Aqs processes\&. It is recommended to turn on as many of these options for each unit as is possible without negatively affecting the process\*(Aq ability to operate\&. Note that many of these sandboxing features are gracefully turned off on systems where the underlying security mechanism is not available\&. For example,
1798 \fIProtectSystem=\fR
1799 has no effect if the kernel is built without file system namespacing or if the service manager runs in a container manager that makes file system namespacing unavailable to its payload\&. Similarly,
1800 \fIRestrictRealtime=\fR
1801 has no effect on systems that lack support for SECCOMP system call filtering, or in containers where support for this is turned off\&.
1802 .PP
1803 Also note that some sandboxing functionality is generally not available in user services (i\&.e\&. services run by the per\-user service manager)\&. Specifically, the various settings requiring file system namespacing support (such as
1804 \fIProtectSystem=\fR) are not available, as the underlying kernel functionality is only accessible to privileged processes\&. However, most namespacing settings, that will not work on their own in user services, will work when used in conjunction with
1805 \fIPrivateUsers=\fR\fBtrue\fR\&.
1806 .PP
1807 Note that the various options that turn directories read\-only (such as
1808 \fIProtectSystem=\fR,
1809 \fIReadOnlyPaths=\fR, \&...) do not affect the ability for programs to connect to and communicate with
1810 \fBAF_UNIX\fR
1811 sockets in these directories\&. These options cannot be used to lock down access to IPC services hence\&.
1812 .PP
1813 \fIProtectSystem=\fR
1814 .RS 4
1815 Takes a boolean argument or the special values
1816 "full"
1817 or
1818 "strict"\&. If true, mounts the
1819 /usr/
1820 and the boot loader directories (/boot
1821 and
1822 /efi) read\-only for processes invoked by this unit\&. If set to
1823 "full", the
1824 /etc/
1825 directory is mounted read\-only, too\&. If set to
1826 "strict"
1827 the entire file system hierarchy is mounted read\-only, except for the API file system subtrees
1828 /dev/,
1829 /proc/
1830 and
1831 /sys/
1832 (protect these directories using
1833 \fIPrivateDevices=\fR,
1834 \fIProtectKernelTunables=\fR,
1835 \fIProtectControlGroups=\fR)\&. This setting ensures that any modification of the vendor\-supplied operating system (and optionally its configuration, and local mounts) is prohibited for the service\&. It is recommended to enable this setting for all long\-running services, unless they are involved with system updates or need to modify the operating system in other ways\&. If this option is used,
1836 \fIReadWritePaths=\fR
1837 may be used to exclude specific directories from being made read\-only\&. Similar,
1838 \fIStateDirectory=\fR,
1839 \fILogsDirectory=\fR, \&... and related directory settings (see below) also exclude the specific directories from the effect of
1840 \fIProtectSystem=\fR\&. This setting is implied if
1841 \fIDynamicUser=\fR
1842 is set\&. This setting cannot ensure protection in all cases\&. In general it has the same limitations as
1843 \fIReadOnlyPaths=\fR, see below\&. Defaults to off\&.
1844 .sp
1845 Note that if
1846 \fIProtectSystem=\fR
1847 is set to
1848 "strict"
1849 and
1850 \fIPrivateTmp=\fR
1851 is enabled, then
1852 /tmp/
1853 and
1854 /var/tmp/
1855 will be writable\&.
1856 .sp
1857 Added in version 214\&.
1858 .RE
1859 .PP
1860 \fIProtectHome=\fR
1861 .RS 4
1862 Takes a boolean argument or the special values
1863 "read\-only"
1864 or
1865 "tmpfs"\&. If true, the directories
1866 /home/,
1867 /root, and
1868 /run/user
1869 are made inaccessible and empty for processes invoked by this unit\&. If set to
1870 "read\-only", the three directories are made read\-only instead\&. If set to
1871 "tmpfs", temporary file systems are mounted on the three directories in read\-only mode\&. The value
1872 "tmpfs"
1873 is useful to hide home directories not relevant to the processes invoked by the unit, while still allowing necessary directories to be made visible when listed in
1874 \fIBindPaths=\fR
1875 or
1876 \fIBindReadOnlyPaths=\fR\&.
1877 .sp
1878 Setting this to
1879 "yes"
1880 is mostly equivalent to setting the three directories in
1881 \fIInaccessiblePaths=\fR\&. Similarly,
1882 "read\-only"
1883 is mostly equivalent to
1884 \fIReadOnlyPaths=\fR, and
1885 "tmpfs"
1886 is mostly equivalent to
1887 \fITemporaryFileSystem=\fR
1888 with
1889 ":ro"\&.
1890 .sp
1891 It is recommended to enable this setting for all long\-running services (in particular network\-facing ones), to ensure they cannot get access to private user data, unless the services actually require access to the user\*(Aqs private data\&. This setting is implied if
1892 \fIDynamicUser=\fR
1893 is set\&. This setting cannot ensure protection in all cases\&. In general it has the same limitations as
1894 \fIReadOnlyPaths=\fR, see below\&.
1895 .sp
1896 Note that this setting provides no protection if home directories are placed at a non\-standard location, i\&.e\&. outside of the hierarchies listed above\&.
1897 .sp
1898 This option is only available for system services, or for services running in per\-user instances of the service manager in which case
1899 \fIPrivateUsers=\fR
1900 is implicitly enabled (requires unprivileged user namespaces support to be enabled in the kernel via the
1901 "kernel\&.unprivileged_userns_clone="
1902 sysctl)\&.
1903 .sp
1904 Added in version 214\&.
1905 .RE
1906 .PP
1907 \fIRuntimeDirectory=\fR, \fIStateDirectory=\fR, \fICacheDirectory=\fR, \fILogsDirectory=\fR, \fIConfigurationDirectory=\fR
1908 .RS 4
1909 These options take a whitespace\-separated list of directory names\&. The specified directory names must be relative, and may not include
1910 "\&.\&."\&. If set, when the unit is started, one or more directories by the specified names will be created (including their parents) below the locations defined in the following table\&. Also, the corresponding environment variable will be defined with the full paths of the directories\&. If multiple directories are set, then in the environment variable the paths are concatenated with colon (":")\&.
1911 .sp
1912 If
1913 \fIDynamicUser=\fR
1914 is used, and if the kernel version supports
1915 \m[blue]\fBid\-mapped mounts\fR\m[]\&\s-2\u[9]\d\s+2, the specified directories will be owned by "nobody" in the host namespace and will be mapped to (and will be owned by) the service\*(Aqs UID/GID in its own namespace\&. For backward compatibility, existing directories created without id\-mapped mounts will be kept untouched\&.
1916 .sp
1917 .it 1 an-trap
1918 .nr an-no-space-flag 1
1919 .nr an-break-flag 1
1920 .br
1921 .B Table\ \&2.\ \&Automatic directory creation and environment variables
1922 .TS
1923 allbox tab(:);
1924 lB lB lB lB.
1925 T{
1926 Directory
1927 T}:T{
1928 Below path for system units
1929 T}:T{
1930 Below path for user units
1931 T}:T{
1932 Environment variable set
1933 T}
1934 .T&
1935 l l l l
1936 l l l l
1937 l l l l
1938 l l l l
1939 l l l l.
1940 T{
1941 \fIRuntimeDirectory=\fR
1942 T}:T{
1943 /run/
1944 T}:T{
1945 \fI$XDG_RUNTIME_DIR\fR
1946 T}:T{
1947 \fI$RUNTIME_DIRECTORY\fR
1948 T}
1949 T{
1950 \fIStateDirectory=\fR
1951 T}:T{
1952 /var/lib/
1953 T}:T{
1954 \fI$XDG_STATE_HOME\fR
1955 T}:T{
1956 \fI$STATE_DIRECTORY\fR
1957 T}
1958 T{
1959 \fICacheDirectory=\fR
1960 T}:T{
1961 /var/cache/
1962 T}:T{
1963 \fI$XDG_CACHE_HOME\fR
1964 T}:T{
1965 \fI$CACHE_DIRECTORY\fR
1966 T}
1967 T{
1968 \fILogsDirectory=\fR
1969 T}:T{
1970 /var/log/
1971 T}:T{
1972 \fI$XDG_STATE_HOME\fR/log/
1973 T}:T{
1974 \fI$LOGS_DIRECTORY\fR
1975 T}
1976 T{
1977 \fIConfigurationDirectory=\fR
1978 T}:T{
1979 /etc/
1980 T}:T{
1981 \fI$XDG_CONFIG_HOME\fR
1982 T}:T{
1983 \fI$CONFIGURATION_DIRECTORY\fR
1984 T}
1985 .TE
1986 .sp 1
1987 In case of
1988 \fIRuntimeDirectory=\fR
1989 the innermost subdirectories are removed when the unit is stopped\&. It is possible to preserve the specified directories in this case if
1990 \fIRuntimeDirectoryPreserve=\fR
1991 is configured to
1992 \fBrestart\fR
1993 or
1994 \fByes\fR
1995 (see below)\&. The directories specified with
1996 \fIStateDirectory=\fR,
1997 \fICacheDirectory=\fR,
1998 \fILogsDirectory=\fR,
1999 \fIConfigurationDirectory=\fR
2000 are not removed when the unit is stopped\&.
2001 .sp
2002 Except in case of
2003 \fIConfigurationDirectory=\fR, the innermost specified directories will be owned by the user and group specified in
2004 \fIUser=\fR
2005 and
2006 \fIGroup=\fR\&. If the specified directories already exist and their owning user or group do not match the configured ones, all files and directories below the specified directories as well as the directories themselves will have their file ownership recursively changed to match what is configured\&. As an optimization, if the specified directories are already owned by the right user and group, files and directories below of them are left as\-is, even if they do not match what is requested\&. The innermost specified directories will have their access mode adjusted to the what is specified in
2007 \fIRuntimeDirectoryMode=\fR,
2008 \fIStateDirectoryMode=\fR,
2009 \fICacheDirectoryMode=\fR,
2010 \fILogsDirectoryMode=\fR
2011 and
2012 \fIConfigurationDirectoryMode=\fR\&.
2013 .sp
2014 These options imply
2015 \fIBindPaths=\fR
2016 for the specified paths\&. When combined with
2017 \fIRootDirectory=\fR
2018 or
2019 \fIRootImage=\fR
2020 these paths always reside on the host and are mounted from there into the unit\*(Aqs file system namespace\&.
2021 .sp
2022 If
2023 \fIDynamicUser=\fR
2024 is used, the logic for
2025 \fICacheDirectory=\fR,
2026 \fILogsDirectory=\fR
2027 and
2028 \fIStateDirectory=\fR
2029 is slightly altered: the directories are created below
2030 /var/cache/private,
2031 /var/log/private
2032 and
2033 /var/lib/private, respectively, which are host directories made inaccessible to unprivileged users, which ensures that access to these directories cannot be gained through dynamic user ID recycling\&. Symbolic links are created to hide this difference in behaviour\&. Both from perspective of the host and from inside the unit, the relevant directories hence always appear directly below
2034 /var/cache,
2035 /var/log
2036 and
2037 /var/lib\&.
2038 .sp
2039 Use
2040 \fIRuntimeDirectory=\fR
2041 to manage one or more runtime directories for the unit and bind their lifetime to the daemon runtime\&. This is particularly useful for unprivileged daemons that cannot create runtime directories in
2042 /run/
2043 due to lack of privileges, and to make sure the runtime directory is cleaned up automatically after use\&. For runtime directories that require more complex or different configuration or lifetime guarantees, please consider using
2044 \fBtmpfiles.d\fR(5)\&.
2045 .sp
2046 \fIRuntimeDirectory=\fR,
2047 \fIStateDirectory=\fR,
2048 \fICacheDirectory=\fR
2049 and
2050 \fILogsDirectory=\fR
2051 optionally support two more parameters, separated by
2052 ":"\&. The second parameter will be interpreted as a destination path that will be created as a symlink to the directory\&. The symlinks will be created after any
2053 \fIBindPaths=\fR
2054 or
2055 \fITemporaryFileSystem=\fR
2056 options have been set up, to make ephemeral symlinking possible\&. The same source can have multiple symlinks, by using the same first parameter, but a different second parameter\&. The third parameter is a flags field, and since v257 can take a value of
2057 \fBro\fR
2058 to make the directory read only for the service\&. This is also supported for
2059 \fIConfigurationDirectory=\fR\&. If multiple symlinks are set up, the directory will be read only if at least one is configured to be read only\&. To pass a flag without a destination symlink, the second parameter can be empty, for example:
2060 .sp
2061 .if n \{\
2062 .RS 4
2063 .\}
2064 .nf
2065 ConfigurationDirectory=foo::ro
2066 .fi
2067 .if n \{\
2068 .RE
2069 .\}
2070 .sp
2071 The directories defined by these options are always created under the standard paths used by systemd (/var/,
2072 /run/,
2073 /etc/, \&...)\&. If the service needs directories in a different location, a different mechanism has to be used to create them\&.
2074 .sp
2075 \fBtmpfiles.d\fR(5)
2076 provides functionality that overlaps with these options\&. Using these options is recommended, because the lifetime of the directories is tied directly to the lifetime of the unit, and it is not necessary to ensure that the
2077 tmpfiles\&.d
2078 configuration is executed before the unit is started\&.
2079 .sp
2080 To remove any of the directories created by these settings, use the
2081 \fBsystemctl clean \&...\fR
2082 command on the relevant units, see
2083 \fBsystemctl\fR(1)
2084 for details\&.
2085 .sp
2086 Example: if a system service unit has the following,
2087 .sp
2088 .if n \{\
2089 .RS 4
2090 .\}
2091 .nf
2092 RuntimeDirectory=foo/bar baz
2093 .fi
2094 .if n \{\
2095 .RE
2096 .\}
2097 .sp
2098 the service manager creates
2099 /run/foo
2100 (if it does not exist),
2101 /run/foo/bar, and
2102 /run/baz\&. The directories
2103 /run/foo/bar
2104 and
2105 /run/baz
2106 except
2107 /run/foo
2108 are owned by the user and group specified in
2109 \fIUser=\fR
2110 and
2111 \fIGroup=\fR, and removed when the service is stopped\&.
2112 .sp
2113 Example: if a system service unit has the following,
2114 .sp
2115 .if n \{\
2116 .RS 4
2117 .\}
2118 .nf
2119 RuntimeDirectory=foo/bar
2120 StateDirectory=aaa/bbb ccc
2121 .fi
2122 .if n \{\
2123 .RE
2124 .\}
2125 .sp
2126 then the environment variable
2127 "RUNTIME_DIRECTORY"
2128 is set with
2129 "/run/foo/bar", and
2130 "STATE_DIRECTORY"
2131 is set with
2132 "/var/lib/aaa/bbb:/var/lib/ccc"\&.
2133 .sp
2134 Example: if a system service unit has the following,
2135 .sp
2136 .if n \{\
2137 .RS 4
2138 .\}
2139 .nf
2140 RuntimeDirectory=foo:bar foo:baz
2141 .fi
2142 .if n \{\
2143 .RE
2144 .\}
2145 .sp
2146 the service manager creates
2147 /run/foo
2148 (if it does not exist), and
2149 /run/bar
2150 plus
2151 /run/baz
2152 as symlinks to
2153 /run/foo\&.
2154 .sp
2155 Added in version 211\&.
2156 .RE
2157 .PP
2158 \fIRuntimeDirectoryMode=\fR, \fIStateDirectoryMode=\fR, \fICacheDirectoryMode=\fR, \fILogsDirectoryMode=\fR, \fIConfigurationDirectoryMode=\fR
2159 .RS 4
2160 Specifies the access mode of the directories specified in
2161 \fIRuntimeDirectory=\fR,
2162 \fIStateDirectory=\fR,
2163 \fICacheDirectory=\fR,
2164 \fILogsDirectory=\fR, or
2165 \fIConfigurationDirectory=\fR, respectively, as an octal number\&. Defaults to
2166 \fB0755\fR\&. See "Permissions" in
2167 \fBpath_resolution\fR(7)
2168 for a discussion of the meaning of permission bits\&.
2169 .sp
2170 Added in version 234\&.
2171 .RE
2172 .PP
2173 \fIStateDirectoryQuota=\fR, \fICacheDirectoryQuota=\fR, \fILogsDirectoryQuota=\fR
2174 .RS 4
2175 Specifies the storage limits for the directories specified in
2176 \fIStateDirectory=\fR,
2177 \fICacheDirectory=\fR, or
2178 \fILogsDirectory=\fR
2179 respectively\&.
2180 .sp
2181 The storage quota is defined in terms of disk blocks and inodes, as per
2182 \m[blue]\fBquotactl\fR\m[]\&\s-2\u[10]\d\s+2\&. Takes an absolute size limit in bytes\&. If the value is suffixed with K, M, G or T, the specified size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively\&. If an absolute size limit is specified, only the block quota is set (rounded up to the nearest block)\&. Alternatively, a percentage value may be specified, which applies the same percent quota to both blocks and inodes\&. Defaults to
2183 \fBoff\fR, in which case no storage limits will be set\&.
2184 .sp
2185 Only hard limits are set, not soft limits\&. If the underlying filesystem for the specified directories does not support project quotas, the specified storage limits will not be set\&. In addition to enabling per\-unit quotas with these settings, it is necessary to enable
2186 \fBprjquota\fR
2187 on the file system level as well (i\&.e\&.
2188 \fBtune2fs \-Q prjquota\fR)\&. Quotas must also be turned on with
2189 \m[blue]\fBquotaon\&.\fR\m[]\&\s-2\u[11]\d\s+2
2190 .sp
2191 Added in version 258\&.
2192 .RE
2193 .PP
2194 \fIStateDirectoryAccounting=\fR, \fICacheDirectoryAccounting=\fR, \fILogsDirectoryAccounting=\fR
2195 .RS 4
2196 Takes a boolean argument\&. If true, a project ID is assigned to the directories specified in
2197 \fIStateDirectory=\fR,
2198 \fICacheDirectory=\fR, or
2199 \fILogsDirectory=\fR
2200 respectively, which is used for tracking disk usage when disk quotas are turned on (see
2201 \m[blue]\fBrepquota\fR\m[]\&\s-2\u[12]\d\s+2)\&. Defaults to false\&.
2202 .sp
2203 To set and enforce disk quotas,
2204 \fIStateDirectoryQuota=\fR,
2205 \fICacheDirectoryQuota=\fR, or
2206 \fILogsDirectoryQuota=\fR
2207 must be specified\&.
2208 .sp
2209 Added in version 258\&.
2210 .RE
2211 .PP
2212 \fIRuntimeDirectoryPreserve=\fR
2213 .RS 4
2214 Takes a boolean argument or
2215 \fBrestart\fR\&. If set to
2216 \fBno\fR
2217 (the default), the directories specified in
2218 \fIRuntimeDirectory=\fR
2219 are always removed when the service stops\&. If set to
2220 \fBrestart\fR
2221 the directories are preserved when the service is both automatically and manually restarted\&. Here, the automatic restart means the operation specified in
2222 \fIRestart=\fR, and manual restart means the one triggered by
2223 \fBsystemctl restart foo\&.service\fR\&. If set to
2224 \fByes\fR, then the directories are not removed when the service is stopped\&. Note that since the runtime directory
2225 /run/
2226 is a mount point of
2227 "tmpfs", then for system services the directories specified in
2228 \fIRuntimeDirectory=\fR
2229 are removed when the system is rebooted\&.
2230 .sp
2231 If
2232 \fIDynamicUser=\fR
2233 is used together with
2234 \fIRuntimeDirectoryPreserve=\fR
2235 set to values other than
2236 \fBno\fR, the logic is slightly altered: the
2237 \fIRuntimeDirectory=\fR
2238 directories are created below
2239 /run/private/, which is a host directory made inaccessible to unprivileged users, which ensures that access to these directories cannot be gained through dynamic user ID recycling\&. Symbolic links are created to hide this difference in behaviour\&. Both from the perspective of the host and from inside the unit, the relevant directories hence always appear directly below
2240 /run/\&.
2241 .sp
2242 Added in version 235\&.
2243 .RE
2244 .PP
2245 \fITimeoutCleanSec=\fR
2246 .RS 4
2247 Configures a timeout on the clean\-up operation requested through
2248 \fBsystemctl clean \&...\fR, see
2249 \fBsystemctl\fR(1)
2250 for details\&. Takes the usual time values and defaults to
2251 \fBinfinity\fR, i\&.e\&. by default no timeout is applied\&. If a timeout is configured the clean operation will be aborted forcibly when the timeout is reached, potentially leaving resources on disk\&.
2252 .sp
2253 Added in version 244\&.
2254 .RE
2255 .PP
2256 \fIReadWritePaths=\fR, \fIReadOnlyPaths=\fR, \fIInaccessiblePaths=\fR, \fIExecPaths=\fR, \fINoExecPaths=\fR
2257 .RS 4
2258 Sets up a new file system namespace for executed processes\&. These options may be used to limit access a process has to the file system\&. Each setting takes a space\-separated list of paths relative to the host\*(Aqs root directory (i\&.e\&. the system running the service manager)\&. Note that if paths contain symlinks, they are resolved relative to the root directory set with
2259 \fIRootDirectory=\fR/\fIRootImage=\fR\&.
2260 .sp
2261 Paths listed in
2262 \fIReadWritePaths=\fR
2263 are accessible from within the namespace with the same access modes as from outside of it\&. Paths listed in
2264 \fIReadOnlyPaths=\fR
2265 are accessible for reading only, writing will be refused even if the usual file access controls would permit this\&. Nest
2266 \fIReadWritePaths=\fR
2267 inside of
2268 \fIReadOnlyPaths=\fR
2269 in order to provide writable subdirectories within read\-only directories\&. Use
2270 \fIReadWritePaths=\fR
2271 in order to allow\-list specific paths for write access if
2272 \fIProtectSystem=strict\fR
2273 is used\&. Note that
2274 \fIReadWritePaths=\fR
2275 cannot be used to gain write access to a file system whose superblock is mounted read\-only\&. On Linux, for each mount point write access is granted only if the mount point itself
2276 \fIand\fR
2277 the file system superblock backing it are not marked read\-only\&.
2278 \fIReadWritePaths=\fR
2279 only controls the former, not the latter, hence a read\-only file system superblock remains protected\&.
2280 .sp
2281 Paths listed in
2282 \fIInaccessiblePaths=\fR
2283 will be made inaccessible for processes inside the namespace along with everything below them in the file system hierarchy\&. This may be more restrictive than desired, because it is not possible to nest
2284 \fIReadWritePaths=\fR,
2285 \fIReadOnlyPaths=\fR,
2286 \fIBindPaths=\fR, or
2287 \fIBindReadOnlyPaths=\fR
2288 inside it\&. For a more flexible option, see
2289 \fITemporaryFileSystem=\fR\&.
2290 .sp
2291 Content in paths listed in
2292 \fINoExecPaths=\fR
2293 are not executable even if the usual file access controls would permit this\&. Nest
2294 \fIExecPaths=\fR
2295 inside of
2296 \fINoExecPaths=\fR
2297 in order to provide executable content within non\-executable directories\&.
2298 .sp
2299 Non\-directory paths may be specified as well\&. These options may be specified more than once, in which case all paths listed will have limited access from within the namespace\&. If the empty string is assigned to this option, the specific list is reset, and all prior assignments have no effect\&.
2300 .sp
2301 Paths in
2302 \fIReadWritePaths=\fR,
2303 \fIReadOnlyPaths=\fR,
2304 \fIInaccessiblePaths=\fR,
2305 \fIExecPaths=\fR
2306 and
2307 \fINoExecPaths=\fR
2308 may be prefixed with
2309 "\-", in which case they will be ignored when they do not exist\&. If prefixed with
2310 "+"
2311 the paths are taken relative to the root directory of the unit, as configured with
2312 \fIRootDirectory=\fR/\fIRootImage=\fR, instead of relative to the root directory of the host (see above)\&. When combining
2313 "\-"
2314 and
2315 "+"
2316 on the same path make sure to specify
2317 "\-"
2318 first, and
2319 "+"
2320 second\&.
2321 .sp
2322 Note that these settings will disconnect propagation of mounts from the unit\*(Aqs processes to the host\&. This means that this setting may not be used for services which shall be able to install mount points in the main mount namespace\&. For
2323 \fIReadWritePaths=\fR
2324 and
2325 \fIReadOnlyPaths=\fR, propagation in the other direction is not affected, i\&.e\&. mounts created on the host generally appear in the unit processes\*(Aq namespace, and mounts removed on the host also disappear there too\&. In particular, note that mount propagation from host to unit will result in unmodified mounts to be created in the unit\*(Aqs namespace, i\&.e\&. writable mounts appearing on the host will be writable in the unit\*(Aqs namespace too, even when propagated below a path marked with
2326 \fIReadOnlyPaths=\fR! Restricting access with these options hence does not extend to submounts of a directory that are created later on\&. This means the lock\-down offered by that setting is not complete, and does not offer full protection\&.
2327 .sp
2328 Note that the effect of these settings may be undone by privileged processes\&. In order to set up an effective sandboxed environment for a unit it is thus recommended to combine these settings with either
2329 \fICapabilityBoundingSet=~CAP_SYS_ADMIN\fR
2330 or
2331 \fISystemCallFilter=~@mount\fR\&.
2332 .sp
2333 Please be extra careful when applying these options to API file systems (a list of them could be found in
2334 \fIMountAPIVPS=\fR), since they may be required for basic system functionalities\&. Moreover,
2335 /run/
2336 needs to be writable for setting up mount namespace and propagation\&.
2337 .sp
2338 Simple allow\-list example using these directives:
2339 .sp
2340 .if n \{\
2341 .RS 4
2342 .\}
2343 .nf
2344 [Service]
2345 ReadOnlyPaths=/
2346 ReadWritePaths=/var /run
2347 InaccessiblePaths=\-/lost+found
2348 NoExecPaths=/
2349 ExecPaths=/usr/sbin/my_daemon /usr/lib /usr/lib64
2350 .fi
2351 .if n \{\
2352 .RE
2353 .\}
2354 .sp
2355 These options are only available for system services, or for services running in per\-user instances of the service manager in which case
2356 \fIPrivateUsers=\fR
2357 is implicitly enabled (requires unprivileged user namespaces support to be enabled in the kernel via the
2358 "kernel\&.unprivileged_userns_clone="
2359 sysctl)\&.
2360 .sp
2361 Added in version 231\&.
2362 .RE
2363 .PP
2364 \fITemporaryFileSystem=\fR
2365 .RS 4
2366 Takes a space\-separated list of mount points for temporary file systems (tmpfs)\&. If set, a new file system namespace is set up for executed processes, and a temporary file system is mounted on each mount point\&. This option may be specified more than once, in which case temporary file systems are mounted on all listed mount points\&. If the empty string is assigned to this option, the list is reset, and all prior assignments have no effect\&. Each mount point may optionally be suffixed with a colon (":") and mount options such as
2367 "size=10%"
2368 or
2369 "ro"\&. By default, each temporary file system is mounted with
2370 "nodev,strictatime,mode=0755"\&. These can be disabled by explicitly specifying the corresponding mount options, e\&.g\&.,
2371 "dev"
2372 or
2373 "nostrictatime"\&.
2374 .sp
2375 This is useful to hide files or directories not relevant to the processes invoked by the unit, while necessary files or directories can be still accessed by combining with
2376 \fIBindPaths=\fR
2377 or
2378 \fIBindReadOnlyPaths=\fR:
2379 .sp
2380 Example: if a unit has the following,
2381 .sp
2382 .if n \{\
2383 .RS 4
2384 .\}
2385 .nf
2386 TemporaryFileSystem=/var:ro
2387 BindReadOnlyPaths=/var/lib/systemd
2388 .fi
2389 .if n \{\
2390 .RE
2391 .\}
2392 .sp
2393 then the invoked processes by the unit cannot see any files or directories under
2394 /var/
2395 except for
2396 /var/lib/systemd
2397 or its contents\&.
2398 .sp
2399 This option is only available for system services, or for services running in per\-user instances of the service manager in which case
2400 \fIPrivateUsers=\fR
2401 is implicitly enabled (requires unprivileged user namespaces support to be enabled in the kernel via the
2402 "kernel\&.unprivileged_userns_clone="
2403 sysctl)\&.
2404 .sp
2405 Added in version 238\&.
2406 .RE
2407 .PP
2408 \fIPrivateTmp=\fR
2409 .RS 4
2410 Takes a boolean argument, or
2411 "disconnected"\&. If enabled, a new file system namespace will be set up for the executed processes, and
2412 /tmp/
2413 and
2414 /var/tmp/
2415 directories inside it are not shared with processes outside of the namespace, plus all temporary files created by a service in these directories will be removed after the service is stopped\&. For this setting, the same restrictions regarding mount propagation and privileges apply as for
2416 \fIReadOnlyPaths=\fR
2417 and related calls, see above\&. This setting is useful to secure access to temporary files of the process, but makes sharing between processes via
2418 /tmp/
2419 or
2420 /var/tmp/
2421 impossible\&. If
2422 \fIDynamicUser=\fR
2423 is enabled,
2424 "disconnected"
2425 is implied\&. Otherwise, defaults to false\&.
2426 .sp
2427 If
2428 "true", the backing storage of the private temporary directories will remain on the host\*(Aqs
2429 /tmp/
2430 and
2431 /var/tmp/
2432 directories\&. It is possible to run two or more units within the same private
2433 /tmp/
2434 and
2435 /var/tmp/
2436 namespace by using the
2437 \fIJoinsNamespaceOf=\fR
2438 directive, see
2439 \fBsystemd.unit\fR(5)
2440 for details\&. This has the side effect of adding
2441 \fIWants=\fR
2442 and
2443 \fIAfter=\fR
2444 dependencies on all mount units necessary to access
2445 /tmp/
2446 and
2447 /var/tmp/
2448 on the host\&. Moreover, an implicit
2449 \fIAfter=\fR
2450 ordering on
2451 \fBsystemd-tmpfiles-setup.service\fR(8)
2452 is added\&.
2453 .sp
2454 If
2455 "disconnected", the directories will be backed by a completely new tmpfs instance, meaning that the storage is fully disconnected from the host namespace\&. The tmpfs instance does not shared with other units even if the
2456 \fIJoinsNamespaceOf=\fR
2457 directive is used\&. If
2458 \fIDefaultDependencies=no\fR
2459 is specified,
2460 \fIRequiresMountsFor=/WantsMountsFor=\fR
2461 for
2462 /var/
2463 is not specified, and
2464 \fIRootDirectory=/RootImage=\fR
2465 is not specified, then a new tmpfs is mounted
2466 \fIonly\fR
2467 on
2468 /tmp/, hence the host\*(Aqs
2469 /var/tmp
2470 is still accessible from the unit\&. In that case,
2471 \fI$TMPDIR\fR
2472 environment variable is set to
2473 "/tmp"
2474 to suggest the processes in the unit to use
2475 /tmp/\&. This automatically adds
2476 \fIWantsMountsFor=/var/\fR
2477 dependency, unless
2478 \fIDefaultDependencies=no\fR
2479 and/or
2480 \fIRootDirectory=/RootImage=\fR
2481 are specified\&.
2482 .sp
2483 .it 1 an-trap
2484 .nr an-no-space-flag 1
2485 .nr an-break-flag 1
2486 .br
2487 .B Table\ \&3.\ \&Summary for \fIPrivateTmp=disconnected\fR
2488 .TS
2489 allbox tab(:);
2490 lB lB lB lB.
2491 T{
2492 Other Settings
2493 T}:T{
2494 tmpfs on /var/tmp/
2495 T}:T{
2496 $TMPVAR
2497 T}:T{
2498 implied dependencies
2499 T}
2500 .T&
2501 l l l l
2502 l l l l
2503 l l l l
2504 l l l l
2505 l l l l.
2506 T{
2507 (none)
2508 T}:T{
2509 yes
2510 T}:T{
2511 (unset)
2512 T}:T{
2513 \fIWantsMountsFor=/var/\fR
2514 T}
2515 T{
2516 \fIRootDirectory=/RootImage=\fR
2517 T}:T{
2518 yes
2519 T}:T{
2520 (unset)
2521 T}:T{
2522 (none)
2523 T}
2524 T{
2525 \fIDefaultDependency=no\fR, \fIRequiresMountsFor=/var/\fR
2526 T}:T{
2527 yes
2528 T}:T{
2529 (unset)
2530 T}:T{
2531 (none)
2532 T}
2533 T{
2534 \fIDefaultDependency=no\fR, \fIWantsMountsFor=/var/\fR
2535 T}:T{
2536 yes
2537 T}:T{
2538 (unset)
2539 T}:T{
2540 (none)
2541 T}
2542 T{
2543 \fIDefaultDependency=no\fR
2544 T}:T{
2545 no
2546 T}:T{
2547 \fI$TMPDIR=/tmp\fR
2548 T}:T{
2549 (none)
2550 T}
2551 .TE
2552 .sp 1
2553 Note that the implementation of this setting might be impossible (for example if mount namespaces are not available), and the unit should be written in a way that does not solely rely on this setting for security\&.
2554 .sp
2555 This option is only available for system services, or for services running in per\-user instances of the service manager in which case
2556 \fIPrivateUsers=\fR
2557 is implicitly enabled (requires unprivileged user namespaces support to be enabled in the kernel via the
2558 "kernel\&.unprivileged_userns_clone="
2559 sysctl)\&.
2560 .RE
2561 .PP
2562 \fIPrivateDevices=\fR
2563 .RS 4
2564 Takes a boolean argument\&. If true, sets up a new
2565 /dev/
2566 mount for the executed processes and only adds API pseudo devices such as
2567 /dev/null,
2568 /dev/zero
2569 or
2570 /dev/random
2571 (as well as the pseudo TTY subsystem) to it, but no physical devices such as
2572 /dev/sda, system memory
2573 /dev/mem, system ports
2574 /dev/port
2575 and others\&. This is useful to turn off physical device access by the executed process\&. Defaults to false\&.
2576 .sp
2577 Enabling this option will install a system call filter to block low\-level I/O system calls that are grouped in the
2578 \fI@raw\-io\fR
2579 set, remove
2580 \fBCAP_MKNOD\fR
2581 and
2582 \fBCAP_SYS_RAWIO\fR
2583 from the capability bounding set for the unit, and set
2584 \fIDevicePolicy=closed\fR
2585 (see
2586 \fBsystemd.resource-control\fR(5)
2587 for details)\&. Note that using this setting will disconnect propagation of mounts from the service to the host (propagation in the opposite direction continues to work)\&. This means that this setting may not be used for services which shall be able to install mount points in the main mount namespace\&. The new
2588 /dev/
2589 will be mounted read\-only and \*(Aqnoexec\*(Aq\&. The latter may break old programs which try to set up executable memory by using
2590 \fBmmap\fR(2)
2591 of
2592 /dev/zero
2593 instead of using
2594 \fBMAP_ANON\fR\&. For this setting the same restrictions regarding mount propagation and privileges apply as for
2595 \fIReadOnlyPaths=\fR
2596 and related calls, see above\&.
2597 .sp
2598 Note that the implementation of this setting might be impossible (for example if mount namespaces are not available), and the unit should be written in a way that does not solely rely on this setting for security\&.
2599 .sp
2600 This option is only available for system services, or for services running in per\-user instances of the service manager in which case
2601 \fIPrivateUsers=\fR
2602 is implicitly enabled (requires unprivileged user namespaces support to be enabled in the kernel via the
2603 "kernel\&.unprivileged_userns_clone="
2604 sysctl)\&.
2605 .sp
2606 When access to some but not all devices must be possible, the
2607 \fIDeviceAllow=\fR
2608 setting might be used instead\&. See
2609 \fBsystemd.resource-control\fR(5)\&.
2610 .sp
2611 Added in version 209\&.
2612 .RE
2613 .PP
2614 \fIPrivateNetwork=\fR
2615 .RS 4
2616 Takes a boolean argument\&. If true, sets up a new network namespace for the executed processes and configures only the loopback network device
2617 "lo"
2618 inside it\&. No other network devices will be available to the executed process\&. This is useful to turn off network access by the executed process\&. Defaults to false\&. It is possible to run two or more units within the same private network namespace by using the
2619 \fIJoinsNamespaceOf=\fR
2620 directive, see
2621 \fBsystemd.unit\fR(5)
2622 for details\&. Note that this option will disconnect all socket families from the host, including
2623 \fBAF_NETLINK\fR
2624 and
2625 \fBAF_UNIX\fR\&. Effectively, for
2626 \fBAF_NETLINK\fR
2627 this means that device configuration events received from
2628 \fBsystemd-udevd.service\fR(8)
2629 are not delivered to the unit\*(Aqs processes\&. And for
2630 \fBAF_UNIX\fR
2631 this has the effect that
2632 \fBAF_UNIX\fR
2633 sockets in the abstract socket namespace of the host will become unavailable to the unit\*(Aqs processes (however, those located in the file system will continue to be accessible)\&.
2634 .sp
2635 Note that the implementation of this setting might be impossible (for example if network namespaces are not available), and the unit should be written in a way that does not solely rely on this setting for security\&.
2636 .sp
2637 When this option is enabled,
2638 \fIPrivateMounts=\fR
2639 is implied unless it is explicitly disabled, and
2640 /sys
2641 will be remounted to associate it with the new network namespace\&.
2642 .sp
2643 When this option is used on a socket unit any sockets bound on behalf of this unit will be bound within a private network namespace\&. This may be combined with
2644 \fIJoinsNamespaceOf=\fR
2645 to listen on sockets inside of network namespaces of other services\&.
2646 .sp
2647 This option is only available for system services, or for services running in per\-user instances of the service manager in which case
2648 \fIPrivateUsers=\fR
2649 is implicitly enabled (requires unprivileged user namespaces support to be enabled in the kernel via the
2650 "kernel\&.unprivileged_userns_clone="
2651 sysctl)\&.
2652 .RE
2653 .PP
2654 \fIUserNamespacePath=\fR
2655 .RS 4
2656 Takes an absolute file system path referring to a Linux user namespace pseudo\-file (i\&.e\&. a file like
2657 /proc/$PID/ns/user
2658 or a bind mount or symlink to one)\&. When set the invoked processes are added to the user namespace referenced by that path\&. The path has to point to a valid namespace file at the moment the processes are forked off\&. If this option is used
2659 \fIPrivateUsers=\fR
2660 has no effect\&.
2661 .sp
2662 This option is only available for system services\&.
2663 .sp
2664 Added in version 259\&.
2665 .RE
2666 .PP
2667 \fINetworkNamespacePath=\fR
2668 .RS 4
2669 Takes an absolute file system path referring to a Linux network namespace pseudo\-file (i\&.e\&. a file like
2670 /proc/$PID/ns/net
2671 or a bind mount or symlink to one)\&. When set the invoked processes are added to the network namespace referenced by that path\&. The path has to point to a valid namespace file at the moment the processes are forked off\&. If this option is used
2672 \fIPrivateNetwork=\fR
2673 has no effect\&. If this option is used together with
2674 \fIJoinsNamespaceOf=\fR
2675 then it only has an effect if this unit is started before any of the listed units that have
2676 \fIPrivateNetwork=\fR
2677 or
2678 \fINetworkNamespacePath=\fR
2679 configured, as otherwise the network namespace of those units is reused\&.
2680 .sp
2681 When this option is enabled,
2682 \fIPrivateMounts=\fR
2683 is implied unless it is explicitly disabled, and
2684 /sys
2685 will be remounted to associate it with the new network namespace\&.
2686 .sp
2687 When this option is used on a socket unit any sockets bound on behalf of this unit will be bound within the specified network namespace\&.
2688 .sp
2689 This option is only available for system services, or for services running in per\-user instances of the service manager in which case
2690 \fIPrivateUsers=\fR
2691 is implicitly enabled (requires unprivileged user namespaces support to be enabled in the kernel via the
2692 "kernel\&.unprivileged_userns_clone="
2693 sysctl)\&.
2694 .sp
2695 Added in version 242\&.
2696 .RE
2697 .PP
2698 \fIPrivateIPC=\fR
2699 .RS 4
2700 Takes a boolean argument\&. If true, sets up a new IPC namespace for the executed processes\&. Each IPC namespace has its own set of System V IPC identifiers and its own POSIX message queue file system\&. This is useful to avoid name clash of IPC identifiers\&. Defaults to false\&. It is possible to run two or more units within the same private IPC namespace by using the
2701 \fIJoinsNamespaceOf=\fR
2702 directive, see
2703 \fBsystemd.unit\fR(5)
2704 for details\&.
2705 .sp
2706 Note that IPC namespacing does not have an effect on
2707 \fBAF_UNIX\fR
2708 sockets, which are the most common form of IPC used on Linux\&. Instead,
2709 \fBAF_UNIX\fR
2710 sockets in the file system are subject to mount namespacing, and those in the abstract namespace are subject to network namespacing\&. IPC namespacing only has an effect on SysV IPC (which is mostly legacy) as well as POSIX message queues (for which
2711 \fBAF_UNIX\fR/\fBSOCK_SEQPACKET\fR
2712 sockets are typically a better replacement)\&. IPC namespacing also has no effect on POSIX shared memory (which is subject to mount namespacing) either\&. See
2713 \fBipc_namespaces\fR(7)
2714 for the details\&.
2715 .sp
2716 Note that the implementation of this setting might be impossible (for example if IPC namespaces are not available), and the unit should be written in a way that does not solely rely on this setting for security\&.
2717 .sp
2718 This option is only available for system services, or for services running in per\-user instances of the service manager in which case
2719 \fIPrivateUsers=\fR
2720 is implicitly enabled (requires unprivileged user namespaces support to be enabled in the kernel via the
2721 "kernel\&.unprivileged_userns_clone="
2722 sysctl)\&.
2723 .sp
2724 Added in version 248\&.
2725 .RE
2726 .PP
2727 \fIIPCNamespacePath=\fR
2728 .RS 4
2729 Takes an absolute file system path referring to a Linux IPC namespace pseudo\-file (i\&.e\&. a file like
2730 /proc/$PID/ns/ipc
2731 or a bind mount or symlink to one)\&. When set the invoked processes are added to the network namespace referenced by that path\&. The path has to point to a valid namespace file at the moment the processes are forked off\&. If this option is used
2732 \fIPrivateIPC=\fR
2733 has no effect\&. If this option is used together with
2734 \fIJoinsNamespaceOf=\fR
2735 then it only has an effect if this unit is started before any of the listed units that have
2736 \fIPrivateIPC=\fR
2737 or
2738 \fIIPCNamespacePath=\fR
2739 configured, as otherwise the network namespace of those units is reused\&.
2740 .sp
2741 This option is only available for system services, or for services running in per\-user instances of the service manager in which case
2742 \fIPrivateUsers=\fR
2743 is implicitly enabled (requires unprivileged user namespaces support to be enabled in the kernel via the
2744 "kernel\&.unprivileged_userns_clone="
2745 sysctl)\&.
2746 .sp
2747 Added in version 248\&.
2748 .RE
2749 .PP
2750 \fIMemoryKSM=\fR
2751 .RS 4
2752 Takes a boolean argument\&. When set, it enables KSM (kernel samepage merging) for the processes\&. KSM is a memory\-saving de\-duplication feature\&. Anonymous memory pages with identical content can be replaced by a single write\-protected page\&. This feature should only be enabled for jobs that share the same security domain\&. For details, see
2753 \m[blue]\fBKernel Samepage Merging\fR\m[]\&\s-2\u[13]\d\s+2
2754 in the kernel documentation\&.
2755 .sp
2756 Note that this functionality might not be available, for example if KSM is disabled in the kernel, or the kernel does not support controlling KSM at the process level through
2757 \fBprctl\fR(2)\&.
2758 .sp
2759 Added in version 254\&.
2760 .RE
2761 .PP
2762 \fIMemoryTHP=\fR
2763 .RS 4
2764 Transparent Hugepages (THPs) is a Linux kernel feature that manages memory using larger pages (2MB on x86, compared to the default 4KB)\&. The main goal is to improve memory management efficiency and system performance, especially for memory\-intensive applications\&. However, it can cause drawbacks in some scenarios, such as memory regression and latency spikes\&. THP policy is governed for the entire system via
2765 /sys/kernel/mm/transparent_hugepage/enabled\&. However, it can be overridden for individual workloads via
2766 \fBprctl\fR(2)\&.
2767 \fIMemoryTHP=\fR
2768 may be used to disable THPs at process invocation time to stop providing THPs for workloads where the drawbacks outweigh the advantages\&. When
2769 \fIMemoryTHP=\fR
2770 is set to
2771 "inherit"
2772 or not set at all, systemd inherits THP settings from the process that starts it and no
2773 \fBprctl\fR(2)
2774 \fBPR_SET_THP_DISABLE\fR
2775 call is made\&. When set to
2776 "disable",
2777 \fIMemoryTHP=\fR
2778 disables THPs completely for the process, irrespecitive of global THP controls\&. When set to
2779 "madvise",
2780 \fIMemoryTHP=\fR
2781 disables THPs for the process except when specifically requested via
2782 \fBmadvise\fR(2)
2783 by the process with
2784 \fBMADV_HUGEPAGE\fR
2785 or
2786 \fBMADV_COLLAPSE\fR\&. When set to
2787 "system",
2788 \fIMemoryTHP=\fR
2789 resets the THP policy to system wide policy\&. This can be used when the process that starts systemd has already disabled THPs via
2790 \fBPR_SET_THP_DISABLE\fR, and we want to restore the system default THP setting at process invocation time\&. For details, see
2791 \m[blue]\fBTransparent Hugepage Support\fR\m[]\&\s-2\u[14]\d\s+2
2792 in the kernel documentation\&.
2793 .sp
2794 Note that this functionality might not be available, for example if THP is disabled in the kernel, or the kernel does not support controlling THP at the process level through
2795 \fBprctl\fR(2)\&.
2796 .sp
2797 Added in version 260\&.
2798 .RE
2799 .PP
2800 \fIPrivatePIDs=\fR
2801 .RS 4
2802 Takes a boolean argument\&. Defaults to false\&. If enabled, sets up a new PID namespace for the executed processes\&. Each executed process is now PID 1 \- the init process \- in the new namespace\&.
2803 /proc/
2804 is mounted such that only processes in the PID namespace are visible\&. If
2805 \fIPrivatePIDs=\fR
2806 is set,
2807 \fIMountAPIVFS=yes\fR
2808 is implied\&.
2809 .sp
2810 \fIPrivatePIDs=\fR
2811 is only supported for service units\&. This setting is not supported with
2812 \fIType=forking\fR
2813 since the kernel will kill all processes in the PID namespace if the init process terminates\&.
2814 .sp
2815 This setting will be ignored if the kernel does not support PID namespaces\&.
2816 .sp
2817 Note unprivileged user services (i\&.e\&. a service run by the per\-user instance of the service manager) will fail with
2818 \fIPrivatePIDs=yes\fR
2819 if
2820 /proc/
2821 is masked (i\&.e\&.
2822 /proc/kmsg
2823 is over\-mounted with
2824 \fBtmpfs\fR
2825 like
2826 \fBsystemd-nspawn\fR(1)
2827 does)\&. This is due to a kernel restriction not allowing unprivileged user namespaces to mount a less restrictive instance of
2828 /proc/\&.
2829 .sp
2830 Added in version 257\&.
2831 .RE
2832 .PP
2833 \fIPrivateUsers=\fR
2834 .RS 4
2835 Takes a boolean argument or one of
2836 "self",
2837 "identity",
2838 "full"
2839 or
2840 "managed"\&. Defaults to false\&. If enabled, sets up a new user namespace for the executed processes and configures a user and group mapping\&. If set to a true value or
2841 "self", a minimal user and group mapping is configured that maps the
2842 "root"
2843 user and group as well as the unit\*(Aqs own user and group to themselves and everything else to the
2844 "nobody"
2845 user and group\&. This is useful to securely detach the user and group databases used by the unit from the rest of the system, and thus to create an effective sandbox environment\&. All files, directories, processes, IPC objects and other resources owned by users/groups not equaling
2846 "root"
2847 or the unit\*(Aqs own will stay visible from within the unit but appear owned by the
2848 "nobody"
2849 user and group\&.
2850 .sp
2851 If the parameter is
2852 "identity", user namespacing is set up with an identity mapping for the first 65536 UIDs/GIDs\&. Any UIDs/GIDs above 65536 will be mapped to the
2853 "nobody"
2854 user and group, respectively\&. While this does not provide UID/GID isolation, since all UIDs/GIDs are chosen identically it does provide process capability isolation, and hence is often a good choice if proper user namespacing with distinct UID maps is not appropriate\&.
2855 .sp
2856 If the parameter is
2857 "full", user namespacing is set up with an identity mapping for all UIDs/GIDs\&. In addition, for system services,
2858 "full"
2859 allows the unit to call
2860 \fBsetgroups()\fR
2861 system calls (by setting
2862 /proc/\fIpid\fR/setgroups
2863 to
2864 "allow")\&. Similar to
2865 "identity", this does not provide UID/GID isolation, but it does provide process capability isolation\&. If this mode is enabled, all unit processes are run without privileges in the host user namespace (regardless of whether the unit\*(Aqs own user/group is
2866 "root"
2867 or not)\&. Specifically this means that the process will have zero process capabilities on the host\*(Aqs user namespace, but full capabilities within the service\*(Aqs user namespace\&. Settings such as
2868 \fICapabilityBoundingSet=\fR
2869 will affect only the latter, and there\*(Aqs no way to acquire additional capabilities in the host\*(Aqs user namespace\&.
2870 .sp
2871 If the parameter is
2872 "managed"
2873 a transient, dynamically allocated range of 65536 UIDs/GIDs is allocated for the unit, and a UID/GID mapping is assigned to the unit\*(Aqs process so the UID/GID 0 from inside the unit maps to the first UID/GID of the allocated mapping\&. Note that in this mode the UID/GID the service process will run as is different depending if looking from the host side (where it will be a high, dynamically assigned UID) or from inside the unit (where it will be 0)\&. Also note that this mode will enable file system UID mapping for the file systems this service accesses, mapping the "foreign" UID range on disk to the selected dynamic UID range at runtime\&.
2874 .sp
2875 When this setting is set up by a per\-user instance of the service manager, the mapping of the
2876 "root"
2877 user and group to itself is omitted (unless the user manager is root)\&. Additionally, in the per\-user instance manager case, the user namespace will be set up before most other namespaces\&. This means that combining
2878 \fIPrivateUsers=\fR\fBtrue\fR
2879 with other namespaces will enable use of features not normally supported by the per\-user instances of the service manager\&.
2880 .sp
2881 This setting is particularly useful in conjunction with
2882 \fIRootDirectory=\fR/\fIRootImage=\fR, as the need to synchronize the user and group databases in the root directory and on the host is reduced, as the only users and groups who need to be matched are
2883 "root",
2884 "nobody"
2885 and the unit\*(Aqs own user and group\&.
2886 .sp
2887 Added in version 232\&.
2888 .RE
2889 .PP
2890 \fIProtectHostname=\fR
2891 .RS 4
2892 Takes a boolean argument or
2893 "private"\&. If enabled, sets up a new UTS namespace for the executed processes\&. If enabled, a hostname can be optionally specified following a colon (e\&.g\&.
2894 "yes:foo"
2895 or
2896 "private:host\&.example\&.com"), and the hostname is set in the new UTS namespace for the unit\&. If set to a true value, changing hostname or domainname via
2897 \fBsethostname()\fR
2898 and
2899 \fBsetdomainname()\fR
2900 system calls is prevented\&. If set to
2901 "private", changing hostname or domainname is allowed but only affects the unit\*(Aqs UTS namespace\&. Defaults to off\&.
2902 .sp
2903 Note that the implementation of this setting might be impossible (for example if UTS namespaces are not available), and the unit should be written in a way that does not solely rely on this setting for security\&.
2904 .sp
2905 Note that when this option is enabled for a service hostname changes no longer propagate from the system into the service, it is hence not suitable for services that need to take notice of system hostname changes dynamically\&.
2906 .sp
2907 Note that this option does not prevent changing system hostname via
2908 \fBhostnamectl\fR\&. However,
2909 \fIUser=\fR
2910 and
2911 \fIGroup=\fR
2912 may be used to run as an unprivileged user to disallow changing system hostname\&. See
2913 \fBSetHostname()\fR
2914 in
2915 \fBorg.freedesktop.hostname1\fR(5)
2916 for more details\&.
2917 .sp
2918 This option is only available for system services, or for services running in per\-user instances of the service manager in which case
2919 \fIPrivateUsers=\fR
2920 is implicitly enabled (requires unprivileged user namespaces support to be enabled in the kernel via the
2921 "kernel\&.unprivileged_userns_clone="
2922 sysctl)\&.
2923 .sp
2924 Added in version 242\&.
2925 .RE
2926 .PP
2927 \fIProtectClock=\fR
2928 .RS 4
2929 Takes a boolean argument\&. If set, writes to the hardware clock or system clock will be denied\&. Defaults to off\&. Enabling this option removes
2930 \fBCAP_SYS_TIME\fR
2931 and
2932 \fBCAP_WAKE_ALARM\fR
2933 from the capability bounding set for this unit, installs a system call filter to block calls that can set the clock, and
2934 \fIDeviceAllow=char\-rtc r\fR
2935 is implied\&. Note that the system calls are blocked altogether, the filter does not take into account that some of the calls can be used to read the clock state with some parameter combinations\&. Effectively,
2936 /dev/rtc0,
2937 /dev/rtc1, etc\&. are made read\-only to the service\&. See
2938 \fBsystemd.resource-control\fR(5)
2939 for the details about
2940 \fIDeviceAllow=\fR\&.
2941 .sp
2942 It is recommended to turn this on for most services that do not need modify the clock or check its state\&.
2943 .sp
2944 This option is only available for system services, or for services running in per\-user instances of the service manager in which case
2945 \fIPrivateUsers=\fR
2946 is implicitly enabled (requires unprivileged user namespaces support to be enabled in the kernel via the
2947 "kernel\&.unprivileged_userns_clone="
2948 sysctl)\&.
2949 .sp
2950 Added in version 245\&.
2951 .RE
2952 .PP
2953 \fIProtectKernelTunables=\fR
2954 .RS 4
2955 Takes a boolean argument\&. If true, kernel variables accessible through
2956 /proc/sys/,
2957 /sys/,
2958 /proc/sysrq\-trigger,
2959 /proc/latency_stats,
2960 /proc/acpi,
2961 /proc/timer_stats,
2962 /proc/fs
2963 and
2964 /proc/irq
2965 will be made read\-only and
2966 /proc/kallsyms
2967 as well as
2968 /proc/kcore
2969 will be inaccessible to all processes of the unit\&. Usually, tunable kernel variables should be initialized only at boot\-time, for example with the
2970 \fBsysctl.d\fR(5)
2971 mechanism\&. Few services need to write to these at runtime; it is hence recommended to turn this on for most services\&. For this setting the same restrictions regarding mount propagation and privileges apply as for
2972 \fIReadOnlyPaths=\fR
2973 and related calls, see above\&. Defaults to off\&. Note that this option does not prevent indirect changes to kernel tunables affected by IPC calls to other processes\&. However,
2974 \fIInaccessiblePaths=\fR
2975 may be used to make relevant IPC file system objects inaccessible\&. If
2976 \fIProtectKernelTunables=\fR
2977 is set,
2978 \fIMountAPIVFS=yes\fR
2979 is implied\&.
2980 .sp
2981 This option is only available for system services, or for services running in per\-user instances of the service manager in which case
2982 \fIPrivateUsers=\fR
2983 is implicitly enabled (requires unprivileged user namespaces support to be enabled in the kernel via the
2984 "kernel\&.unprivileged_userns_clone="
2985 sysctl)\&.
2986 .sp
2987 Added in version 232\&.
2988 .RE
2989 .PP
2990 \fIProtectKernelModules=\fR
2991 .RS 4
2992 Takes a boolean argument\&. If true, explicit module loading will be denied\&. This allows module load and unload operations to be turned off on modular kernels\&. It is recommended to turn this on for most services that do not need special file systems or extra kernel modules to work\&. Defaults to off\&. Enabling this option removes
2993 \fBCAP_SYS_MODULE\fR
2994 from the capability bounding set for the unit, and installs a system call filter to block module system calls, also
2995 /usr/lib/modules
2996 is made inaccessible\&. For this setting the same restrictions regarding mount propagation and privileges apply as for
2997 \fIReadOnlyPaths=\fR
2998 and related calls, see above\&. Note that limited automatic module loading due to user configuration or kernel mapping tables might still happen as side effect of requested user operations, both privileged and unprivileged\&. To disable module auto\-load feature please see
2999 \fBsysctl.d\fR(5)
3000 \fBkernel\&.modules_disabled\fR
3001 mechanism and
3002 /proc/sys/kernel/modules_disabled
3003 documentation\&.
3004 .sp
3005 This option is only available for system services, or for services running in per\-user instances of the service manager in which case
3006 \fIPrivateUsers=\fR
3007 is implicitly enabled (requires unprivileged user namespaces support to be enabled in the kernel via the
3008 "kernel\&.unprivileged_userns_clone="
3009 sysctl)\&.
3010 .sp
3011 Added in version 232\&.
3012 .RE
3013 .PP
3014 \fIProtectKernelLogs=\fR
3015 .RS 4
3016 Takes a boolean argument\&. If true, access to the kernel log ring buffer will be denied\&. It is recommended to turn this on for most services that do not need to read from or write to the kernel log ring buffer\&. Enabling this option removes
3017 \fBCAP_SYSLOG\fR
3018 from the capability bounding set for this unit, and installs a system call filter to block the
3019 \fBsyslog\fR(2)
3020 system call (not to be confused with the libc API
3021 \fBsyslog\fR(3)
3022 for userspace logging)\&. The kernel exposes its log buffer to userspace via
3023 /dev/kmsg
3024 and
3025 /proc/kmsg\&. If enabled, these are made inaccessible to all the processes in the unit\&.
3026 .sp
3027 This option is only available for system services, or for services running in per\-user instances of the service manager in which case
3028 \fIPrivateUsers=\fR
3029 is implicitly enabled (requires unprivileged user namespaces support to be enabled in the kernel via the
3030 "kernel\&.unprivileged_userns_clone="
3031 sysctl)\&.
3032 .sp
3033 Added in version 244\&.
3034 .RE
3035 .PP
3036 \fIProtectControlGroups=\fR
3037 .RS 4
3038 Takes a boolean argument or the special values
3039 "private"
3040 or
3041 "strict"\&. If true, the Linux Control Groups (\fBcgroups\fR(7)) hierarchies accessible through
3042 /sys/fs/cgroup/
3043 will be made read\-only to all processes of the unit\&. If set to
3044 "private", the unit will run in a cgroup namespace with a private writable mount of
3045 /sys/fs/cgroup/\&. If set to
3046 "strict", the unit will run in a cgroup namespace with a private read\-only mount of
3047 /sys/fs/cgroup/\&. Defaults to off\&. If
3048 \fIProtectControlGroups=\fR
3049 is set,
3050 \fIMountAPIVFS=yes\fR
3051 is implied\&. Note
3052 "private"
3053 and
3054 "strict"
3055 are downgraded to false and true respectively unless the system is using the unified control group hierarchy and the kernel supports cgroup namespaces\&.
3056 .sp
3057 Except for container managers no services should require write access to the control groups hierarchies; it is hence recommended to set
3058 \fIProtectControlGroups=\fR
3059 to true or
3060 "strict"
3061 for most services\&. For this setting the same restrictions regarding mount propagation and privileges apply as for
3062 \fIReadOnlyPaths=\fR
3063 and related settings, see above\&.
3064 .sp
3065 This option is only available for system services and is not supported for services running in per\-user instances of the service manager\&.
3066 .sp
3067 Added in version 232\&.
3068 .RE
3069 .PP
3070 \fIRestrictAddressFamilies=\fR
3071 .RS 4
3072 Restricts the set of socket address families accessible to the processes of this unit\&. Takes
3073 "none", or a space\-separated list of address family names to allow\-list, such as
3074 \fBAF_UNIX\fR,
3075 \fBAF_INET\fR
3076 or
3077 \fBAF_INET6\fR, see
3078 \fBaddress_families\fR(7)
3079 for all possible options\&. When
3080 "none"
3081 is specified, then all address families will be denied\&. When prefixed with
3082 "~"
3083 the listed address families will be applied as deny list, otherwise as allow list\&.
3084 .sp
3085 By default, no restrictions apply, all address families are accessible to processes\&. If assigned the empty string, any previous address family restriction changes are undone\&. This setting does not affect commands prefixed with
3086 "+"\&.
3087 .sp
3088 Use this option to limit exposure of processes to remote access, in particular via exotic and sensitive network protocols, such as
3089 \fBAF_PACKET\fR\&. Note that in most cases, the local
3090 \fBAF_UNIX\fR
3091 address family should be included in the configured allow list as it is frequently used for local communication, including for
3092 \fBsyslog\fR(2)
3093 logging\&.
3094 .sp
3095 Note that this restricts access to the
3096 \fBsocket\fR(2)
3097 system call only\&. Sockets passed into the process by other means (for example, by using socket activation with socket units, see
3098 \fBsystemd.socket\fR(5)) are unaffected\&. Also, sockets created with
3099 \fBsocketpair()\fR
3100 (which creates connected AF_UNIX sockets) or the
3101 \fBio_uring\fR(7)
3102 functions, are not affected\&. Thus, it is recommended to combined this setting with
3103 \fISystemCallFilter=@service\fR, to only allow a limited subset of system calls\&.
3104 .sp
3105 Note that this option is limited to some ABIs, in particular x86\-64, but currently has no effect on 32\-bit x86, s390, s390x, mips, mips\-le, ppc, ppc\-le, ppc64, or ppc64\-le, and is ignored\&. On systems supporting multiple ABIs (such as x86/x86\-64) it is recommended to turn off alternative ABIs for services, so that they cannot be used to circumvent the restrictions of this option\&. Specifically, it is recommended to combine this option with
3106 \fISystemCallArchitectures=native\fR
3107 or similar\&.
3108 .sp
3109 Added in version 211\&.
3110 .RE
3111 .PP
3112 \fIRestrictFileSystems=\fR
3113 .RS 4
3114 Restricts the set of filesystems processes of this unit can open files on\&. Takes a space\-separated list of filesystem names\&. Any filesystem listed is made accessible to the unit\*(Aqs processes, access to filesystem types not listed is prohibited (allow\-listing)\&. If the first character of the list is
3115 "~", the effect is inverted: access to the filesystems listed is prohibited (deny\-listing)\&. If the empty string is assigned, access to filesystems is not restricted\&.
3116 .sp
3117 If you specify both types of this option (i\&.e\&. allow\-listing and deny\-listing), the first encountered will take precedence and will dictate the default action (allow access to the filesystem or deny it)\&. Then the next occurrences of this option will add or delete the listed filesystems from the set of the restricted filesystems, depending on its type and the default action\&.
3118 .sp
3119 Example: if a unit has the following,
3120 .sp
3121 .if n \{\
3122 .RS 4
3123 .\}
3124 .nf
3125 RestrictFileSystems=ext4 tmpfs
3126 RestrictFileSystems=ext2 ext4
3127 .fi
3128 .if n \{\
3129 .RE
3130 .\}
3131 .sp
3132 then access to
3133 \fBext4\fR,
3134 \fBtmpfs\fR, and
3135 \fBext2\fR
3136 is allowed and access to other filesystems is denied\&.
3137 .sp
3138 Example: if a unit has the following,
3139 .sp
3140 .if n \{\
3141 .RS 4
3142 .\}
3143 .nf
3144 RestrictFileSystems=ext4 tmpfs
3145 RestrictFileSystems=~ext4
3146 .fi
3147 .if n \{\
3148 .RE
3149 .\}
3150 .sp
3151 then only access
3152 \fBtmpfs\fR
3153 is allowed\&.
3154 .sp
3155 Example: if a unit has the following,
3156 .sp
3157 .if n \{\
3158 .RS 4
3159 .\}
3160 .nf
3161 RestrictFileSystems=~ext4 tmpfs
3162 RestrictFileSystems=ext4
3163 .fi
3164 .if n \{\
3165 .RE
3166 .\}
3167 .sp
3168 then only access to
3169 \fBtmpfs\fR
3170 is denied\&.
3171 .sp
3172 As the number of possible filesystems is large, predefined sets of filesystems are provided\&. A set starts with
3173 "@"
3174 character, followed by name of the set\&.
3175 .sp
3176 .it 1 an-trap
3177 .nr an-no-space-flag 1
3178 .nr an-break-flag 1
3179 .br
3180 .B Table\ \&4.\ \&Currently predefined filesystem sets
3181 .TS
3182 allbox tab(:);
3183 lB lB.
3184 T{
3185 Set
3186 T}:T{
3187 Description
3188 T}
3189 .T&
3190 l l
3191 l l
3192 l l
3193 l l
3194 l l
3195 l l
3196 l l
3197 l l.
3198 T{
3199 @basic\-api
3200 T}:T{
3201 Basic filesystem API\&.
3202 T}
3203 T{
3204 @auxiliary\-api
3205 T}:T{
3206 Auxiliary filesystem API\&.
3207 T}
3208 T{
3209 @common\-block
3210 T}:T{
3211 Common block device filesystems\&.
3212 T}
3213 T{
3214 @historical\-block
3215 T}:T{
3216 Historical block device filesystems\&.
3217 T}
3218 T{
3219 @network
3220 T}:T{
3221 Well\-known network filesystems\&.
3222 T}
3223 T{
3224 @privileged\-api
3225 T}:T{
3226 Privileged filesystem API\&.
3227 T}
3228 T{
3229 @temporary
3230 T}:T{
3231 Temporary filesystems: tmpfs, ramfs\&.
3232 T}
3233 T{
3234 @known
3235 T}:T{
3236 All known filesystems defined by the kernel\&. This list is defined statically in systemd based on a kernel version that was available when this systemd version was released\&. It will become progressively more out\-of\-date as the kernel is updated\&.
3237 T}
3238 .TE
3239 .sp 1
3240 Use
3241 \fBsystemd-analyze\fR(1)\*(Aqs
3242 \fBfilesystems\fR
3243 command to retrieve a list of filesystems defined on the local system\&.
3244 .sp
3245 Note that this setting might not be supported on some systems (for example if the LSM eBPF hook is not enabled in the underlying kernel or if not using the unified control group hierarchy)\&. In that case this setting has no effect\&.
3246 .sp
3247 This option cannot be bypassed by prefixing
3248 "+"
3249 to the executable path in the service unit, as it applies to the whole control group\&.
3250 .sp
3251 Added in version 250\&.
3252 .RE
3253 .PP
3254 \fIRestrictNamespaces=\fR
3255 .RS 4
3256 Restricts access to Linux namespace functionality for the processes of this unit\&. For details about Linux namespaces, see
3257 \fBnamespaces\fR(7)\&. Either takes a boolean argument, or a space\-separated list of namespace type identifiers\&. If false (the default), no restrictions on namespace creation and switching are made\&. If true, access to any kind of namespacing is prohibited\&. Otherwise, a space\-separated list of namespace type identifiers must be specified, consisting of any combination of:
3258 \fBcgroup\fR,
3259 \fBipc\fR,
3260 \fBnet\fR,
3261 \fBmnt\fR,
3262 \fBpid\fR,
3263 \fBuser\fR,
3264 \fButs\fR, and
3265 \fBtime\fR\&. Any namespace type listed is made accessible to the unit\*(Aqs processes, access to namespace types not listed is prohibited (allow\-listing)\&. By prepending the list with a single tilde character ("~") the effect may be inverted: only the listed namespace types will be made inaccessible, all unlisted ones are permitted (deny\-listing)\&. If the empty string is assigned, the default namespace restrictions are applied, which is equivalent to false\&. This option may appear more than once, in which case the namespace types are merged by
3266 \fBOR\fR, or by
3267 \fBAND\fR
3268 if the lines are prefixed with
3269 "~"
3270 (see examples below)\&. Internally, this setting limits access to the
3271 \fBunshare\fR(2),
3272 \fBclone\fR(2)
3273 and
3274 \fBsetns\fR(2)
3275 system calls, taking the specified flags parameters into account\&. Note that \(em if this option is used \(em in addition to restricting creation and switching of the specified types of namespaces (or all of them, if true) access to the
3276 \fBsetns()\fR
3277 system call with a zero flags parameter is prohibited\&. This setting is only supported on x86, x86\-64, mips, mips\-le, mips64, mips64\-le, mips64\-n32, mips64\-le\-n32, ppc64, ppc64\-le, s390 and s390x, and enforces no restrictions on other architectures\&.
3278 .sp
3279 Example: if a unit has the following,
3280 .sp
3281 .if n \{\
3282 .RS 4
3283 .\}
3284 .nf
3285 RestrictNamespaces=cgroup ipc
3286 RestrictNamespaces=cgroup net
3287 .fi
3288 .if n \{\
3289 .RE
3290 .\}
3291 .sp
3292 then
3293 \fBcgroup\fR,
3294 \fBipc\fR, and
3295 \fBnet\fR
3296 are set\&. If the second line is prefixed with
3297 "~", e\&.g\&.,
3298 .sp
3299 .if n \{\
3300 .RS 4
3301 .\}
3302 .nf
3303 RestrictNamespaces=cgroup ipc
3304 RestrictNamespaces=~cgroup net
3305 .fi
3306 .if n \{\
3307 .RE
3308 .\}
3309 .sp
3310 then, only
3311 \fBipc\fR
3312 is set\&.
3313 .sp
3314 Added in version 233\&.
3315 .RE
3316 .PP
3317 \fIDelegateNamespaces=\fR
3318 .RS 4
3319 Delegates ownership of the given namespace types to the user namespace of the processes of this unit\&. For details about Linux namespaces, see
3320 \fBnamespaces\fR(7)\&. Either takes a boolean argument, or a space\-separated list of namespace type identifiers\&. If false (the default), the unit\*(Aqs processes\*(Aq user namespace will not have ownership over any namespaces created during setup of the unit\*(Aqs sandboxed environment\&. If true, ownership of all namespace types (except for user namespaces, where the concept doesn\*(Aqt apply) created during setup of the unit\*(Aqs sandboxed environment is delegated to the unit\*(Aqs processes\*(Aq user namespace\&. Otherwise, a space\-separated list of namespace type identifiers must be specified, consisting of any combination of:
3321 \fBcgroup\fR,
3322 \fBipc\fR,
3323 \fBnet\fR,
3324 \fBmnt\fR,
3325 \fBpid\fR, and
3326 \fButs\fR\&. All namespaces of the listed types will be owned by the unit\*(Aqs processes\*(Aq user namespace if they are created during setup of the unit\*(Aqs sandboxed environment (allow\-listing)\&. By prepending the list with a single tilde character ("~") the effect may be inverted: all namespaces of types not listed and created during setup of the unit\*(Aqs sandboxed environment will be owned by the unit\*(Aqs processes\*(Aq user namespace (deny\-listing)\&. If the empty string is assigned, the default namespace ownership is applied, which is equivalent to false\&. This option may appear more than once, in which case the namespace types are merged by
3327 \fBOR\fR, or by
3328 \fBAND\fR
3329 if the lines are prefixed with
3330 "~"
3331 (see examples below)\&. Internally, this setting controls the order in which namespaces are unshared by systemd\&. Namespace types that should be owned by the unit\*(Aqs processes\*(Aq user namespace will be unshared after unsharing the user namespace\&. Internally, this setting controls the order in which namespaces are unshared\&. Delegated namespaces will be unshared after the user namespace is unshared\&. Other namespaces will be unshared before the user namespace is unshared\&.
3332 .sp
3333 Delegating any namespace with
3334 \fIDelegateNamespaces=\fR
3335 implies
3336 \fIPrivateUsers=self\fR
3337 unless
3338 \fIPrivateUsers=\fR
3339 is explicitly enabled already by the unit\&. Delegating a namespace does not imply that the namespace is unshared, that is done with the namespace specific unit setting such as
3340 \fIPrivateNetwork=\fR
3341 or
3342 \fIPrivateMounts=\fR\&.
3343 .sp
3344 Note that some namespace sandboxing options might entail mount namespace for private API VFS instances, such as
3345 \fIPrivatePIDs=\fR,
3346 \fIProtectControlGroups=private/strict\fR, or
3347 \fIPrivateNetwork=\fR\&. If any of the mentioned options are enabled, mount namespace is implicitly delegated\&.
3348 .sp
3349 Added in version 258\&.
3350 .RE
3351 .PP
3352 \fIPrivateBPF=\fR
3353 .RS 4
3354 Takes a boolean argument\&. If set, mount a private instance of the BPF filesystem on
3355 /sys/fs/bpf/, effectively hiding the host bpffs which contains information about loaded programs and maps\&. Otherwise, if
3356 \fIProtectKernelTunables=\fR
3357 is set, the instance from the host is inherited but mounted read\-only\&. Defaults to false\&.
3358 .sp
3359 This can be used together with the bpffs delegate feature to choose what BPF functions are available to the unit\*(Aqs processes\&. When mounting the BPF filesystem with the fsopen() API, four mount options can be specified to set a list of BPF commands, maps, programs and attachment types that are allowed to be used\&. Processes needs to get a file descriptor for the bpffs mountpoint and use that to get a token which will enable for that user namespace the BPF functionalities chosen upon bpffs mount\&. A more detailed explanation of the feature can be found in this
3360 \m[blue]\fBLWN post\fR\m[]\&\s-2\u[15]\d\s+2\&.
3361 .sp
3362 Added in version 258\&.
3363 .RE
3364 .PP
3365 \fIBPFDelegateCommands=\fR
3366 .RS 4
3367 Accepts a list of BPF commands to allow or
3368 "any"
3369 to allow everything\&. Defaults to none\&. The accepted values are:
3370 \fBBPFMapCreate\fR \fBBPFMapLookupElem\fR \fBBPFMapUpdateElem\fR \fBBPFMapDeleteElem\fR \fBBPFMapGetNextKey\fR \fBBPFProgLoad\fR \fBBPFObjPin\fR \fBBPFObjGet\fR \fBBPFProgAttach\fR \fBBPFProgDetach\fR \fBBPFProgTestRun\fR \fBBPFProgGetNextId\fR \fBBPFMapGetNextId\fR \fBBPFProgGetFdById\fR \fBBPFMapGetFdById\fR \fBBPFObjGetInfoByFd\fR \fBBPFProgQuery\fR \fBBPFRawTracepointOpen\fR \fBBPFBtfLoad\fR \fBBPFBtfGetFdById\fR \fBBPFTaskFdQuery\fR \fBBPFMapLookupAndDeleteElem\fR \fBBPFMapFreeze\fR \fBBPFBtfGetNextId\fR \fBBPFMapLookupBatch\fR \fBBPFMapLookupAndDeleteBatch\fR \fBBPFMapUpdateBatch\fR \fBBPFMapDeleteBatch\fR \fBBPFLinkCreate\fR \fBBPFLinkUpdate\fR \fBBPFLinkGetFdById\fR \fBBPFLinkGetNextId\fR \fBBPFEnableStats\fR \fBBPFIterCreate\fR \fBBPFLinkDetach\fR \fBBPFProgBindMap\fR \fBBPFTokenCreate\fR \fBBPFProgStreamReadByFd\fR \fBBPFProgAssocStructOps\fR
3371 This will set the
3372 \fBdelegate_cmds\fR
3373 bpffs mount option\&.
3374 .sp
3375 Requires
3376 \fIPrivateBPF=yes\fR
3377 to be effective, see
3378 \fIPrivateBPF=\fR
3379 more details\&.
3380 .sp
3381 Added in version 258\&.
3382 .RE
3383 .PP
3384 \fIBPFDelegateMaps=\fR
3385 .RS 4
3386 Accepts a list of BPF maps to allow or
3387 "any"
3388 to allow everything\&. Defaults to none\&. The accepted values are:
3389 \fBBPFMapTypeUnspec\fR \fBBPFMapTypeHash\fR \fBBPFMapTypeArray\fR \fBBPFMapTypeProgArray\fR \fBBPFMapTypePerfEventArray\fR \fBBPFMapTypePercpuHash\fR \fBBPFMapTypePercpuArray\fR \fBBPFMapTypeStackTrace\fR \fBBPFMapTypeCgroupArray\fR \fBBPFMapTypeLruHash\fR \fBBPFMapTypeLruPercpuHash\fR \fBBPFMapTypeLpmTrie\fR \fBBPFMapTypeArrayOfMaps\fR \fBBPFMapTypeHashOfMaps\fR \fBBPFMapTypeDevmap\fR \fBBPFMapTypeSockmap\fR \fBBPFMapTypeCpumap\fR \fBBPFMapTypeXskmap\fR \fBBPFMapTypeSockhash\fR \fBBPFMapTypeCgroupStorageDeprecated\fR \fBBPFMapTypeReuseportSockarray\fR \fBBPFMapTypePercpuCgroupStorageDeprecated\fR \fBBPFMapTypeQueue\fR \fBBPFMapTypeStack\fR \fBBPFMapTypeSkStorage\fR \fBBPFMapTypeDevmapHash\fR \fBBPFMapTypeStructOps\fR \fBBPFMapTypeRingbuf\fR \fBBPFMapTypeInodeStorage\fR \fBBPFMapTypeTaskStorage\fR \fBBPFMapTypeBloomFilter\fR \fBBPFMapTypeUserRingbuf\fR \fBBPFMapTypeCgrpStorage\fR \fBBPFMapTypeArena\fR \fBBPFMapTypeInsnArray\fR
3390 This will set the
3391 \fBdelegate_maps\fR
3392 bpffs mount option\&.
3393 .sp
3394 Requires
3395 \fIPrivateBPF=yes\fR
3396 to be effective, see
3397 \fIPrivateBPF=\fR
3398 more details\&.
3399 .sp
3400 Added in version 258\&.
3401 .RE
3402 .PP
3403 \fIBPFDelegatePrograms=\fR
3404 .RS 4
3405 Accepts a list of BPF programs to allow or
3406 "any"
3407 to allow everything\&. Defaults to none\&. The accepted values are:
3408 \fBBPFProgTypeUnspec\fR \fBBPFProgTypeSocketFilter\fR \fBBPFProgTypeKprobe\fR \fBBPFProgTypeSchedCls\fR \fBBPFProgTypeSchedAct\fR \fBBPFProgTypeTracepoint\fR \fBBPFProgTypeXdp\fR \fBBPFProgTypePerfEvent\fR \fBBPFProgTypeCgroupSkb\fR \fBBPFProgTypeCgroupSock\fR \fBBPFProgTypeLwtIn\fR \fBBPFProgTypeLwtOut\fR \fBBPFProgTypeLwtXmit\fR \fBBPFProgTypeSockOps\fR \fBBPFProgTypeSkSkb\fR \fBBPFProgTypeCgroupDevice\fR \fBBPFProgTypeSkMsg\fR \fBBPFProgTypeRawTracepoint\fR \fBBPFProgTypeCgroupSockAddr\fR \fBBPFProgTypeLwtSeg6local\fR \fBBPFProgTypeLircMode2\fR \fBBPFProgTypeSkReuseport\fR \fBBPFProgTypeFlowDissector\fR \fBBPFProgTypeCgroupSysctl\fR \fBBPFProgTypeRawTracepointWritable\fR \fBBPFProgTypeCgroupSockopt\fR \fBBPFProgTypeTracing\fR \fBBPFProgTypeStructOps\fR \fBBPFProgTypeExt\fR \fBBPFProgTypeLsm\fR \fBBPFProgTypeSkLookup\fR \fBBPFProgTypeNetfilter\fR
3409 This will set the
3410 \fBdelegate_progs\fR
3411 bpffs mount option\&.
3412 .sp
3413 Requires
3414 \fIPrivateBPF=yes\fR
3415 to be effective, see
3416 \fIPrivateBPF=\fR
3417 more details\&.
3418 .sp
3419 Added in version 258\&.
3420 .RE
3421 .PP
3422 \fIBPFDelegateAttachments=\fR
3423 .RS 4
3424 Accepts a list of BPF attach points to allow or
3425 "any"
3426 to allow everything\&. Defaults to none\&. The accepted values are:
3427 \fBBPFCgroupInetIngress\fR \fBBPFCgroupInetEgress\fR \fBBPFCgroupInetSockCreate\fR \fBBPFCgroupSockOps\fR \fBBPFSkSkbStreamParser\fR \fBBPFSkSkbStreamVerdict\fR \fBBPFCgroupDevice\fR \fBBPFSkMsgVerdict\fR \fBBPFCgroupInet4Bind\fR \fBBPFCgroupInet6Bind\fR \fBBPFCgroupInet4Connect\fR \fBBPFCgroupInet6Connect\fR \fBBPFCgroupInet4PostBind\fR \fBBPFCgroupInet6PostBind\fR \fBBPFCgroupUdp4Sendmsg\fR \fBBPFCgroupUdp6Sendmsg\fR \fBBPFLircMode2\fR \fBBPFFlowDissector\fR \fBBPFCgroupSysctl\fR \fBBPFCgroupUdp4Recvmsg\fR \fBBPFCgroupUdp6Recvmsg\fR \fBBPFCgroupGetsockopt\fR \fBBPFCgroupSetsockopt\fR \fBBPFTraceRawTp\fR \fBBPFTraceFentry\fR \fBBPFTraceFexit\fR \fBBPFModifyReturn\fR \fBBPFLsmMac\fR \fBBPFTraceIter\fR \fBBPFCgroupInet4Getpeername\fR \fBBPFCgroupInet6Getpeername\fR \fBBPFCgroupInet4Getsockname\fR \fBBPFCgroupInet6Getsockname\fR \fBBPFXdpDevmap\fR \fBBPFCgroupInetSockRelease\fR \fBBPFXdpCpumap\fR \fBBPFSkLookup\fR \fBBPFXdp\fR \fBBPFSkSkbVerdict\fR \fBBPFSkReuseportSelect\fR \fBBPFSkReuseportSelectOrMigrate\fR \fBBPFPerfEvent\fR \fBBPFTraceKprobeMulti\fR \fBBPFLsmCgroup\fR \fBBPFStructOps\fR \fBBPFNetfilter\fR \fBBPFTcxIngress\fR \fBBPFTcxEgress\fR \fBBPFTraceUprobeMulti\fR \fBBPFCgroupUnixConnect\fR \fBBPFCgroupUnixSendmsg\fR \fBBPFCgroupUnixRecvmsg\fR \fBBPFCgroupUnixGetpeername\fR \fBBPFCgroupUnixGetsockname\fR \fBBPFNetkitPrimary\fR \fBBPFNetkitPeer\fR \fBBPFTraceKprobeSession\fR \fBBPFTraceUprobeSession\fR \fBBPFTraceFsession\fR
3428 This will set the
3429 \fBdelegate_attachs\fR
3430 bpffs mount option\&.
3431 .sp
3432 Requires
3433 \fIPrivateBPF=yes\fR
3434 to be effective, see
3435 \fIPrivateBPF=\fR
3436 more details\&.
3437 .sp
3438 Added in version 258\&.
3439 .RE
3440 .PP
3441 \fILockPersonality=\fR
3442 .RS 4
3443 Takes a boolean argument\&. If set, locks down the
3444 \fBpersonality\fR(2)
3445 system call so that the kernel execution domain may not be changed from the default or the personality selected with
3446 \fIPersonality=\fR
3447 directive\&. This may be useful to improve security, because odd personality emulations may be poorly tested and source of vulnerabilities\&.
3448 .sp
3449 Added in version 235\&.
3450 .RE
3451 .PP
3452 \fIMemoryDenyWriteExecute=\fR
3453 .RS 4
3454 Takes a boolean argument\&. If set, attempts to create memory mappings that are writable and executable at the same time, or to change existing memory mappings to become executable, or mapping shared memory segments as executable, are prohibited\&. Specifically, a system call filter is added (or preferably, an equivalent kernel check is enabled with
3455 \fBprctl\fR(2)) that rejects
3456 \fBmmap\fR(2)
3457 system calls with both
3458 \fBPROT_EXEC\fR
3459 and
3460 \fBPROT_WRITE\fR
3461 set,
3462 \fBmprotect\fR(2)
3463 or
3464 \fBpkey_mprotect\fR(2)
3465 system calls with
3466 \fBPROT_EXEC\fR
3467 set and
3468 \fBshmat\fR(2)
3469 system calls with
3470 \fBSHM_EXEC\fR
3471 set\&. Note that this option is incompatible with programs and libraries that generate program code dynamically at runtime, including JIT execution engines, executable stacks, and code "trampoline" feature of various C compilers\&. This option improves service security, as it makes harder for software exploits to change running code dynamically\&. However, the protection can be circumvented, if the service can write to a filesystem, which is not mounted with
3472 \fBnoexec\fR
3473 (such as
3474 /dev/shm), or it can use
3475 \fBmemfd_create()\fR\&. This can be prevented by making such file systems inaccessible to the service (e\&.g\&.
3476 \fIInaccessiblePaths=/dev/shm\fR) and installing further system call filters (\fISystemCallFilter=~memfd_create\fR)\&. Note that this feature is fully available on x86\-64, and partially on x86\&. Specifically, the
3477 \fBshmat()\fR
3478 protection is not available on x86\&. Note that on systems supporting multiple ABIs (such as x86/x86\-64) it is recommended to turn off alternative ABIs for services, so that they cannot be used to circumvent the restrictions of this option\&. Specifically, it is recommended to combine this option with
3479 \fISystemCallArchitectures=native\fR
3480 or similar\&.
3481 .sp
3482 Added in version 231\&.
3483 .RE
3484 .PP
3485 \fIRestrictRealtime=\fR
3486 .RS 4
3487 Takes a boolean argument\&. If set, any attempts to enable realtime scheduling in a process of the unit are refused\&. This restricts access to realtime task scheduling policies such as
3488 \fBSCHED_FIFO\fR,
3489 \fBSCHED_RR\fR
3490 or
3491 \fBSCHED_DEADLINE\fR\&. See
3492 \fBsched\fR(7)
3493 for details about these scheduling policies\&. Realtime scheduling policies may be used to monopolize CPU time for longer periods of time, and may hence be used to lock up or otherwise trigger Denial\-of\-Service situations on the system\&. It is hence recommended to restrict access to realtime scheduling to the few programs that actually require them\&. Defaults to off\&.
3494 .sp
3495 Added in version 231\&.
3496 .RE
3497 .PP
3498 \fIRestrictSUIDSGID=\fR
3499 .RS 4
3500 Takes a boolean argument\&. If set, any attempts to set the set\-user\-ID (SUID) or set\-group\-ID (SGID) bits on files or directories will be denied (for details on these bits see
3501 \fBinode\fR(7))\&. As the SUID/SGID bits are mechanisms to elevate privileges, and allow users to acquire the identity of other users, it is recommended to restrict creation of SUID/SGID files to the few programs that actually require them\&. Note that this restricts marking of any type of file system object with these bits, including both regular files and directories (where the SGID is a different meaning than for files, see documentation)\&. This option is implied if
3502 \fIDynamicUser=\fR
3503 is enabled\&.
3504 .sp
3505 In other cases, this setting defaults to the value set with
3506 \fIDefaultRestrictSUIDSGID=\fR
3507 in
3508 \fBsystemd-system.conf\fR(5), which defaults to off\&.
3509 .sp
3510 Added in version 242\&.
3511 .RE
3512 .PP
3513 \fIRemoveIPC=\fR
3514 .RS 4
3515 Takes a boolean parameter\&. If set, all System V and POSIX IPC objects owned by the user and group the processes of this unit are run as are removed when the unit is stopped\&. This setting only has an effect if at least one of
3516 \fIUser=\fR,
3517 \fIGroup=\fR
3518 and
3519 \fIDynamicUser=\fR
3520 are used\&. It has no effect on IPC objects owned by the root user\&. Specifically, this removes System V semaphores, as well as System V and POSIX shared memory segments and message queues\&. If multiple units use the same user or group the IPC objects are removed when the last of these units is stopped\&. This setting is implied if
3521 \fIDynamicUser=\fR
3522 is set\&.
3523 .sp
3524 This option is only available for system services and is not supported for services running in per\-user instances of the service manager\&.
3525 .sp
3526 Added in version 232\&.
3527 .RE
3528 .PP
3529 \fIPrivateMounts=\fR
3530 .RS 4
3531 Takes a boolean parameter\&. If set, the processes of this unit will be run in their own private file system (mount) namespace with all mount propagation from the processes towards the host\*(Aqs main file system namespace turned off\&. This means any file system mount points established or removed by the unit\*(Aqs processes will be private to them and not be visible to the host\&. However, file system mount points established or removed on the host will be propagated to the unit\*(Aqs processes\&. See
3532 \fBmount_namespaces\fR(7)
3533 for details on file system namespaces\&. Defaults to off\&.
3534 .sp
3535 When turned on, this executes three operations for each invoked process: a new
3536 \fBCLONE_NEWNS\fR
3537 namespace is created, after which all existing mounts are remounted to
3538 \fBMS_SLAVE\fR
3539 to disable propagation from the unit\*(Aqs processes to the host (but leaving propagation in the opposite direction in effect)\&. Finally, the mounts are remounted again to the propagation mode configured with
3540 \fIMountFlags=\fR, see below\&.
3541 .sp
3542 File system namespaces are set up individually for each process forked off by the service manager\&. Mounts established in the namespace of the process created by
3543 \fIExecStartPre=\fR
3544 will hence be cleaned up automatically as soon as that process exits and will not be available to subsequent processes forked off for
3545 \fIExecStart=\fR
3546 (and similar applies to the various other commands configured for units)\&. Similarly,
3547 \fIJoinsNamespaceOf=\fR
3548 does not permit sharing kernel mount namespaces between units, it only enables sharing of the
3549 /tmp/
3550 and
3551 /var/tmp/
3552 directories\&.
3553 .sp
3554 Other file system namespace unit settings \(em
3555 \fIPrivateTmp=\fR,
3556 \fIPrivateDevices=\fR,
3557 \fIProtectSystem=\fR,
3558 \fIProtectHome=\fR,
3559 \fIReadOnlyPaths=\fR,
3560 \fIInaccessiblePaths=\fR,
3561 \fIReadWritePaths=\fR,
3562 \fIBindPaths=\fR,
3563 \fIBindReadOnlyPaths=\fR, \&... \(em also enable file system namespacing in a fashion equivalent to this option\&. Hence it is primarily useful to explicitly request this behaviour if none of the other settings are used\&.
3564 .sp
3565 This option is only available for system services, or for services running in per\-user instances of the service manager in which case
3566 \fIPrivateUsers=\fR
3567 is implicitly enabled (requires unprivileged user namespaces support to be enabled in the kernel via the
3568 "kernel\&.unprivileged_userns_clone="
3569 sysctl)\&.
3570 .sp
3571 Added in version 239\&.
3572 .RE
3573 .PP
3574 \fIMountFlags=\fR
3575 .RS 4
3576 Takes a mount propagation setting:
3577 \fBshared\fR,
3578 \fBslave\fR
3579 or
3580 \fBprivate\fR, which controls whether file system mount points in the file system namespaces set up for this unit\*(Aqs processes will receive or propagate mounts and unmounts from other file system namespaces\&. See
3581 \fBmount\fR(2)
3582 for details on mount propagation, and the three propagation flags in particular\&.
3583 .sp
3584 This setting only controls the
3585 \fIfinal\fR
3586 propagation setting in effect on all mount points of the file system namespace created for each process of this unit\&. Other file system namespacing unit settings (see the discussion in
3587 \fIPrivateMounts=\fR
3588 above) will implicitly disable mount and unmount propagation from the unit\*(Aqs processes towards the host by changing the propagation setting of all mount points in the unit\*(Aqs file system namespace to
3589 \fBslave\fR
3590 first\&. Setting this option to
3591 \fBshared\fR
3592 does not reestablish propagation in that case\&.
3593 .sp
3594 If not set \(en but file system namespaces are enabled through another file system namespace unit setting \(en
3595 \fBshared\fR
3596 mount propagation is used, but \(em as mentioned \(em as
3597 \fBslave\fR
3598 is applied first, propagation from the unit\*(Aqs processes to the host is still turned off\&.
3599 .sp
3600 It is not recommended to use
3601 \fBprivate\fR
3602 mount propagation for units, as this means temporary mounts (such as removable media) of the host will stay mounted and thus indefinitely busy in forked off processes, as unmount propagation events will not be received by the file system namespace of the unit\&.
3603 .sp
3604 Usually, it is best to leave this setting unmodified, and use higher level file system namespacing options instead, in particular
3605 \fIPrivateMounts=\fR, see above\&.
3606 .sp
3607 This option is only available for system services, or for services running in per\-user instances of the service manager in which case
3608 \fIPrivateUsers=\fR
3609 is implicitly enabled (requires unprivileged user namespaces support to be enabled in the kernel via the
3610 "kernel\&.unprivileged_userns_clone="
3611 sysctl)\&.
3612 .RE
3613 .SH "SYSTEM CALL FILTERING"
3614 .PP
3615 \fISystemCallFilter=\fR
3616 .RS 4
3617 Takes a space\-separated list of system call names or system call groups\&. If this setting is used, system calls executed by the unit processes except for the listed ones will result in the system call being denied (allow\-listing)\&. If the first character of the list is
3618 "~", the effect is inverted: only the listed system calls will be denied (deny\-listing)\&. This option may be specified more than once, in which case the filter masks are merged\&. If the empty string is assigned, the filter is reset, all prior assignments will have no effect\&.
3619 .sp
3620 Commands prefixed with
3621 "+"
3622 are not subject to filtering\&. The
3623 \fBexecve()\fR,
3624 \fBexit()\fR,
3625 \fBexit_group()\fR,
3626 \fBgetrlimit()\fR,
3627 \fBrt_sigreturn()\fR,
3628 \fBsigreturn()\fR
3629 system calls and the system calls for querying time and sleeping are implicitly allow\-listed and do not need to be listed explicitly\&.
3630 .sp
3631 The default action when a system call is denied is to terminate the processes with a
3632 \fBSIGSYS\fR
3633 signal\&. This can changed using
3634 \fISystemCallErrorNumber=\fR, see below\&. In addition, deny\-listed system calls and system call groups may optionally be suffixed with a colon (":") and an argument in the same format as
3635 \fISystemCallErrorNumber=\fR, to take this action when the matching system call is made\&. This takes precedence over the action specified in
3636 \fISystemCallErrorNumber=\fR\&.
3637 .sp
3638 This feature makes use of the Secure Computing Mode 2 interfaces of the kernel (\*(Aqseccomp filtering\*(Aq) and is useful for enforcing a minimal sandboxing environment\&.
3639 .sp
3640 Note that on systems supporting multiple ABIs (such as x86/x86\-64) it is recommended to turn off alternative ABIs for services, so that they cannot be used to circumvent the restrictions of this option\&. Specifically, it is recommended to combine this option with
3641 \fISystemCallArchitectures=native\fR
3642 or similar\&.
3643 .sp
3644 Note that strict system call filters may impact execution and error handling code paths of the service invocation\&. Specifically, access to the
3645 \fBexecve()\fR
3646 system call is required for the execution of the service binary \(em if it is blocked service invocation will necessarily fail\&. Also, if execution of the service binary fails for some reason (for example: missing service executable), the error handling logic might require access to an additional set of system calls in order to process and log this failure correctly\&. It might be necessary to temporarily disable system call filters in order to allow debugging of such failures\&.
3647 .sp
3648 If you specify both types of this option (i\&.e\&. allow\-listing and deny\-listing), the first encountered will take precedence and will dictate the default action (termination or approval of a system call)\&. Then the next occurrences of this option will add or delete the listed system calls from the set of the filtered system calls, depending of its type and the default action\&. (For example, if you have started with an allow list rule for
3649 \fBread()\fR
3650 and
3651 \fBwrite()\fR, and right after it add a deny list rule for
3652 \fBwrite()\fR, then
3653 \fBwrite()\fR
3654 will be removed from the set\&.)
3655 .sp
3656 As the number of possible system calls is large, predefined groups of system calls are provided\&. A group starts with
3657 "@"
3658 character, followed by name of the set\&.
3659 .sp
3660 .it 1 an-trap
3661 .nr an-no-space-flag 1
3662 .nr an-break-flag 1
3663 .br
3664 .B Table\ \&5.\ \&Currently predefined system call sets
3665 .TS
3666 allbox tab(:);
3667 lB lB.
3668 T{
3669 Set
3670 T}:T{
3671 Description
3672 T}
3673 .T&
3674 l l
3675 l l
3676 l l
3677 l l
3678 l l
3679 l l
3680 l l
3681 l l
3682 l l
3683 l l
3684 l l
3685 l l
3686 l l
3687 l l
3688 l l
3689 l l
3690 l l
3691 l l
3692 l l
3693 l l
3694 l l
3695 l l
3696 l l
3697 l l
3698 l l
3699 l l
3700 l l
3701 l l
3702 l l.
3703 T{
3704 @aio
3705 T}:T{
3706 Asynchronous I/O (\fBio_setup\fR(2), \fBio_submit\fR(2), and related calls)
3707 T}
3708 T{
3709 @basic\-io
3710 T}:T{
3711 System calls for basic I/O: reading, writing, seeking, file descriptor duplication and closing (\fBread\fR(2), \fBwrite\fR(2), and related calls)
3712 T}
3713 T{
3714 @chown
3715 T}:T{
3716 Changing file ownership (\fBchown\fR(2), \fBfchownat\fR(2), and related calls)
3717 T}
3718 T{
3719 @clock
3720 T}:T{
3721 System calls for changing the system clock (\fBadjtimex\fR(2), \fBsettimeofday\fR(2), and related calls)
3722 T}
3723 T{
3724 @cpu\-emulation
3725 T}:T{
3726 System calls for CPU emulation functionality (\fBvm86\fR(2) and related calls)
3727 T}
3728 T{
3729 @debug
3730 T}:T{
3731 Debugging, performance monitoring and tracing functionality (\fBptrace\fR(2), \fBperf_event_open\fR(2) and related calls)
3732 T}
3733 T{
3734 @file\-system
3735 T}:T{
3736 File system operations: opening, creating files and directories for read and write, renaming and removing them, reading file properties, or creating hard and symbolic links
3737 T}
3738 T{
3739 @io\-event
3740 T}:T{
3741 Event loop system calls (\fBpoll\fR(2), \fBselect\fR(2), \fBepoll\fR(7), \fBeventfd\fR(2) and related calls)
3742 T}
3743 T{
3744 @ipc
3745 T}:T{
3746 Pipes, SysV IPC, POSIX Message Queues and other IPC (\fBmq_overview\fR(7), \fBsvipc\fR(7))
3747 T}
3748 T{
3749 @keyring
3750 T}:T{
3751 Kernel keyring access (\fBkeyctl\fR(2) and related calls)
3752 T}
3753 T{
3754 @memlock
3755 T}:T{
3756 Locking of memory in RAM (\fBmlock\fR(2), \fBmlockall\fR(2) and related calls)
3757 T}
3758 T{
3759 @module
3760 T}:T{
3761 Loading and unloading of kernel modules (\fBinit_module\fR(2), \fBdelete_module\fR(2) and related calls)
3762 T}
3763 T{
3764 @mount
3765 T}:T{
3766 Mounting and unmounting of file systems (\fBmount\fR(2), \fBchroot\fR(2), and related calls)
3767 T}
3768 T{
3769 @network\-io
3770 T}:T{
3771 Socket I/O (including local AF_UNIX): \fBsocket\fR(7), \fBunix\fR(7)
3772 T}
3773 T{
3774 @obsolete
3775 T}:T{
3776 Unusual, obsolete or unimplemented (\fBcreate_module\fR(2), \fBgtty\fR(2), \&...)
3777 T}
3778 T{
3779 @pkey
3780 T}:T{
3781 System calls that deal with memory protection keys (\fBpkeys\fR(7))
3782 T}
3783 T{
3784 @privileged
3785 T}:T{
3786 All system calls which need super\-user capabilities (\fBcapabilities\fR(7))
3787 T}
3788 T{
3789 @process
3790 T}:T{
3791 Process control, execution, namespacing operations (\fBclone\fR(2), \fBkill\fR(2), \fBnamespaces\fR(7), \&...)
3792 T}
3793 T{
3794 @raw\-io
3795 T}:T{
3796 Raw I/O port access (\fBioperm\fR(2), \fBiopl\fR(2), \fBpciconfig_read()\fR, \&...)
3797 T}
3798 T{
3799 @reboot
3800 T}:T{
3801 System calls for rebooting and reboot preparation (\fBreboot\fR(2), \fBkexec()\fR, \&...)
3802 T}
3803 T{
3804 @resources
3805 T}:T{
3806 System calls for changing resource limits, memory and scheduling parameters (\fBsetrlimit\fR(2), \fBsetpriority\fR(2), \&...)
3807 T}
3808 T{
3809 @sandbox
3810 T}:T{
3811 System calls for sandboxing programs (\fBseccomp\fR(2), Landlock system calls, \&...)
3812 T}
3813 T{
3814 @setuid
3815 T}:T{
3816 System calls for changing user ID and group ID credentials, (\fBsetuid\fR(2), \fBsetgid\fR(2), \fBsetresuid\fR(2), \&...)
3817 T}
3818 T{
3819 @signal
3820 T}:T{
3821 System calls for manipulating and handling process signals (\fBsignal\fR(2), \fBsigprocmask\fR(2), \&...)
3822 T}
3823 T{
3824 @swap
3825 T}:T{
3826 System calls for enabling/disabling swap devices (\fBswapon\fR(2), \fBswapoff\fR(2))
3827 T}
3828 T{
3829 @sync
3830 T}:T{
3831 Synchronizing files and memory to disk (\fBfsync\fR(2), \fBmsync\fR(2), and related calls)
3832 T}
3833 T{
3834 @system\-service
3835 T}:T{
3836 A reasonable set of system calls used by common system services, excluding any special purpose calls\&. This is the recommended starting point for allow\-listing system calls for system services, as it contains what is typically needed by system services, but excludes overly specific interfaces\&. For example, the following APIs are excluded: "@clock", "@mount", "@swap", "@reboot"\&.
3837 T}
3838 T{
3839 @timer
3840 T}:T{
3841 System calls for scheduling operations by time (\fBalarm\fR(2), \fBtimer_create\fR(2), \&...)
3842 T}
3843 T{
3844 @known
3845 T}:T{
3846 All system calls defined by the kernel\&. This list is defined statically in systemd based on a kernel version that was available when this systemd version was released\&. It will become progressively more out\-of\-date as the kernel is updated\&.
3847 T}
3848 .TE
3849 .sp 1
3850 Note, that as new system calls are added to the kernel, additional system calls might be added to the groups above\&. Contents of the sets may also change between systemd versions\&. In addition, the list of system calls depends on the kernel version and architecture for which systemd was compiled\&. Use
3851 \fBsystemd\-analyze\ \&syscall\-filter\fR
3852 to list the actual list of system calls in each filter\&.
3853 .sp
3854 Generally, allow\-listing system calls (rather than deny\-listing) is the safer mode of operation\&. It is recommended to enforce system call allow lists for all long\-running system services\&. Specifically, the following lines are a relatively safe basic choice for the majority of system services:
3855 .sp
3856 .if n \{\
3857 .RS 4
3858 .\}
3859 .nf
3860 [Service]
3861 SystemCallFilter=@system\-service
3862 SystemCallErrorNumber=EPERM
3863 .fi
3864 .if n \{\
3865 .RE
3866 .\}
3867 .sp
3868 Note that various kernel system calls are defined redundantly: there are multiple system calls for executing the same operation\&. For example, the
3869 \fBpidfd_send_signal()\fR
3870 system call may be used to execute operations similar to what can be done with the older
3871 \fBkill()\fR
3872 system call, hence blocking the latter without the former only provides weak protection\&. Since new system calls are added regularly to the kernel as development progresses, keeping system call deny lists comprehensive requires constant work\&. It is thus recommended to use allow\-listing instead, which offers the benefit that new system calls are by default implicitly blocked until the allow list is updated\&.
3873 .sp
3874 Also note that a number of system calls are required to be accessible for the dynamic linker to work\&. The dynamic linker is required for running most regular programs (specifically: all dynamic ELF binaries, which is how most distributions build packaged programs)\&. This means that blocking these system calls (which include
3875 \fBopen()\fR,
3876 \fBopenat()\fR
3877 or
3878 \fBmmap()\fR) will make most programs typically shipped with generic distributions unusable\&.
3879 .sp
3880 It is recommended to combine the file system namespacing related options with
3881 \fISystemCallFilter=~@mount\fR, in order to prohibit the unit\*(Aqs processes to undo the mappings\&. Specifically these are the options
3882 \fIPrivateTmp=\fR,
3883 \fIPrivateDevices=\fR,
3884 \fIProtectSystem=\fR,
3885 \fIProtectHome=\fR,
3886 \fIProtectKernelTunables=\fR,
3887 \fIProtectControlGroups=\fR,
3888 \fIProtectKernelLogs=\fR,
3889 \fIProtectClock=\fR,
3890 \fIReadOnlyPaths=\fR,
3891 \fIInaccessiblePaths=\fR
3892 and
3893 \fIReadWritePaths=\fR\&.
3894 .sp
3895 Added in version 187\&.
3896 .RE
3897 .PP
3898 \fISystemCallErrorNumber=\fR
3899 .RS 4
3900 Takes an
3901 "errno"
3902 error number (between 1 and 4095) or errno name such as
3903 \fBEPERM\fR,
3904 \fBEACCES\fR
3905 or
3906 \fBEUCLEAN\fR, to return when the system call filter configured with
3907 \fISystemCallFilter=\fR
3908 is triggered, instead of terminating the process immediately\&. See
3909 \fBerrno\fR(3)
3910 for a full list of error codes\&. When this setting is not used, or when the empty string or the special setting
3911 "kill"
3912 is assigned, the process will be terminated immediately when the filter is triggered\&.
3913 .sp
3914 Added in version 209\&.
3915 .RE
3916 .PP
3917 \fISystemCallArchitectures=\fR
3918 .RS 4
3919 Takes a space\-separated list of architecture identifiers to include in the system call filter\&. The known architecture identifiers are the same as for
3920 \fIConditionArchitecture=\fR
3921 described in
3922 \fBsystemd.unit\fR(5), as well as
3923 \fBx32\fR,
3924 \fBmips64\-n32\fR,
3925 \fBmips64\-le\-n32\fR, and the special identifier
3926 \fBnative\fR\&. The special identifier
3927 \fBnative\fR
3928 implicitly maps to the native architecture of the system (or more precisely: to the architecture the system manager is compiled for)\&. By default, this option is set to the empty list, i\&.e\&. no filtering is applied\&.
3929 .sp
3930 If this setting is used, processes of this unit will only be permitted to call native system calls, and system calls of the specified architectures\&. For the purposes of this option, the x32 architecture is treated as including x86\-64 system calls\&. However, this setting still fulfills its purpose, as explained below, on x32\&.
3931 .sp
3932 System call filtering is not equally effective on all architectures\&. For example, on x86 filtering of network socket\-related calls is not possible, due to ABI limitations \(em a limitation that x86\-64 does not have, however\&. On systems supporting multiple ABIs at the same time \(em such as x86/x86\-64 \(em it is hence recommended to limit the set of permitted system call architectures so that secondary ABIs may not be used to circumvent the restrictions applied to the native ABI of the system\&. In particular, setting
3933 \fISystemCallArchitectures=native\fR
3934 is a good choice for disabling non\-native ABIs\&.
3935 .sp
3936 System call architectures may also be restricted system\-wide via the
3937 \fISystemCallArchitectures=\fR
3938 option in the global configuration\&. See
3939 \fBsystemd-system.conf\fR(5)
3940 for details\&.
3941 .sp
3942 Added in version 209\&.
3943 .RE
3944 .PP
3945 \fISystemCallLog=\fR
3946 .RS 4
3947 Takes a space\-separated list of system call names\&. If this setting is used, all system calls executed by the unit processes for the listed ones will be logged\&. If the first character of the list is
3948 "~", the effect is inverted: all system calls except the listed system calls will be logged\&. This feature makes use of the Secure Computing Mode 2 interfaces of the kernel (\*(Aqseccomp filtering\*(Aq) and is useful for auditing or setting up a minimal sandboxing environment\&. This option may be specified more than once, in which case the filter masks are merged\&. If the empty string is assigned, the filter is reset, all prior assignments will have no effect\&. This does not affect commands prefixed with
3949 "+"\&.
3950 .sp
3951 Added in version 247\&.
3952 .RE
3953 .SH "ENVIRONMENT"
3954 .PP
3955 \fIEnvironment=\fR
3956 .RS 4
3957 Sets environment variables for executed processes\&. Each line is unquoted using the rules described in "Quoting" section in
3958 \fBsystemd.syntax\fR(7)
3959 and becomes a list of variable assignments\&. If you need to assign a value containing spaces or the equals sign to a variable, put quotes around the whole assignment\&. Variable expansion is not performed inside the strings and the
3960 "$"
3961 character has no special meaning\&. Specifier expansion is performed, see the "Specifiers" section in
3962 \fBsystemd.unit\fR(5)\&.
3963 .sp
3964 This option may be specified more than once, in which case all listed variables will be set\&. If the same variable is listed twice, the later setting will override the earlier setting\&. If the empty string is assigned to this option, the list of environment variables is reset, all prior assignments have no effect\&.
3965 .sp
3966 The names of the variables can contain ASCII letters, digits, and the underscore character\&. Variable names cannot be empty or start with a digit\&. In variable values, most characters are allowed, but non\-printable characters are currently rejected\&.
3967 .sp
3968 Example:
3969 .sp
3970 .if n \{\
3971 .RS 4
3972 .\}
3973 .nf
3974 Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6"
3975 .fi
3976 .if n \{\
3977 .RE
3978 .\}
3979 .sp
3980 gives three variables
3981 "VAR1",
3982 "VAR2",
3983 "VAR3"
3984 with the values
3985 "word1 word2",
3986 "word3",
3987 "$word 5 6"\&.
3988 .sp
3989 See
3990 \fBenviron\fR(7)
3991 for details about environment variables\&.
3992 .sp
3993 Note that environment variables are not suitable for passing secrets (such as passwords, key material, \&...) to service processes\&. Environment variables set for a unit are exposed to unprivileged clients via D\-Bus IPC, and generally not understood as being data that requires protection\&. Moreover, environment variables are propagated down the process tree, including across security boundaries (such as setuid/setgid executables), and hence might leak to processes that should not have access to the secret data\&. Use
3994 \fILoadCredential=\fR,
3995 \fILoadCredentialEncrypted=\fR
3996 or
3997 \fISetCredentialEncrypted=\fR
3998 (see below) to pass data to unit processes securely\&.
3999 .RE
4000 .PP
4001 \fIEnvironmentFile=\fR
4002 .RS 4
4003 Similar to
4004 \fIEnvironment=\fR, but reads the environment variables from a text file\&. The text file should contain newline\-separated variable assignments\&. Empty lines, lines without an
4005 "="
4006 separator, or lines starting with
4007 ";"
4008 or
4009 "#"
4010 will be ignored, which may be used for commenting\&. The file must be encoded with UTF\-8\&. Valid characters are
4011 \m[blue]\fBunicode scalar values\fR\m[]\&\s-2\u[16]\d\s+2
4012 other than
4013 \m[blue]\fBunicode noncharacters\fR\m[]\&\s-2\u[17]\d\s+2,
4014 \fBU+0000\fR
4015 \fBNUL\fR, and
4016 \fBU+FEFF\fR
4017 \m[blue]\fBunicode byte order mark\fR\m[]\&\s-2\u[18]\d\s+2\&. Control codes other than
4018 \fBNUL\fR
4019 are allowed\&.
4020 .sp
4021 In the file, an unquoted value after the
4022 "="
4023 is parsed with the same backslash\-escape rules as
4024 \m[blue]\fBPOSIX shell unquoted text\fR\m[]\&\s-2\u[19]\d\s+2, but unlike in a shell, interior whitespace is preserved and quotes after the first non\-whitespace character are preserved\&. Leading and trailing whitespace (space, tab, carriage return) is discarded, but interior whitespace within the line is preserved verbatim\&. A line ending with a backslash will be continued to the following one, with the newline itself discarded\&. A backslash
4025 "\e"
4026 followed by any character other than newline will preserve the following character, so that
4027 "\e\e"
4028 will become the value
4029 "\e"\&.
4030 .sp
4031 In the file, a
4032 "\*(Aq"\-quoted value after the
4033 "="
4034 can span multiple lines and contain any character verbatim other than single quote, like
4035 \m[blue]\fBPOSIX shell single\-quoted text\fR\m[]\&\s-2\u[20]\d\s+2\&. No backslash\-escape sequences are recognized\&. Leading and trailing whitespace outside of the single quotes is discarded\&.
4036 .sp
4037 In the file, a
4038 """\-quoted value after the
4039 "="
4040 can span multiple lines, and the same escape sequences are recognized as in
4041 \m[blue]\fBPOSIX shell double\-quoted text\fR\m[]\&\s-2\u[21]\d\s+2\&. Backslash ("\e") followed by any of
4042 ""\e`$"
4043 will preserve that character\&. A backslash followed by newline is a line continuation, and the newline itself is discarded\&. A backslash followed by any other character is ignored; both the backslash and the following character are preserved verbatim\&. Leading and trailing whitespace outside of the double quotes is discarded\&.
4044 .sp
4045 The argument passed should be an absolute filename or wildcard expression\&. If the file does not exist, cannot be read, or contains invalid content, the service will fail to start\&. To make the file optional, prefix the path with
4046 "\-", which causes all errors related to the file to be silently ignored\&. This option may be specified more than once in which case all specified files are read\&. If the empty string is assigned to this option, the list of files to read is reset, all prior assignments have no effect\&.
4047 .sp
4048 Note that shell variables such as
4049 "$HOME"
4050 are not expanded in this path\&. Use
4051 "%"\-specifiers instead; for example,
4052 "%h"
4053 expands to the user\*(Aqs home directory\&.
4054 .sp
4055 The files listed with this directive will be read shortly before the process is executed (more specifically, after all processes from a previous unit state terminated\&. This means you can generate these files in one unit state, and read it with this option in the next\&. The files are read from the file system of the service manager, before any file system changes like bind mounts take place)\&.
4056 .sp
4057 Settings from these files override settings made with
4058 \fIEnvironment=\fR\&. If the same variable is set twice from these files, the files will be read in the order they are specified and the later setting will override the earlier setting\&.
4059 .RE
4060 .PP
4061 \fIPassEnvironment=\fR
4062 .RS 4
4063 Pass environment variables set for the system service manager to executed processes\&. Takes a space\-separated list of variable names\&. This option may be specified more than once, in which case all listed variables will be passed\&. If the empty string is assigned to this option, the list of environment variables to pass is reset, all prior assignments have no effect\&. Variables specified that are not set for the system manager will not be passed and will be silently ignored\&. Note that this option is only relevant for the system service manager, as system services by default do not automatically inherit any environment variables set for the service manager itself\&. However, in case of the user service manager all environment variables are passed to the executed processes anyway, hence this option is without effect for the user service manager\&.
4064 .sp
4065 Variables set for invoked processes due to this setting are subject to being overridden by those configured with
4066 \fIEnvironment=\fR
4067 or
4068 \fIEnvironmentFile=\fR\&.
4069 .sp
4070 Example:
4071 .sp
4072 .if n \{\
4073 .RS 4
4074 .\}
4075 .nf
4076 PassEnvironment=VAR1 VAR2 VAR3
4077 .fi
4078 .if n \{\
4079 .RE
4080 .\}
4081 .sp
4082 passes three variables
4083 "VAR1",
4084 "VAR2",
4085 "VAR3"
4086 with the values set for those variables in PID1\&.
4087 .sp
4088 See
4089 \fBenviron\fR(7)
4090 for details about environment variables\&.
4091 .sp
4092 Added in version 228\&.
4093 .RE
4094 .PP
4095 \fIUnsetEnvironment=\fR
4096 .RS 4
4097 Explicitly unset environment variable assignments that would normally be passed from the service manager to invoked processes of this unit\&. Takes a space\-separated list of variable names or variable assignments\&. This option may be specified more than once, in which case all listed variables/assignments will be unset\&. If the empty string is assigned to this option, the list of environment variables/assignments to unset is reset\&. If a variable assignment is specified (that is: a variable name, followed by
4098 "=", followed by its value), then any environment variable matching this precise assignment is removed\&. If a variable name is specified (that is a variable name without any following
4099 "="
4100 or value), then any assignment matching the variable name, regardless of its value is removed\&. Note that the effect of
4101 \fIUnsetEnvironment=\fR
4102 is applied as final step when the environment list passed to executed processes is compiled\&. That means it may undo assignments from any configuration source, including assignments made through
4103 \fIEnvironment=\fR
4104 or
4105 \fIEnvironmentFile=\fR, inherited from the system manager\*(Aqs global set of environment variables, inherited via
4106 \fIPassEnvironment=\fR, set by the service manager itself (such as
4107 \fI$NOTIFY_SOCKET\fR
4108 and such), or set by a PAM module (in case
4109 \fIPAMName=\fR
4110 is used)\&.
4111 .sp
4112 See "Environment Variables in Spawned Processes" below for a description of how those settings combine to form the inherited environment\&. See
4113 \fBenviron\fR(7)
4114 for general information about environment variables\&.
4115 .sp
4116 Added in version 235\&.
4117 .RE
4118 .SH "LOGGING AND STANDARD INPUT/OUTPUT"
4119 .PP
4120 \fIStandardInput=\fR
4121 .RS 4
4122 Controls where file descriptor 0 (STDIN) of the executed processes is connected to\&. Takes one of
4123 \fBnull\fR,
4124 \fBtty\fR,
4125 \fBtty\-force\fR,
4126 \fBtty\-fail\fR,
4127 \fBdata\fR,
4128 \fBfile:\fR\fB\fIpath\fR\fR,
4129 \fBsocket\fR
4130 or
4131 \fBfd:\fR\fB\fIname\fR\fR\&.
4132 .sp
4133 If
4134 \fBnull\fR
4135 is selected, standard input will be connected to
4136 /dev/null, i\&.e\&. all read attempts by the process will result in immediate EOF\&.
4137 .sp
4138 If
4139 \fBtty\fR
4140 is selected, standard input is connected to a TTY (as configured by
4141 \fITTYPath=\fR, see below) and the executed process becomes the controlling process of the terminal\&. If the terminal is already being controlled by another process, the executed process waits until the current controlling process releases the terminal\&.
4142 .sp
4143 \fBtty\-force\fR
4144 is similar to
4145 \fBtty\fR, but the executed process is forcefully and immediately made the controlling process of the terminal, potentially removing previous controlling processes from the terminal\&.
4146 .sp
4147 \fBtty\-fail\fR
4148 is similar to
4149 \fBtty\fR, but if the terminal already has a controlling process start\-up of the executed process fails\&.
4150 .sp
4151 The
4152 \fBdata\fR
4153 option may be used to configure arbitrary textual or binary data to pass via standard input to the executed process\&. The data to pass is configured via
4154 \fIStandardInputText=\fR/\fIStandardInputData=\fR
4155 (see below)\&. Note that the actual file descriptor type passed (memory file, regular file, UNIX pipe, \&...) might depend on the kernel and available privileges\&. In any case, the file descriptor is read\-only, and when read returns the specified data followed by EOF\&.
4156 .sp
4157 The
4158 \fBfile:\fR\fB\fIpath\fR\fR
4159 option may be used to connect a specific file system object to standard input\&. An absolute path following the
4160 ":"
4161 character is expected, which may refer to a regular file, a FIFO or special file\&. If an
4162 \fBAF_UNIX\fR
4163 socket in the file system is specified, a stream socket is connected to it\&. The latter is useful for connecting standard input of processes to arbitrary system services\&.
4164 .sp
4165 The
4166 \fBsocket\fR
4167 option is valid in socket\-activated services only, and requires the relevant socket unit file (see
4168 \fBsystemd.socket\fR(5)
4169 for details) to have
4170 \fIAccept=yes\fR
4171 set, or to specify a single socket only\&. If this option is set, standard input will be connected to the socket the service was activated from, which is primarily useful for compatibility with daemons designed for use with the traditional
4172 \fBinetd\fR(8)
4173 socket activation daemon (\fI$LISTEN_FDS\fR
4174 (and related) environment variables are not passed when
4175 \fBsocket\fR
4176 value is configured)\&.
4177 .sp
4178 The
4179 \fBfd:\fR\fB\fIname\fR\fR
4180 option connects standard input to a specific, named file descriptor provided by a socket unit\&. The name may be specified as part of this option, following a
4181 ":"
4182 character (e\&.g\&.
4183 "fd:foobar")\&. If no name is specified, the name
4184 "stdin"
4185 is implied (i\&.e\&.
4186 "fd"
4187 is equivalent to
4188 "fd:stdin")\&. At least one socket unit defining the specified name must be provided via the
4189 \fISockets=\fR
4190 option, and the file descriptor name may differ from the name of its containing socket unit\&. If multiple matches are found, the first one will be used\&. See
4191 \fIFileDescriptorName=\fR
4192 in
4193 \fBsystemd.socket\fR(5)
4194 for more details about named file descriptors and their ordering\&.
4195 .sp
4196 This setting defaults to
4197 \fBnull\fR, unless
4198 \fIStandardInputText=\fR/\fIStandardInputData=\fR
4199 are set, in which case it defaults to
4200 \fBdata\fR\&.
4201 .RE
4202 .PP
4203 \fIStandardOutput=\fR
4204 .RS 4
4205 Controls where file descriptor 1 (stdout) of the executed processes is connected to\&. Takes one of
4206 \fBinherit\fR,
4207 \fBnull\fR,
4208 \fBtty\fR,
4209 \fBjournal\fR,
4210 \fBkmsg\fR,
4211 \fBjournal+console\fR,
4212 \fBkmsg+console\fR,
4213 \fBfile:\fR\fB\fIpath\fR\fR,
4214 \fBappend:\fR\fB\fIpath\fR\fR,
4215 \fBtruncate:\fR\fB\fIpath\fR\fR,
4216 \fBsocket\fR
4217 or
4218 \fBfd:\fR\fB\fIname\fR\fR\&.
4219 .sp
4220 \fBinherit\fR
4221 duplicates the file descriptor of standard input for standard output\&.
4222 .sp
4223 \fBnull\fR
4224 connects standard output to
4225 /dev/null, i\&.e\&. everything written to it will be lost\&.
4226 .sp
4227 \fBtty\fR
4228 connects standard output to a tty (as configured via
4229 \fITTYPath=\fR, see below)\&. If the TTY is used for output only, the executed process will not become the controlling process of the terminal, and will not fail or wait for other processes to release the terminal\&. Note: if a unit tries to print multiple lines to a TTY during bootup or shutdown, then there\*(Aqs a chance that those lines will be broken up by status messages\&.
4230 \fBSetShowStatus()\fR
4231 can be used to prevent this problem\&. See
4232 \fBorg.freedesktop.systemd1\fR(5)
4233 for details\&.
4234 .sp
4235 \fBjournal\fR
4236 connects standard output with the journal, which is accessible via
4237 \fBjournalctl\fR(1)\&. Note that everything that is written to kmsg (see below) is implicitly stored in the journal as well, the specific option listed below is hence a superset of this one\&. (Also note that any external, additional syslog daemons receive their log data from the journal, too, hence this is the option to use when logging shall be processed with such a daemon\&.)
4238 .sp
4239 \fBkmsg\fR
4240 connects standard output with the kernel log buffer which is accessible via
4241 \fBdmesg\fR(1), in addition to the journal\&. The journal daemon might be configured to send all logs to kmsg anyway, in which case this option is no different from
4242 \fBjournal\fR\&.
4243 .sp
4244 \fBjournal+console\fR
4245 and
4246 \fBkmsg+console\fR
4247 work in a similar way as the two options above but copy the output to the system console as well\&.
4248 .sp
4249 The
4250 \fBfile:\fR\fB\fIpath\fR\fR
4251 option may be used to connect a specific file system object to standard output\&. The semantics are similar to the same option of
4252 \fIStandardInput=\fR, see above\&. If
4253 \fIpath\fR
4254 refers to a regular file on the filesystem, it is opened (created if it does not exist yet using privileges of the user executing the systemd process) for writing at the beginning of the file, but without truncating it\&. If standard input and output are directed to the same file path, it is opened only once \(em for reading as well as writing \(em and duplicated\&. This is particularly useful when the specified path refers to an
4255 \fBAF_UNIX\fR
4256 socket in the file system, as in that case only a single stream connection is created for both input and output\&.
4257 .sp
4258 \fBappend:\fR\fB\fIpath\fR\fR
4259 is similar to
4260 \fBfile:\fR\fB\fIpath\fR\fR
4261 above, but it opens the file in append mode\&.
4262 .sp
4263 \fBtruncate:\fR\fB\fIpath\fR\fR
4264 is similar to
4265 \fBfile:\fR\fB\fIpath\fR\fR
4266 above, but it truncates the file when opening it\&. For units with multiple command lines, e\&.g\&.
4267 \fIType=oneshot\fR
4268 services with multiple
4269 \fIExecStart=\fR, or services with
4270 \fIExecCondition=\fR,
4271 \fIExecStartPre=\fR
4272 or
4273 \fIExecStartPost=\fR, the output file is reopened and therefore re\-truncated for each command line\&. If the output file is truncated while another process still has the file open, e\&.g\&. by an
4274 \fIExecReload=\fR
4275 running concurrently with an
4276 \fIExecStart=\fR, and the other process continues writing to the file without adjusting its offset, then the space between the file pointers of the two processes may be filled with
4277 \fBNUL\fR
4278 bytes, producing a sparse file\&. Thus,
4279 \fBtruncate:\fR\fB\fIpath\fR\fR
4280 is typically only useful for units where only one process runs at a time, such as services with a single
4281 \fIExecStart=\fR
4282 and no
4283 \fIExecStartPost=\fR,
4284 \fIExecReload=\fR,
4285 \fIExecStop=\fR
4286 or similar\&.
4287 .sp
4288 \fBsocket\fR
4289 connects standard output to a socket acquired via socket activation\&. The semantics are similar to the same option of
4290 \fIStandardInput=\fR, see above\&.
4291 .sp
4292 The
4293 \fBfd:\fR\fB\fIname\fR\fR
4294 option connects standard output to a specific, named file descriptor provided by a socket unit\&. A name may be specified as part of this option, following a
4295 ":"
4296 character (e\&.g\&.
4297 "fd:\fIfoobar\fR")\&. If no name is specified, the name
4298 "stdout"
4299 is implied (i\&.e\&.
4300 "fd"
4301 is equivalent to
4302 "fd:stdout")\&. At least one socket unit defining the specified name must be provided via the
4303 \fISockets=\fR
4304 option, and the file descriptor name may differ from the name of its containing socket unit\&. If multiple matches are found, the first one will be used\&. See
4305 \fIFileDescriptorName=\fR
4306 in
4307 \fBsystemd.socket\fR(5)
4308 for more details about named descriptors and their ordering\&.
4309 .sp
4310 If the standard output (or error output, see below) of a unit is connected to the journal or the kernel log buffer, the unit will implicitly gain a dependency of type
4311 \fIAfter=\fR
4312 on
4313 systemd\-journald\&.socket
4314 (also see the "Implicit Dependencies" section above)\&. Also note that, in this case, stdout (or stderr, see below) will be an
4315 \fBAF_UNIX\fR
4316 stream socket, and not a pipe or FIFO that can be reopened\&. This means when executing shell scripts the construct
4317 \fBecho "hello" > /dev/stderr\fR
4318 for writing text to stderr will not work\&. To mitigate this use the construct
4319 \fBecho "hello" >&2\fR
4320 instead, which is mostly equivalent and avoids this pitfall\&.
4321 .sp
4322 If
4323 \fIStandardInput=\fR
4324 is set to one of
4325 \fBtty\fR,
4326 \fBtty\-force\fR,
4327 \fBtty\-fail\fR,
4328 \fBsocket\fR, or
4329 \fBfd:\fR\fB\fIname\fR\fR, this setting defaults to
4330 \fBinherit\fR\&.
4331 .sp
4332 In other cases, this setting defaults to the value set with
4333 \fIDefaultStandardOutput=\fR
4334 in
4335 \fBsystemd-system.conf\fR(5), which defaults to
4336 \fBjournal\fR\&. Note that setting this parameter might result in additional dependencies to be added to the unit (see above)\&.
4337 .RE
4338 .PP
4339 \fIStandardError=\fR
4340 .RS 4
4341 Controls where file descriptor 2 (stderr) of the executed processes is connected to\&. The available options are identical to those of
4342 \fIStandardOutput=\fR, with some exceptions: if set to
4343 \fBinherit\fR
4344 the file descriptor used for standard output is duplicated for standard error, while
4345 \fBfd:\fR\fB\fIname\fR\fR
4346 will use a default file descriptor name of
4347 "stderr"\&.
4348 .sp
4349 This setting defaults to the value set with
4350 \fIDefaultStandardError=\fR
4351 in
4352 \fBsystemd-system.conf\fR(5), which defaults to
4353 \fBinherit\fR\&. Note that setting this parameter might result in additional dependencies to be added to the unit (see above)\&.
4354 .RE
4355 .PP
4356 \fIStandardInputText=\fR, \fIStandardInputData=\fR
4357 .RS 4
4358 Configures arbitrary textual or binary data to pass via file descriptor 0 (STDIN) to the executed processes\&. These settings have no effect unless
4359 \fIStandardInput=\fR
4360 is set to
4361 \fBdata\fR
4362 (which is the default if
4363 \fIStandardInput=\fR
4364 is not set otherwise, but
4365 \fIStandardInputText=\fR/\fIStandardInputData=\fR
4366 is)\&. Use this option to embed process input data directly in the unit file\&.
4367 .sp
4368 \fIStandardInputText=\fR
4369 accepts arbitrary textual data\&. C\-style escapes for special characters as well as the usual
4370 "%"\-specifiers are resolved\&. Each time this setting is used the specified text is appended to the per\-unit data buffer, followed by a newline character (thus every use appends a new line to the end of the buffer)\&. Note that leading and trailing whitespace of lines configured with this option is removed\&. If an empty line is specified the buffer is cleared (hence, in order to insert an empty line, add an additional
4371 "\en"
4372 to the end or beginning of a line)\&.
4373 .sp
4374 \fIStandardInputData=\fR
4375 accepts arbitrary binary data, encoded in
4376 \m[blue]\fBBase64\fR\m[]\&\s-2\u[22]\d\s+2\&. No escape sequences or specifiers are resolved\&. Any whitespace in the encoded version is ignored during decoding\&.
4377 .sp
4378 Note that
4379 \fIStandardInputText=\fR
4380 and
4381 \fIStandardInputData=\fR
4382 operate on the same data buffer, and may be mixed in order to configure both binary and textual data for the same input stream\&. The textual or binary data is joined strictly in the order the settings appear in the unit file\&. Assigning an empty string to either will reset the data buffer\&.
4383 .sp
4384 Please keep in mind that in order to maintain readability long unit file settings may be split into multiple lines, by suffixing each line (except for the last) with a
4385 "\e"
4386 character (see
4387 \fBsystemd.unit\fR(5)
4388 for details)\&. This is particularly useful for large data configured with these two options\&. Example:
4389 .sp
4390 .if n \{\
4391 .RS 4
4392 .\}
4393 .nf
4394 \&...
4395 StandardInput=data
4396 StandardInputData=V2XigLJyZSBubyBzdHJhbmdlcnMgdG8gbG92ZQpZb3Uga25vdyB0aGUgcnVsZXMgYW5kIHNvIGRv \e
4397 IEkKQSBmdWxsIGNvbW1pdG1lbnQncyB3aGF0IEnigLJtIHRoaW5raW5nIG9mCllvdSB3b3VsZG4n \e
4398 dCBnZXQgdGhpcyBmcm9tIGFueSBvdGhlciBndXkKSSBqdXN0IHdhbm5hIHRlbGwgeW91IGhvdyBJ \e
4399 J20gZmVlbGluZwpHb3R0YSBtYWtlIHlvdSB1bmRlcnN0YW5kCgpOZXZlciBnb25uYSBnaXZlIHlv \e
4400 dSB1cApOZXZlciBnb25uYSBsZXQgeW91IGRvd24KTmV2ZXIgZ29ubmEgcnVuIGFyb3VuZCBhbmQg \e
4401 ZGVzZXJ0IHlvdQpOZXZlciBnb25uYSBtYWtlIHlvdSBjcnkKTmV2ZXIgZ29ubmEgc2F5IGdvb2Ri \e
4402 eWUKTmV2ZXIgZ29ubmEgdGVsbCBhIGxpZSBhbmQgaHVydCB5b3UK
4403 \&...
4404 .fi
4405 .if n \{\
4406 .RE
4407 .\}
4408 .sp
4409 Added in version 236\&.
4410 .RE
4411 .PP
4412 \fILogLevelMax=\fR
4413 .RS 4
4414 Sets the maximum log level for log messages generated by this unit\&. Takes a
4415 \fBsyslog\fR
4416 log level, one of
4417 \fBemerg\fR
4418 (lowest log level, only highest priority messages),
4419 \fBalert\fR,
4420 \fBcrit\fR,
4421 \fBerr\fR,
4422 \fBwarning\fR,
4423 \fBnotice\fR,
4424 \fBinfo\fR,
4425 \fBdebug\fR
4426 (highest log level, also lowest priority messages)\&. See
4427 \fBsyslog\fR(3)
4428 for details\&. By default, the maximum log level is not overridden\&.
4429 .sp
4430 This option can be used to configure the logging system to drop log messages of a specific service above the specified level\&. For example, set
4431 \fILogLevelMax=\fR\fBinfo\fR
4432 in order to turn off debug logging of a particularly chatty unit\&. Alternatively, this option can be used to enable extra logging about a specific unit by the system or user manager processes without changing the global log level for the system or user manager processes by setting
4433 \fILogLevelMax=\fR\fBdebug\fR\&.
4434 .sp
4435 Note that the configured level is applied to any log messages written by any of the processes belonging to this unit, as well as any log messages written by the system or user manager processes in reference to this unit, sent via any supported logging protocol\&. The override is applied early in the logging pipeline, before any kind of further processing is done\&. Moreover, messages which pass through this filter successfully might still be dropped by filters applied at a later stage in the logging subsystem\&. For example,
4436 \fIMaxLevelStore=\fR
4437 configured in
4438 \fBjournald.conf\fR(5)
4439 might prohibit messages of higher log levels to be stored on disk, even though the per\-unit
4440 \fILogLevelMax=\fR
4441 permitted it to be processed\&.
4442 .sp
4443 Added in version 236\&.
4444 .RE
4445 .PP
4446 \fILogExtraFields=\fR
4447 .RS 4
4448 Configures additional log metadata fields to include in all log records generated by processes associated with this unit, including systemd\&. This setting takes one or more journal field assignments in the format
4449 "FIELD=VALUE"
4450 separated by whitespace\&. See
4451 \fBsystemd.journal-fields\fR(7)
4452 for details on the journal field concept\&. Even though the underlying journal implementation permits binary field values, this setting accepts only valid UTF\-8 values\&. To include space characters in a journal field value, enclose the assignment in double quotes (")\&.
4453 The usual specifiers are expanded in all assignments (see below)\&. Note that this setting is not only useful for attaching additional metadata to log records of a unit, but given that all fields and values are indexed may also be used to implement cross\-unit log record matching\&. Assign an empty string to reset the list\&.
4454 .sp
4455 Note that this functionality is currently only available in system services, not in per\-user services\&.
4456 .sp
4457 Added in version 236\&.
4458 .RE
4459 .PP
4460 \fILogRateLimitIntervalSec=\fR, \fILogRateLimitBurst=\fR
4461 .RS 4
4462 Configures the rate limiting that is applied to log messages generated by this unit\&. If, in the time interval defined by
4463 \fILogRateLimitIntervalSec=\fR, more messages than specified in
4464 \fILogRateLimitBurst=\fR
4465 are logged by a service, all further messages within the interval are dropped until the interval is over\&. A message about the number of dropped messages is generated\&. The time specification for
4466 \fILogRateLimitIntervalSec=\fR
4467 may be specified in the following units: "s", "min", "h", "ms", "us"\&. See
4468 \fBsystemd.time\fR(7)
4469 for details\&. The default settings are set by
4470 \fIRateLimitIntervalSec=\fR
4471 and
4472 \fIRateLimitBurst=\fR
4473 configured in
4474 \fBjournald.conf\fR(5)\&. Note that this only applies to log messages that are processed by the logging subsystem, i\&.e\&. by
4475 \fBsystemd-journald.service\fR(8)\&. This means that if you connect a service\*(Aqs stderr directly to a file via
4476 \fIStandardOutput=file:\&...\fR
4477 or a similar setting, the rate limiting will not be applied to messages written that way (but it will be enforced for messages generated via
4478 \fBsyslog\fR(3)
4479 and similar functions)\&.
4480 .sp
4481 Added in version 240\&.
4482 .RE
4483 .PP
4484 \fILogFilterPatterns=\fR
4485 .RS 4
4486 Define an extended regular expression to filter log messages based on the
4487 \fIMESSAGE=\fR
4488 field of the structured message\&. If the first character of the pattern is
4489 "~", log entries matching the pattern should be discarded\&. This option takes a single pattern as an argument but can be used multiple times to create a list of allowed and denied patterns\&. If the empty string is assigned, the filter is reset, and all prior assignments will have no effect\&.
4490 .sp
4491 Because the
4492 "~"
4493 character is used to define denied patterns, it must be replaced with
4494 "\ex7e"
4495 to allow a message starting with
4496 "~"\&. For example,
4497 "~foobar"
4498 would add a pattern matching
4499 "foobar"
4500 to the deny list, while
4501 "\ex7efoobar"
4502 would add a pattern matching
4503 "~foobar"
4504 to the allow list\&.
4505 .sp
4506 Log messages are tested against denied patterns (if any), then against allowed patterns (if any)\&. If a log message matches any of the denied patterns, it is discarded immediately without considering allowed patterns\&. Remaining log messages are tested against allowed patterns\&. Messages matching against none of the allowed pattern are discarded\&. If no allowed patterns are defined, then all messages are processed directly after going through denied filters\&.
4507 .sp
4508 Filtering is based on the unit for which
4509 \fILogFilterPatterns=\fR
4510 is defined, meaning log messages coming from
4511 \fBsystemd\fR(1)
4512 about the unit are not taken into account\&. Filtered log messages will not be forwarded to traditional syslog daemons, the kernel log buffer (kmsg), the systemd console, or sent as wall messages to all logged\-in users\&.
4513 .sp
4514 Note that this functionality is currently only available in system services, not in per\-user services\&.
4515 .sp
4516 Added in version 253\&.
4517 .RE
4518 .PP
4519 \fILogNamespace=\fR
4520 .RS 4
4521 Run the unit\*(Aqs processes in the specified journal namespace\&. Expects a short user\-defined string identifying the namespace\&. If not used the processes of the service are run in the default journal namespace, i\&.e\&. their log stream is collected and processed by
4522 systemd\-journald\&.service\&. If this option is used any log data generated by processes of this unit (regardless of whether via the
4523 \fBsyslog()\fR, journal native logging or stdout/stderr logging) is collected and processed by an instance of the
4524 systemd\-journald@\&.service
4525 template unit, which manages the specified namespace\&. The log data is stored in a data store independent from the default log namespace\*(Aqs data store\&. See
4526 \fBsystemd-journald.service\fR(8)
4527 for details about journal namespaces\&.
4528 .sp
4529 Internally, journal namespaces are implemented through Linux mount namespacing and over\-mounting the directory that contains the relevant
4530 \fBAF_UNIX\fR
4531 sockets used for logging in the unit\*(Aqs mount namespace\&. Since mount namespaces are used this setting disconnects propagation of mounts from the unit\*(Aqs processes to the host, similarly to how
4532 \fIReadOnlyPaths=\fR
4533 and similar settings describe above work\&. Journal namespaces may hence not be used for services that need to establish mount points on the host\&.
4534 .sp
4535 When this option is used the unit will automatically gain ordering and requirement dependencies on the two socket units associated with the
4536 systemd\-journald@\&.service
4537 instance so that they are automatically established prior to the unit starting up\&. Note that when this option is used log output of this service does not appear in the regular
4538 \fBjournalctl\fR(1)
4539 output, unless the
4540 \fB\-\-namespace=\fR
4541 option is used\&.
4542 .sp
4543 This option is only available for system services and is not supported for services running in per\-user instances of the service manager\&.
4544 .sp
4545 Added in version 245\&.
4546 .RE
4547 .PP
4548 \fISyslogIdentifier=\fR
4549 .RS 4
4550 Sets the process name ("\fBsyslog\fR
4551 tag") to prefix log lines sent to the logging system or the kernel log buffer with\&. If not set, defaults to the process name of the executed process\&. This option is only useful when
4552 \fIStandardOutput=\fR
4553 or
4554 \fIStandardError=\fR
4555 are set to
4556 \fBjournal\fR
4557 or
4558 \fBkmsg\fR
4559 (or to the same settings in combination with
4560 \fB+console\fR) and only applies to log messages written to stdout or stderr\&.
4561 .RE
4562 .PP
4563 \fISyslogFacility=\fR
4564 .RS 4
4565 Sets the
4566 \fBsyslog\fR
4567 facility identifier to use when logging\&. One of
4568 \fBkern\fR,
4569 \fBuser\fR,
4570 \fBmail\fR,
4571 \fBdaemon\fR,
4572 \fBauth\fR,
4573 \fBsyslog\fR,
4574 \fBlpr\fR,
4575 \fBnews\fR,
4576 \fBuucp\fR,
4577 \fBcron\fR,
4578 \fBauthpriv\fR,
4579 \fBftp\fR,
4580 \fBlocal0\fR,
4581 \fBlocal1\fR,
4582 \fBlocal2\fR,
4583 \fBlocal3\fR,
4584 \fBlocal4\fR,
4585 \fBlocal5\fR,
4586 \fBlocal6\fR
4587 or
4588 \fBlocal7\fR\&. See
4589 \fBsyslog\fR(3)
4590 for details\&. This option is only useful when
4591 \fIStandardOutput=\fR
4592 or
4593 \fIStandardError=\fR
4594 are set to
4595 \fBjournal\fR
4596 or
4597 \fBkmsg\fR
4598 (or to the same settings in combination with
4599 \fB+console\fR), and only applies to log messages written to stdout or stderr\&. Defaults to
4600 \fBdaemon\fR\&.
4601 .RE
4602 .PP
4603 \fISyslogLevel=\fR
4604 .RS 4
4605 The default
4606 \fBsyslog\fR
4607 log level to use when logging to the logging system or the kernel log buffer\&. One of
4608 \fBemerg\fR,
4609 \fBalert\fR,
4610 \fBcrit\fR,
4611 \fBerr\fR,
4612 \fBwarning\fR,
4613 \fBnotice\fR,
4614 \fBinfo\fR,
4615 \fBdebug\fR\&. See
4616 \fBsyslog\fR(3)
4617 for details\&. This option is only useful when
4618 \fIStandardOutput=\fR
4619 or
4620 \fIStandardError=\fR
4621 are set to
4622 \fBjournal\fR
4623 or
4624 \fBkmsg\fR
4625 (or to the same settings in combination with
4626 \fB+console\fR), and only applies to log messages written to stdout or stderr\&. Note that individual lines output by executed processes may be prefixed with a different log level which can be used to override the default log level specified here\&. The interpretation of these prefixes may be disabled with
4627 \fISyslogLevelPrefix=\fR, see below\&. For details, see
4628 \fBsd-daemon\fR(3)\&. Defaults to
4629 \fBinfo\fR\&.
4630 .RE
4631 .PP
4632 \fISyslogLevelPrefix=\fR
4633 .RS 4
4634 Takes a boolean argument\&. If true and
4635 \fIStandardOutput=\fR
4636 or
4637 \fIStandardError=\fR
4638 are set to
4639 \fBjournal\fR
4640 or
4641 \fBkmsg\fR
4642 (or to the same settings in combination with
4643 \fB+console\fR), log lines written by the executed process that are prefixed with a log level will be processed with this log level set but the prefix removed\&. If set to false, the interpretation of these prefixes is disabled and the logged lines are passed on as\-is\&. This only applies to log messages written to stdout or stderr\&. For details about this prefixing see
4644 \fBsd-daemon\fR(3)\&. Defaults to true\&.
4645 .RE
4646 .PP
4647 \fITTYPath=\fR
4648 .RS 4
4649 Sets the terminal device node to use if standard input, output, or error are connected to a TTY (see above)\&. Defaults to
4650 /dev/console\&.
4651 .RE
4652 .PP
4653 \fITTYReset=\fR
4654 .RS 4
4655 Reset the terminal device specified with
4656 \fITTYPath=\fR
4657 before and after execution\&. This does not erase the screen (see
4658 \fITTYVTDisallocate=\fR
4659 below for that)\&. Defaults to
4660 "no"\&.
4661 .RE
4662 .PP
4663 \fITTYVHangup=\fR
4664 .RS 4
4665 Disconnect all clients which have opened the terminal device specified with
4666 \fITTYPath=\fR
4667 before and after execution\&. Defaults to
4668 "no"\&.
4669 .RE
4670 .PP
4671 \fITTYColumns=\fR, \fITTYRows=\fR
4672 .RS 4
4673 Configure the size of the TTY specified with
4674 \fITTYPath=\fR\&. If unset or set to the empty string, it is attempted to retrieve the dimensions of the terminal screen via ANSI sequences, and if that fails the kernel defaults (typically 80x24) are used\&.
4675 .sp
4676 Added in version 250\&.
4677 .RE
4678 .PP
4679 \fITTYVTDisallocate=\fR
4680 .RS 4
4681 If the terminal device specified with
4682 \fITTYPath=\fR
4683 is a virtual console terminal, try to deallocate the TTY before and after execution\&. This ensures that the screen and scrollback buffer is cleared\&. If the terminal device is of any other type of TTY an attempt is made to clear the screen via ANSI sequences\&. Defaults to
4684 "no"\&.
4685 .RE
4686 .SH "CREDENTIALS"
4687 .PP
4688 \fILoadCredential=\fR\fIID\fR[:\fIPATH\fR], \fILoadCredentialEncrypted=\fR\fIID\fR[:\fIPATH\fR]
4689 .RS 4
4690 Pass a credential to the unit\&. Credentials are limited\-size binary or textual objects that may be passed to unit processes\&. They are primarily intended for passing cryptographic keys (both public and private) or certificates, user account information or identity information from host to services, but can be freely used to pass any kind of limited\-size information to a service\&. The data is accessible from the unit\*(Aqs processes via the file system, at a read\-only location that (if possible and permitted) is backed by non\-swappable memory\&. The data is only accessible to the user associated with the unit, via the
4691 \fIUser=\fR/\fIDynamicUser=\fR
4692 settings (as well as the superuser)\&. When available, the location of credentials is exported as the
4693 \fI$CREDENTIALS_DIRECTORY\fR
4694 environment variable to the unit\*(Aqs processes\&.
4695 .sp
4696 The
4697 \fILoadCredential=\fR
4698 setting takes a textual ID to use as name for a credential plus a file system path, separated by a colon\&. The ID must be a short ASCII string suitable as filename in the filesystem, and may be chosen freely by the user\&. If the specified path is absolute it is opened as regular file and the credential data is read from it\&. If the absolute path refers to an
4699 \fBAF_UNIX\fR
4700 stream socket in the file system a connection is made to it (once at process invocation) and the credential data read from the connection, providing an easy IPC integration point for dynamically transferring credentials from other services\&.
4701 .sp
4702 If the specified path is not absolute and itself qualifies as valid credential identifier it is attempted to find a credential that the service manager itself received under the specified name \(em which may be used to propagate credentials from an invoking environment (e\&.g\&. a container manager that invoked the service manager) into a service\&. If no matching passed credential is found, the system service manager will search the directories
4703 /etc/credstore/,
4704 /run/credstore/
4705 and
4706 /usr/lib/credstore/
4707 for files under the credential\*(Aqs name \(em which hence are recommended locations for credential data on disk\&. If
4708 \fILoadCredentialEncrypted=\fR
4709 is used
4710 /run/credstore\&.encrypted/,
4711 /etc/credstore\&.encrypted/, and
4712 /usr/lib/credstore\&.encrypted/
4713 are searched as well\&. The per\-user service manager will search
4714 $XDG_CONFIG_HOME/credstore/,
4715 $XDG_RUNTIME_DIR/credstore/,
4716 $HOME/\&.local/lib/credstore/
4717 (and the counterparts ending with
4718 \&.../credstore\&.encrypted/) instead\&. The
4719 \fBsystemd-path\fR(1)
4720 tool may be used to query the precise credential store search path\&.
4721 .sp
4722 If the file system path is omitted it is chosen identical to the credential name, i\&.e\&. this is a terse way to declare credentials to inherit from the service manager or credstore directories into a service\&. This option may be used multiple times, each time defining an additional credential to pass to the unit\&.
4723 .sp
4724 Note that if the path is not specified or a valid credential identifier is given, i\&.e\&. in the above two cases, a missing credential is not considered fatal\&.
4725 .sp
4726 If an absolute path referring to a directory is specified, every file in that directory (recursively) will be loaded as a separate credential\&. The ID for each credential will be the provided ID suffixed with
4727 "_$FILENAME"
4728 (e\&.g\&.,
4729 "Key_file1")\&. When loading from a directory, symlinks will be ignored\&.
4730 .sp
4731 The contents of the file/socket may be arbitrary binary or textual data, including newline characters and
4732 \fBNUL\fR
4733 bytes\&.
4734 .sp
4735 The
4736 \fILoadCredentialEncrypted=\fR
4737 setting is identical to
4738 \fILoadCredential=\fR, except that the credential data is decrypted and authenticated before being passed on to the executed processes\&. Specifically, the referenced path should refer to a file or socket with an encrypted credential, as implemented by
4739 \fBsystemd-creds\fR(1)\&. This credential is loaded, decrypted, authenticated and then passed to the application in plaintext form, in the same way a regular credential specified via
4740 \fILoadCredential=\fR
4741 would be\&. A credential configured this way may be symmetrically encrypted/authenticated with a secret key derived from the system\*(Aqs TPM2 security chip, or with a secret key stored in
4742 /var/lib/systemd/credential\&.secret, or with both\&. Using encrypted and authenticated credentials improves security as credentials are not stored in plaintext and only authenticated and decrypted into plaintext the moment a service requiring them is started\&. Moreover, credentials may be bound to the local hardware and installations, so that they cannot easily be analyzed offline, or be generated externally\&. See
4743 \fBsystemd.resource-control\fR(5)
4744 for the details about
4745 \fIDevicePolicy=\fR
4746 or
4747 \fIDeviceAllow=\fR\&.
4748 .sp
4749 Note that encrypted credentials targeted for services of the per\-user service manager must be encrypted with
4750 \fBsystemd\-creds encrypt \-\-user\fR, and those for the system service manager without the
4751 \fB\-\-user\fR
4752 switch\&. Encrypted credentials are always targeted to a specific user or the system as a whole, and it is ensured that per\-user service managers cannot decrypt secrets intended for the system or for other users\&.
4753 .sp
4754 The credential files/IPC sockets must be accessible to the service manager, but do not have to be directly accessible to the unit\*(Aqs processes: the credential data is read and copied into separate, read\-only copies for the unit that are accessible to appropriately privileged processes\&. This is particularly useful in combination with
4755 \fIDynamicUser=\fR
4756 as this way privileged data can be made available to processes running under a dynamic UID (i\&.e\&. not a previously known one) without having to open up access to all users\&.
4757 .sp
4758 In order to reference the path a credential may be read from within a
4759 \fIExecStart=\fR
4760 command line use
4761 "${CREDENTIALS_DIRECTORY}/mycred", e\&.g\&.
4762 "ExecStart=cat ${CREDENTIALS_DIRECTORY}/mycred"\&. In order to reference the path a credential may be read from within a
4763 \fIEnvironment=\fR
4764 line use
4765 "%d/mycred", e\&.g\&.
4766 "Environment=MYCREDPATH=%d/mycred"\&. For system services the path may also be referenced as
4767 "/run/credentials/\fIUNITNAME\fR"
4768 in cases where no interpolation is possible, e\&.g\&. configuration files of software that does not yet support credentials natively\&.
4769 \fI$CREDENTIALS_DIRECTORY\fR
4770 is considered the primary interface to look for credentials, though, since it also works for user services\&.
4771 .sp
4772 Currently, an accumulated credential size limit of 1 MB per unit is enforced\&.
4773 .sp
4774 The service manager itself may receive system credentials that can be propagated to services from a hosting container manager or VM hypervisor\&. See the
4775 \m[blue]\fBContainer Interface\fR\m[]\&\s-2\u[23]\d\s+2
4776 documentation for details about the former\&. For the latter, pass
4777 \m[blue]\fBDMI/SMBIOS\fR\m[]\&\s-2\u[24]\d\s+2
4778 OEM string table entries (field type 11) with a prefix of
4779 "io\&.systemd\&.credential:"
4780 or
4781 "io\&.systemd\&.credential\&.binary:"\&. In both cases a key/value pair separated by
4782 "="
4783 is expected\&. In the latter case, the right\-hand side is Base64 decoded when parsed (thus permitting binary data to be passed in)\&. Example
4784 \m[blue]\fBqemu\fR\m[]\&\s-2\u[25]\d\s+2
4785 switch:
4786 "\-smbios type=11,value=io\&.systemd\&.credential:xx=yy", or
4787 "\-smbios type=11,value=io\&.systemd\&.credential\&.binary:rick=TmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXA="\&. Alternatively, use the
4788 \fBqemu\fR
4789 "fw_cfg"
4790 node
4791 "opt/io\&.systemd\&.credentials/"\&. Example
4792 \fBqemu\fR
4793 switch:
4794 "\-fw_cfg name=opt/io\&.systemd\&.credentials/mycred,string=supersecret"\&. They may also be passed from the UEFI firmware environment via
4795 \fBsystemd-stub\fR(7), from the initrd (see
4796 \fBsystemd\fR(1)), or be specified on the kernel command line using the
4797 "systemd\&.set_credential="
4798 and
4799 "systemd\&.set_credential_binary="
4800 switches (see
4801 \fBsystemd\fR(1)
4802 \(en this is not recommended since unprivileged userspace can read the kernel command line)\&.
4803 .sp
4804 If referencing an
4805 \fBAF_UNIX\fR
4806 stream socket to connect to, the connection will originate from an abstract namespace socket, that includes information about the unit and the credential ID in its socket name\&. Use
4807 \fBgetpeername\fR(2)
4808 to query this information\&. The returned socket name is formatted as
4809 \fBNUL\fR
4810 \fIRANDOM\fR
4811 "/unit/"
4812 \fIUNIT\fR
4813 "/"
4814 \fIID\fR, i\&.e\&. a
4815 \fBNUL\fR
4816 byte (as required for abstract namespace socket names), followed by a random string (consisting of alphadecimal characters), followed by the literal string
4817 "/unit/", followed by the requesting unit name, followed by the literal character
4818 "/", followed by the textual credential ID requested\&. Example:
4819 "\e0adf9d86b6eda275e/unit/foobar\&.service/credx"
4820 in case the credential
4821 "credx"
4822 is requested for a unit
4823 "foobar\&.service"\&. This functionality is useful for using a single listening socket to serve credentials to multiple consumers\&.
4824 .sp
4825 For further information see
4826 \m[blue]\fBSystem and Service Credentials\fR\m[]\&\s-2\u[26]\d\s+2
4827 documentation\&.
4828 .sp
4829 Added in version 247\&.
4830 .RE
4831 .PP
4832 \fIImportCredential=\fR\fIGLOB\fR
4833 .RS 4
4834 Pass one or more credentials to the unit\&. Takes a credential name for which we will attempt to find a credential that the service manager itself received under the specified name \(em which may be used to propagate credentials from an invoking environment (e\&.g\&. a container manager that invoked the service manager) into a service\&. If the credential name is a glob, all credentials matching the glob are passed to the unit\&. Matching credentials are searched for in the system credentials, the encrypted system credentials, and under
4835 /etc/credstore/,
4836 /run/credstore/,
4837 /usr/lib/credstore/,
4838 /run/credstore\&.encrypted/,
4839 /etc/credstore\&.encrypted/, and
4840 /usr/lib/credstore\&.encrypted/
4841 in that order\&. When multiple credentials of the same name are found, the first one found is used\&.
4842 .sp
4843 The globbing expression implements a restrictive subset of
4844 \fBglob\fR(7): only a single trailing
4845 "*"
4846 wildcard may be specified\&. Both
4847 "?"
4848 and
4849 "[]"
4850 wildcards are not permitted, nor are
4851 "*"
4852 wildcards anywhere except at the end of the glob expression\&.
4853 .sp
4854 Optionally, the credential name or glob may be followed by a colon followed by a rename pattern\&. If specified, all credentials matching the credential name or glob are renamed according to the given pattern\&. For example, if
4855 "ImportCredential=my\&.original\&.cred:my\&.renamed\&.cred"
4856 is specified, the service manager will read the
4857 "my\&.original\&.cred"
4858 credential and make it available as the
4859 "my\&.renamed\&.cred"
4860 credential to the service\&. Similarly, if
4861 "ImportCredential=my\&.original\&.*:my\&.renamed\&."
4862 is specified, the service manager will read all credentials starting with
4863 "my\&.original\&."
4864 and make them available as
4865 "my\&.renamed\&.xxx"
4866 to the service\&.
4867 .sp
4868 If
4869 \fIImportCredential=\fR
4870 is specified multiple times and multiple credentials end up with the same name after renaming, the first one is kept and later ones are dropped\&.
4871 .sp
4872 When multiple credentials of the same name are found, credentials found by
4873 \fILoadCredential=\fR
4874 and
4875 \fILoadCredentialEncrypted=\fR
4876 take priority over credentials found by
4877 \fIImportCredential=\fR\&.
4878 .sp
4879 Note that if decryption or authentication of a credential picked up as result of
4880 \fIImportCredential=\fR
4881 fails it will be skipped gracefully (a warning is generated, but the credential will not be made available to the invoked service)\&. This is different for those configured via
4882 \fISetCredentialEncrypted=\fR/\fILoadCredentialEncrypted=\fR, where failed decryption/authentication will result in service failure\&.
4883 .sp
4884 Added in version 254\&.
4885 .RE
4886 .PP
4887 \fISetCredential=\fR\fIID\fR:\fIVALUE\fR, \fISetCredentialEncrypted=\fR\fIID\fR:\fIVALUE\fR
4888 .RS 4
4889 The
4890 \fISetCredential=\fR
4891 setting is similar to
4892 \fILoadCredential=\fR
4893 but accepts a literal value to use as data for the credential, instead of a file system path to read the data from\&. Do not use this option for data that is supposed to be secret, as it is accessible to unprivileged processes via IPC\&. It\*(Aqs only safe to use this for user IDs, public key material and similar non\-sensitive data\&. For everything else use
4894 \fILoadCredential=\fR\&. In order to embed binary data into the credential data use C\-style escaping (i\&.e\&.
4895 "\en"
4896 to embed a newline, or
4897 "\ex00"
4898 to embed a
4899 \fBNUL\fR
4900 byte)\&.
4901 .sp
4902 The
4903 \fISetCredentialEncrypted=\fR
4904 setting is identical to
4905 \fISetCredential=\fR
4906 but expects an encrypted credential in literal form as value\&. This allows embedding confidential credentials securely directly in unit files\&. Use
4907 \fBsystemd-creds\fR(1)\*(Aq
4908 \fB\-p\fR
4909 switch to generate suitable
4910 \fISetCredentialEncrypted=\fR
4911 lines directly from plaintext credentials\&. For further details see
4912 \fILoadCredentialEncrypted=\fR
4913 above\&.
4914 .sp
4915 When multiple credentials of the same name are found, credentials found by
4916 \fILoadCredential=\fR,
4917 \fILoadCredentialEncrypted=\fR
4918 and
4919 \fIImportCredential=\fR
4920 take priority over credentials found by
4921 \fISetCredential=\fR\&. As such,
4922 \fISetCredential=\fR
4923 will act as default if no credentials are found by any of the former\&. In this case, not being able to retrieve the credential from the path specified in
4924 \fILoadCredential=\fR
4925 or
4926 \fILoadCredentialEncrypted=\fR
4927 is not considered fatal\&.
4928 .sp
4929 Added in version 247\&.
4930 .RE
4931 .SH "SYSTEM V COMPATIBILITY"
4932 .PP
4933 \fIUtmpIdentifier=\fR
4934 .RS 4
4935 Takes a four character identifier string for an
4936 \fButmp\fR(5)
4937 and wtmp entry for this service\&. This should only be set for services such as
4938 \fBgetty\fR
4939 implementations (such as
4940 \fBagetty\fR(8)) where utmp/wtmp entries must be created and cleared before and after execution, or for services that shall be executed as if they were run by a
4941 \fBgetty\fR
4942 process (see below)\&. If the configured string is longer than four characters, it is truncated and the terminal four characters are used\&. This setting interprets %I style string replacements\&. This setting is unset by default, i\&.e\&. no utmp/wtmp entries are created or cleaned up for this service\&.
4943 .RE
4944 .PP
4945 \fIUtmpMode=\fR
4946 .RS 4
4947 Takes one of
4948 "init",
4949 "login"
4950 or
4951 "user"\&. If
4952 \fIUtmpIdentifier=\fR
4953 is set, controls which type of
4954 \fButmp\fR(5)/wtmp entries for this service are generated\&. This setting has no effect unless
4955 \fIUtmpIdentifier=\fR
4956 is set too\&. If
4957 "init"
4958 is set, only an
4959 \fBINIT_PROCESS\fR
4960 entry is generated and the invoked process must implement a
4961 \fBgetty\fR\-compatible utmp/wtmp logic\&. If
4962 "login"
4963 is set, first an
4964 \fBINIT_PROCESS\fR
4965 entry, followed by a
4966 \fBLOGIN_PROCESS\fR
4967 entry is generated\&. In this case, the invoked process must implement a
4968 \fBlogin\fR(1)\-compatible utmp/wtmp logic\&. If
4969 "user"
4970 is set, first an
4971 \fBINIT_PROCESS\fR
4972 entry, then a
4973 \fBLOGIN_PROCESS\fR
4974 entry and finally a
4975 \fBUSER_PROCESS\fR
4976 entry is generated\&. In this case, the invoked process may be any process that is suitable to be run as session leader\&. Defaults to
4977 "init"\&.
4978 .sp
4979 Added in version 225\&.
4980 .RE
4981 .SH "ENVIRONMENT VARIABLES IN SPAWNED PROCESSES"
4982 .PP
4983 Processes started by the service manager are executed with an environment variable block assembled from multiple sources\&. Processes started by the system service manager generally do not inherit environment variables set for the service manager itself (but this may be altered via
4984 \fIPassEnvironment=\fR), but processes started by the user service manager instances generally do inherit all environment variables set for the service manager itself\&.
4985 .PP
4986 For each invoked process the list of environment variables set is compiled from the following sources:
4987 .sp
4988 .RS 4
4989 .ie n \{\
4990 \h'-04'\(bu\h'+03'\c
4991 .\}
4992 .el \{\
4993 .sp -1
4994 .IP \(bu 2.3
4995 .\}
4996 Variables globally configured for the service manager, using the
4997 \fIDefaultEnvironment=\fR
4998 setting in
4999 \fBsystemd-system.conf\fR(5), the kernel command line option
5000 \fIsystemd\&.setenv=\fR
5001 understood by
5002 \fBsystemd\fR(1), or via
5003 \fBsystemctl\fR(1)
5004 \fBset\-environment\fR
5005 verb\&.
5006 .RE
5007 .sp
5008 .RS 4
5009 .ie n \{\
5010 \h'-04'\(bu\h'+03'\c
5011 .\}
5012 .el \{\
5013 .sp -1
5014 .IP \(bu 2.3
5015 .\}
5016 Variables defined by the service manager itself (see the list below)\&.
5017 .RE
5018 .sp
5019 .RS 4
5020 .ie n \{\
5021 \h'-04'\(bu\h'+03'\c
5022 .\}
5023 .el \{\
5024 .sp -1
5025 .IP \(bu 2.3
5026 .\}
5027 Variables set in the service manager\*(Aqs own environment variable block (subject to
5028 \fIPassEnvironment=\fR
5029 for the system service manager)\&.
5030 .RE
5031 .sp
5032 .RS 4
5033 .ie n \{\
5034 \h'-04'\(bu\h'+03'\c
5035 .\}
5036 .el \{\
5037 .sp -1
5038 .IP \(bu 2.3
5039 .\}
5040 Variables set via
5041 \fIEnvironment=\fR
5042 in the unit file\&.
5043 .RE
5044 .sp
5045 .RS 4
5046 .ie n \{\
5047 \h'-04'\(bu\h'+03'\c
5048 .\}
5049 .el \{\
5050 .sp -1
5051 .IP \(bu 2.3
5052 .\}
5053 Variables read from files specified via
5054 \fIEnvironmentFile=\fR
5055 in the unit file\&.
5056 .RE
5057 .sp
5058 .RS 4
5059 .ie n \{\
5060 \h'-04'\(bu\h'+03'\c
5061 .\}
5062 .el \{\
5063 .sp -1
5064 .IP \(bu 2.3
5065 .\}
5066 Variables set by any PAM modules in case
5067 \fIPAMName=\fR
5068 is in effect, cf\&.\ \&\fBpam_env\fR(8)\&.
5069 .RE
5070 .PP
5071 If the same environment variable is set by multiple of these sources, the later source \(em according to the order of the list above \(em wins\&. Note that as the final step all variables listed in
5072 \fIUnsetEnvironment=\fR
5073 are removed from the compiled environment variable list, immediately before it is passed to the executed process\&.
5074 .PP
5075 The general philosophy is to expose a small curated list of environment variables to processes\&. Services started by the system manager (PID 1) will be started, without additional service\-specific configuration, with just a few environment variables\&. The user manager inherits environment variables as any other system service, but in addition may receive additional environment variables from PAM, and, typically, additional imported variables when the user starts a graphical session\&. It is recommended to keep the environment blocks in both the system and user managers lean\&. Importing all variables inherited by the graphical session or by one of the user shells is strongly discouraged\&.
5076 .PP
5077 Hint:
5078 \fBsystemd\-run \-P env\fR
5079 and
5080 \fBsystemd\-run \-\-user \-P env\fR
5081 print the effective system and user service environment blocks\&.
5082 .SS "Environment Variables Set or Propagated by the Service Manager"
5083 .PP
5084 The following environment variables are propagated by the service manager or generated internally for each invoked process:
5085 .PP
5086 \fI$PATH\fR
5087 .RS 4
5088 Colon\-separated list of directories to use when launching executables\&.
5089 \fBsystemd\fR
5090 uses a fixed value of
5091 "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
5092 in the system manager\&. In case of the user manager, a different path may be configured by the distribution\&. It is recommended to not rely on the order of entries, and have only one program with a given name in
5093 \fI$PATH\fR\&.
5094 .sp
5095 Added in version 208\&.
5096 .RE
5097 .PP
5098 \fI$LANG\fR
5099 .RS 4
5100 Locale\&. Can be set in
5101 \fBlocale.conf\fR(5)
5102 or on the kernel command line (see
5103 \fBsystemd\fR(1)
5104 and
5105 \fBkernel-command-line\fR(7))\&.
5106 .sp
5107 Added in version 208\&.
5108 .RE
5109 .PP
5110 \fI$USER\fR, \fI$LOGNAME\fR, \fI$HOME\fR, \fI$SHELL\fR
5111 .RS 4
5112 User name (twice), home directory, and the login shell\&.
5113 \fI$USER\fR
5114 is set unconditionally, while
5115 \fI$HOME\fR,
5116 \fI$LOGNAME\fR, and
5117 \fI$SHELL\fR
5118 are only set for the units that have
5119 \fIUser=\fR
5120 set and
5121 \fISetLoginEnvironment=\fR
5122 unset or set to true\&. For user services, these variables are typically inherited from the user manager itself\&. See
5123 \fBpasswd\fR(5)\&.
5124 .sp
5125 Added in version 208\&.
5126 .RE
5127 .PP
5128 \fI$INVOCATION_ID\fR
5129 .RS 4
5130 Contains a randomized, unique 128\-bit ID identifying each runtime cycle of the unit, formatted as 32 character hexadecimal string\&. A new ID is assigned each time the unit changes from an inactive state into an activating or active state, and may be used to identify this specific runtime cycle, in particular in data stored offline, such as the journal\&. The same ID is passed to all processes run as part of the unit\&.
5131 .sp
5132 Added in version 232\&.
5133 .RE
5134 .PP
5135 \fI$XDG_RUNTIME_DIR\fR
5136 .RS 4
5137 The directory to use for runtime objects (such as IPC objects) and volatile state\&. Set for all services run by the user
5138 \fBsystemd\fR
5139 instance, as well as any system services that use
5140 \fIPAMName=\fR
5141 with a PAM stack that includes
5142 \fBpam_systemd\fR\&. See below and
5143 \fBpam_systemd\fR(8)
5144 for more information\&.
5145 .sp
5146 Added in version 208\&.
5147 .RE
5148 .PP
5149 \fI$RUNTIME_DIRECTORY\fR, \fI$STATE_DIRECTORY\fR, \fI$CACHE_DIRECTORY\fR, \fI$LOGS_DIRECTORY\fR, \fI$CONFIGURATION_DIRECTORY\fR
5150 .RS 4
5151 Absolute paths to the directories defined with
5152 \fIRuntimeDirectory=\fR,
5153 \fIStateDirectory=\fR,
5154 \fICacheDirectory=\fR,
5155 \fILogsDirectory=\fR, and
5156 \fIConfigurationDirectory=\fR
5157 when those settings are used\&.
5158 .sp
5159 Added in version 244\&.
5160 .RE
5161 .PP
5162 \fI$CREDENTIALS_DIRECTORY\fR
5163 .RS 4
5164 An absolute path to the per\-unit directory with credentials configured via
5165 \fIImportCredential=\fR/\fILoadCredential=\fR/\fISetCredential=\fR\&. The directory is marked read\-only and is placed in unswappable memory (if supported and permitted), and is only accessible to the UID associated with the unit via
5166 \fIUser=\fR
5167 or
5168 \fIDynamicUser=\fR
5169 (and the superuser)\&.
5170 .sp
5171 Added in version 247\&.
5172 .RE
5173 .PP
5174 \fI$TMPDIR\fR
5175 .RS 4
5176 The environment variable is set to
5177 "/tmp"
5178 when
5179 \fIPrivateTmp=disconnected\fR
5180 specified with
5181 \fIDefaultDependencies=no\fR
5182 and without
5183 \fIRootDirectory=/RootImage=\fR
5184 and
5185 \fIRequiresMountsFor=/WantsMountsFor=\fR
5186 for
5187 /var/\&. See explanation for
5188 \fIPrivateTmp=\fR
5189 above\&.
5190 .sp
5191 Added in version 258\&.
5192 .RE
5193 .PP
5194 \fI$MAINPID\fR
5195 .RS 4
5196 The UNIX process ID (PID) of the unit\*(Aqs main process if it is known\&. This is only set for control processes as invoked by
5197 \fIExecReload=\fR
5198 and similar\&.
5199 .sp
5200 Added in version 209\&.
5201 .RE
5202 .PP
5203 \fI$MAINPIDFDID\fR
5204 .RS 4
5205 The 64bit inode ID of the file descriptor returned by
5206 \fBpidfd_open\fR(3)
5207 for the main process (if supported)\&. This is only set for control processes as invoked by
5208 \fIExecReload=\fR
5209 and similar\&.
5210 .sp
5211 Added in version 258\&.
5212 .RE
5213 .PP
5214 \fI$MANAGERPID\fR
5215 .RS 4
5216 The PID of the per\-user
5217 \fBsystemd\fR
5218 service manager instance, set for processes spawned by it\&.
5219 .sp
5220 Added in version 208\&.
5221 .RE
5222 .PP
5223 \fI$MANAGERPIDFDID\fR
5224 .RS 4
5225 The
5226 \fBpidfd_open()\fR
5227 inode ID (see above) of the per\-user
5228 \fBsystemd\fR
5229 service manager instance, set for processes spawned by it\&.
5230 .sp
5231 Added in version 258\&.
5232 .RE
5233 .PP
5234 \fI$LISTEN_FDS\fR, \fI$LISTEN_PID\fR, \fI$LISTEN_PIDFDID\fR, \fI$LISTEN_FDNAMES\fR
5235 .RS 4
5236 Information about file descriptors passed to a service for socket activation\&. See
5237 \fBsd_listen_fds\fR(3)\&.
5238 .sp
5239 Added in version 208\&.
5240 .RE
5241 .PP
5242 \fI$NOTIFY_SOCKET\fR
5243 .RS 4
5244 The socket
5245 \fBsd_notify()\fR
5246 talks to\&. See
5247 \fBsd_notify\fR(3)\&.
5248 .sp
5249 Added in version 229\&.
5250 .RE
5251 .PP
5252 \fI$WATCHDOG_PID\fR, \fI$WATCHDOG_USEC\fR
5253 .RS 4
5254 Information about watchdog keep\-alive notifications\&. See
5255 \fBsd_watchdog_enabled\fR(3)\&.
5256 .sp
5257 Added in version 229\&.
5258 .RE
5259 .PP
5260 \fI$SYSTEMD_EXEC_PID\fR
5261 .RS 4
5262 The PID of the unit process (e\&.g\&. process invoked by
5263 \fIExecStart=\fR)\&. The child process can use this information to determine whether the process is directly invoked by the service manager or indirectly as a child of another process by comparing this value with the current PID (similarly to the scheme used in
5264 \fBsd_listen_fds\fR(3)
5265 with
5266 \fI$LISTEN_PID\fR
5267 and
5268 \fI$LISTEN_FDS\fR)\&.
5269 .sp
5270 Added in version 248\&.
5271 .RE
5272 .PP
5273 \fI$TERM\fR
5274 .RS 4
5275 Terminal type, set only for units connected to a terminal (\fIStandardInput=tty\fR,
5276 \fIStandardOutput=tty\fR, or
5277 \fIStandardError=tty\fR)\&. See
5278 \fBtermcap\fR(5)\&.
5279 .sp
5280 Added in version 209\&.
5281 .RE
5282 .PP
5283 \fI$LOG_NAMESPACE\fR
5284 .RS 4
5285 Contains the name of the selected logging namespace when the
5286 \fILogNamespace=\fR
5287 service setting is used\&.
5288 .sp
5289 Added in version 246\&.
5290 .RE
5291 .PP
5292 \fI$JOURNAL_STREAM\fR
5293 .RS 4
5294 If the standard output or standard error output of the executed processes are connected to the journal (for example, by setting
5295 \fIStandardError=journal\fR)
5296 \fI$JOURNAL_STREAM\fR
5297 contains the device and inode numbers of the connection file descriptor, formatted in decimal, separated by a colon (":")\&. This permits invoked processes to safely detect whether their standard output or standard error output are connected to the journal\&. The device and inode numbers of the file descriptors should be compared with the values set in the environment variable to determine whether the process output is still connected to the journal\&. Note that it is generally not sufficient to only check whether
5298 \fI$JOURNAL_STREAM\fR
5299 is set at all as services might invoke external processes replacing their standard output or standard error output, without unsetting the environment variable\&.
5300 .sp
5301 If both standard output and standard error of the executed processes are connected to the journal via a stream socket, this environment variable will contain information about the standard error stream, as that\*(Aqs usually the preferred destination for log data\&. (Note that typically the same stream is used for both standard output and standard error, hence very likely the environment variable contains device and inode information matching both stream file descriptors\&.)
5302 .sp
5303 This environment variable is primarily useful to allow services to optionally upgrade their used log protocol to the native journal protocol (using
5304 \fBsd_journal_print\fR(3)
5305 and other functions) if their standard output or standard error output is connected to the journal anyway, thus enabling delivery of structured metadata along with logged messages\&.
5306 .sp
5307 Added in version 231\&.
5308 .RE
5309 .PP
5310 \fI$SERVICE_RESULT\fR
5311 .RS 4
5312 Only used for the service unit type\&. This environment variable is passed to all
5313 \fIExecStop=\fR
5314 and
5315 \fIExecStopPost=\fR
5316 processes, and encodes the service "result"\&. Currently, the following values are defined:
5317 .sp
5318 .it 1 an-trap
5319 .nr an-no-space-flag 1
5320 .nr an-break-flag 1
5321 .br
5322 .B Table\ \&6.\ \&Defined \fI$SERVICE_RESULT\fR values
5323 .TS
5324 allbox tab(:);
5325 lB lB.
5326 T{
5327 Value
5328 T}:T{
5329 Meaning
5330 T}
5331 .T&
5332 l l
5333 l l
5334 l l
5335 l l
5336 l l
5337 l l
5338 l l
5339 l l
5340 l l
5341 l l
5342 l l.
5343 T{
5344 "success"
5345 T}:T{
5346 The service ran successfully and exited cleanly\&.
5347 T}
5348 T{
5349 "protocol"
5350 T}:T{
5351 A protocol violation occurred: the service did not take the steps required by its unit configuration (specifically what is configured in its \fIType=\fR setting)\&.
5352 T}
5353 T{
5354 "timeout"
5355 T}:T{
5356 One of the steps timed out\&.
5357 T}
5358 T{
5359 "exit\-code"
5360 T}:T{
5361 Service process exited with a non\-zero exit code; see \fI$EXIT_CODE\fR below for the actual exit code returned\&.
5362 T}
5363 T{
5364 "signal"
5365 T}:T{
5366 A service process was terminated abnormally by a signal, without dumping core\&. See \fI$EXIT_CODE\fR below for the actual signal causing the termination\&.
5367 T}
5368 T{
5369 "core\-dump"
5370 T}:T{
5371 A service process terminated abnormally with a signal and dumped core\&. See \fI$EXIT_CODE\fR below for the signal causing the termination\&.
5372 T}
5373 T{
5374 "watchdog"
5375 T}:T{
5376 Watchdog keep\-alive ping was enabled for the service, but the deadline was missed\&.
5377 T}
5378 T{
5379 "exec\-condition"
5380 T}:T{
5381 Service did not run because \fIExecCondition=\fR failed (that is its command exited with an exit status of 1 through 254 (inclusive))\&.
5382 T}
5383 T{
5384 "oom\-kill"
5385 T}:T{
5386 A service process was terminated by the Out\-Of\-Memory (OOM) killer\&.
5387 T}
5388 T{
5389 "start\-limit\-hit"
5390 T}:T{
5391 A start limit was defined for the unit and it was hit, causing the unit to fail to start\&. See \fBsystemd.unit\fR(5)\*(Aqs \fIStartLimitIntervalSec=\fR and \fIStartLimitBurst=\fR for details\&.
5392 T}
5393 T{
5394 "resources"
5395 T}:T{
5396 A catch\-all condition in case a system operation failed\&.
5397 T}
5398 .TE
5399 .sp 1
5400 This environment variable is useful to monitor failure or successful termination of a service\&. Even though this variable is available in both
5401 \fIExecStop=\fR
5402 and
5403 \fIExecStopPost=\fR, it is usually a better choice to place monitoring tools in the latter, as the former is only invoked for services that managed to start up correctly, and the latter covers both services that failed during their start\-up and those which failed during their runtime\&.
5404 .sp
5405 Added in version 232\&.
5406 .RE
5407 .PP
5408 \fI$EXIT_CODE\fR, \fI$EXIT_STATUS\fR
5409 .RS 4
5410 Only defined for the service unit type\&. These environment variables are passed to all
5411 \fIExecStop=\fR,
5412 \fIExecStopPost=\fR
5413 processes and contain exit status/code information of the main process of the service\&. For the precise definition of the exit code and status, see
5414 \fBwait\fR(2)\&.
5415 \fI$EXIT_CODE\fR
5416 is one of
5417 "exited",
5418 "killed",
5419 "dumped"\&.
5420 \fI$EXIT_STATUS\fR
5421 contains the numeric exit code formatted as string if
5422 \fI$EXIT_CODE\fR
5423 is
5424 "exited", and the signal name in all other cases\&. Note that these environment variables are only set if the service manager succeeded to start and identify the main process of the service\&.
5425 .sp
5426 .it 1 an-trap
5427 .nr an-no-space-flag 1
5428 .nr an-break-flag 1
5429 .br
5430 .B Table\ \&7.\ \&Summary of possible service result variable values
5431 .TS
5432 allbox tab(:);
5433 lB lB lB.
5434 T{
5435 \fI$SERVICE_RESULT\fR
5436 T}:T{
5437 \fI$EXIT_CODE\fR
5438 T}:T{
5439 \fI$EXIT_STATUS\fR
5440 T}
5441 .T&
5442 lt lt l
5443 ^ lt l
5444 lt lt l
5445 ^ l l
5446 lt lt l
5447 ^ lt l
5448 lt lt l
5449 lt lt l
5450 lt lt l
5451 lt l l
5452 ^ l l
5453 ^ l l
5454 lt l l
5455 lt lt l
5456 l l l
5457 l l l
5458 l s s.
5459 T{
5460 "success"
5461 T}:T{
5462 "killed"
5463 T}:T{
5464 "HUP", "INT", "TERM", "PIPE"
5465 T}
5466 :T{
5467 "exited"
5468 T}:T{
5469 "0"
5470 T}
5471 T{
5472 "protocol"
5473 T}:T{
5474 not set
5475 T}:T{
5476 not set
5477 T}
5478 :T{
5479 "exited"
5480 T}:T{
5481 "0"
5482 T}
5483 T{
5484 "timeout"
5485 T}:T{
5486 "killed"
5487 T}:T{
5488 "TERM", "KILL"
5489 T}
5490 :T{
5491 "exited"
5492 T}:T{
5493 "0", "1", "2", "3", \&..., "255"
5494 T}
5495 T{
5496 "exit\-code"
5497 T}:T{
5498 "exited"
5499 T}:T{
5500 "1", "2", "3", \&..., "255"
5501 T}
5502 T{
5503 "signal"
5504 T}:T{
5505 "killed"
5506 T}:T{
5507 "HUP", "INT", "KILL", \&...
5508 T}
5509 T{
5510 "core\-dump"
5511 T}:T{
5512 "dumped"
5513 T}:T{
5514 "ABRT", "SEGV", "QUIT", \&...
5515 T}
5516 T{
5517 "watchdog"
5518 T}:T{
5519 "dumped"
5520 T}:T{
5521 "ABRT"
5522 T}
5523 :T{
5524 "killed"
5525 T}:T{
5526 "TERM", "KILL"
5527 T}
5528 :T{
5529 "exited"
5530 T}:T{
5531 "0", "1", "2", "3", \&..., "255"
5532 T}
5533 T{
5534 "exec\-condition"
5535 T}:T{
5536 "exited"
5537 T}:T{
5538 "1", "2", "3", "4", \&..., "254"
5539 T}
5540 T{
5541 "oom\-kill"
5542 T}:T{
5543 "killed"
5544 T}:T{
5545 "TERM", "KILL"
5546 T}
5547 T{
5548 "start\-limit\-hit"
5549 T}:T{
5550 not set
5551 T}:T{
5552 not set
5553 T}
5554 T{
5555 "resources"
5556 T}:T{
5557 any of the above
5558 T}:T{
5559 any of the above
5560 T}
5561 T{
5562 Note: the process may be also terminated by a signal not sent by systemd\&. In particular the process may send an arbitrary signal to itself in a handler for any of the non\-maskable signals\&. Nevertheless, in the "timeout" and "watchdog" rows above only the signals that systemd sends have been included\&. Moreover, using \fISuccessExitStatus=\fR additional exit statuses may be declared to indicate clean termination, which is not reflected by this table\&.
5563 T}
5564 .TE
5565 .sp 1
5566 Added in version 232\&.
5567 .RE
5568 .PP
5569 \fI$MONITOR_SERVICE_RESULT\fR, \fI$MONITOR_EXIT_CODE\fR, \fI$MONITOR_EXIT_STATUS\fR, \fI$MONITOR_INVOCATION_ID\fR, \fI$MONITOR_UNIT\fR
5570 .RS 4
5571 Only defined for the service unit type\&. Those environment variables are passed to all
5572 \fIExecStart=\fR
5573 and
5574 \fIExecStartPre=\fR
5575 processes which run in services triggered by
5576 \fIOnFailure=\fR
5577 or
5578 \fIOnSuccess=\fR
5579 dependencies\&.
5580 .sp
5581 Variables
5582 \fI$MONITOR_SERVICE_RESULT\fR,
5583 \fI$MONITOR_EXIT_CODE\fR
5584 and
5585 \fI$MONITOR_EXIT_STATUS\fR
5586 take the same values as for
5587 \fIExecStop=\fR
5588 and
5589 \fIExecStopPost=\fR
5590 processes\&. Variables
5591 \fI$MONITOR_INVOCATION_ID\fR
5592 and
5593 \fI$MONITOR_UNIT\fR
5594 are set to the invocation id and unit name of the service which triggered the dependency\&.
5595 .sp
5596 Note that when multiple services specify the same unit as their
5597 \fIOnFailure=\fR
5598 or
5599 \fIOnSuccess=\fR
5600 handler, those variables will
5601 \fInot\fR
5602 be passed\&. Consider using a template handler unit for that case instead:
5603 "OnFailure=\fIhandler\fR@%n\&.service"
5604 for non\-templated units, or
5605 "OnFailure=\fIhandler\fR@%p\-%i\&.service"
5606 for templated units\&.
5607 .sp
5608 Added in version 251\&.
5609 .RE
5610 .PP
5611 \fI$PIDFILE\fR
5612 .RS 4
5613 The path to the configured PID file, in case the process is forked off on behalf of a service that uses the
5614 \fIPIDFile=\fR
5615 setting, see
5616 \fBsystemd.service\fR(5)
5617 for details\&. Service code may use this environment variable to automatically generate a PID file at the location configured in the unit file\&. This field is set to an absolute path in the file system\&.
5618 .sp
5619 Added in version 242\&.
5620 .RE
5621 .PP
5622 \fI$REMOTE_ADDR\fR, \fI$REMOTE_PORT\fR
5623 .RS 4
5624 If this is a unit started via per\-connection socket activation (i\&.e\&. via a socket unit with
5625 \fIAccept=yes\fR), these environment variables contain information about the remote peer of the socket connection\&.
5626 .sp
5627 For IPv4 and IPv6 connections,
5628 \fI$REMOTE_ADDR\fR
5629 contains the IP address, and
5630 \fI$REMOTE_PORT\fR
5631 contains the port number of the remote peer\&.
5632 .sp
5633 For
5634 \fBAF_UNIX\fR
5635 socket connections,
5636 \fI$REMOTE_ADDR\fR
5637 contains either the remote socket\*(Aqs file system path starting with a slash ("/"), its address in the abstract namespace starting with an at symbol ("@"), or is unset in case of an unnamed socket\&.
5638 \fI$REMOTE_PORT\fR
5639 is not set for
5640 \fBAF_UNIX\fR
5641 sockets\&.
5642 .sp
5643 Added in version 220\&.
5644 .RE
5645 .PP
5646 \fI$SO_COOKIE\fR
5647 .RS 4
5648 If this is a unit started via per\-connection socket activation (i\&.e\&. via a socket unit with
5649 \fIAccept=yes\fR), this environment variable contains the Linux socket cookie, formatted as decimal integer\&. The socket cookie can otherwise be acquired via
5650 \fBgetsockopt\fR(7)\&.
5651 .sp
5652 Added in version 258\&.
5653 .RE
5654 .PP
5655 \fI$TRIGGER_UNIT\fR, \fI$TRIGGER_PATH\fR, \fI$TRIGGER_TIMER_REALTIME_USEC\fR, \fI$TRIGGER_TIMER_MONOTONIC_USEC\fR
5656 .RS 4
5657 If the unit was activated dynamically (e\&.g\&.: a corresponding path unit or timer unit), the unit that triggered it and other type\-dependent information will be passed via these variables\&. Note that this information is provided in a best\-effort way\&. For example, multiple triggers happening one after another will be coalesced and only one will be reported, with no guarantee as to which one it will be\&. Because of this, in most cases this variable will be primarily informational, i\&.e\&. useful for debugging purposes, is lossy, and should not be relied upon to propagate a comprehensive reason for activation\&.
5658 .sp
5659 Added in version 252\&.
5660 .RE
5661 .PP
5662 \fI$MEMORY_PRESSURE_WATCH\fR, \fI$MEMORY_PRESSURE_WRITE\fR
5663 .RS 4
5664 If memory pressure monitoring is enabled for this service unit, the path to watch and the data to write into it\&. See
5665 \m[blue]\fBResource Pressure Handling\fR\m[]\&\s-2\u[27]\d\s+2
5666 for details about these variables and the service protocol data they convey\&.
5667 .sp
5668 Added in version 254\&.
5669 .RE
5670 .PP
5671 \fI$CPU_PRESSURE_WATCH\fR, \fI$CPU_PRESSURE_WRITE\fR
5672 .RS 4
5673 If CPU pressure monitoring is enabled for this service unit, the path to watch and the data to write into it\&. See
5674 \m[blue]\fBResource Pressure Handling\fR\m[]\&\s-2\u[27]\d\s+2
5675 for details about these variables and the service protocol data they convey\&.
5676 .sp
5677 Added in version 261\&.
5678 .RE
5679 .PP
5680 \fI$IO_PRESSURE_WATCH\fR, \fI$IO_PRESSURE_WRITE\fR
5681 .RS 4
5682 If IO pressure monitoring is enabled for this service unit, the path to watch and the data to write into it\&. See
5683 \m[blue]\fBResource Pressure Handling\fR\m[]\&\s-2\u[27]\d\s+2
5684 for details about these variables and the service protocol data they convey\&.
5685 .sp
5686 Added in version 261\&.
5687 .RE
5688 .PP
5689 \fI$FDSTORE\fR
5690 .RS 4
5691 The maximum number of file descriptors that may be stored in the manager for the service\&. This variable is set when the file descriptor store is enabled for the service, i\&.e\&.
5692 \fIFileDescriptorStoreMax=\fR
5693 is set to a non\-zero value (see
5694 \fBsystemd.service\fR(5)
5695 for details)\&. Applications may check this environment variable before sending file descriptors to the service manager via
5696 \fBsd_pid_notify_with_fds\fR(3)\&.
5697 .sp
5698 Added in version 254\&.
5699 .RE
5700 .PP
5701 \fI$DEBUG_INVOCATION\fR
5702 .RS 4
5703 If
5704 \fIRestartMode=debug\fR
5705 is set, and a previous attempt at starting the unit failed, this variable will be passed to the service to indicate that additional logging should be enabled at startup\&. See
5706 \fBsystemd.service\fR(5)
5707 for more details\&.
5708 .sp
5709 Added in version 257\&.
5710 .RE
5711 .PP
5712 For system services, when
5713 \fIPAMName=\fR
5714 is enabled and
5715 \fBpam_systemd\fR
5716 is part of the selected PAM stack, additional environment variables defined by systemd may be set for services\&. Specifically, these are
5717 \fI$XDG_SEAT\fR,
5718 \fI$XDG_VTNR\fR, see
5719 \fBpam_systemd\fR(8)
5720 for details\&.
5721 .SH "PROCESS EXIT CODES"
5722 .PP
5723 When invoking a unit process the service manager possibly fails to apply the execution parameters configured with the settings above\&. In that case the already created service process will exit with a non\-zero exit code before the configured command line is executed\&. (Or in other words, the child process possibly exits with these error codes, after having been created by the
5724 \fBfork\fR(2)
5725 system call, but before the matching
5726 \fBexecve\fR(2)
5727 system call is called\&.) Specifically, exit codes defined by the C library, by the LSB specification and by the systemd service manager itself are used\&.
5728 .PP
5729 The following basic service exit codes are defined by the C library\&.
5730 .sp
5731 .it 1 an-trap
5732 .nr an-no-space-flag 1
5733 .nr an-break-flag 1
5734 .br
5735 .B Table\ \&8.\ \&Basic C library exit codes
5736 .TS
5737 allbox tab(:);
5738 lB lB lB.
5739 T{
5740 Exit Code
5741 T}:T{
5742 Symbolic Name
5743 T}:T{
5744 Description
5745 T}
5746 .T&
5747 l l l
5748 l l l.
5749 T{
5750 0
5751 T}:T{
5752 \fBEXIT_SUCCESS\fR
5753 T}:T{
5754 Generic success code\&.
5755 T}
5756 T{
5757 1
5758 T}:T{
5759 \fBEXIT_FAILURE\fR
5760 T}:T{
5761 Generic failure or unspecified error\&.
5762 T}
5763 .TE
5764 .sp 1
5765 .PP
5766 The following service exit codes are defined by the
5767 \m[blue]\fBLSB specification\fR\m[]\&\s-2\u[28]\d\s+2\&.
5768 .sp
5769 .it 1 an-trap
5770 .nr an-no-space-flag 1
5771 .nr an-break-flag 1
5772 .br
5773 .B Table\ \&9.\ \&LSB service exit codes
5774 .TS
5775 allbox tab(:);
5776 lB lB lB.
5777 T{
5778 Exit Code
5779 T}:T{
5780 Symbolic Name
5781 T}:T{
5782 Description
5783 T}
5784 .T&
5785 l l l
5786 l l l
5787 l l l
5788 l l l
5789 l l l
5790 l l l.
5791 T{
5792 2
5793 T}:T{
5794 \fBEXIT_INVALIDARGUMENT\fR
5795 T}:T{
5796 Invalid or excess arguments\&.
5797 T}
5798 T{
5799 3
5800 T}:T{
5801 \fBEXIT_NOTIMPLEMENTED\fR
5802 T}:T{
5803 Unimplemented feature\&.
5804 T}
5805 T{
5806 4
5807 T}:T{
5808 \fBEXIT_NOPERMISSION\fR
5809 T}:T{
5810 The user has insufficient privileges\&.
5811 T}
5812 T{
5813 5
5814 T}:T{
5815 \fBEXIT_NOTINSTALLED\fR
5816 T}:T{
5817 The program is not installed\&.
5818 T}
5819 T{
5820 6
5821 T}:T{
5822 \fBEXIT_NOTCONFIGURED\fR
5823 T}:T{
5824 The program is not configured\&.
5825 T}
5826 T{
5827 7
5828 T}:T{
5829 \fBEXIT_NOTRUNNING\fR
5830 T}:T{
5831 The program is not running\&.
5832 T}
5833 .TE
5834 .sp 1
5835 .PP
5836 The LSB specification suggests that error codes 200 and above are reserved for implementations\&. Some of them are used by the service manager to indicate problems during process invocation:
5837 .sp
5838 .it 1 an-trap
5839 .nr an-no-space-flag 1
5840 .nr an-break-flag 1
5841 .br
5842 .B Table\ \&10.\ \&systemd\-specific exit codes
5843 .TS
5844 allbox tab(:);
5845 lB lB lB.
5846 T{
5847 Exit Code
5848 T}:T{
5849 Symbolic Name
5850 T}:T{
5851 Description
5852 T}
5853 .T&
5854 l l l
5855 l l l
5856 l l l
5857 l l l
5858 l l l
5859 l l l
5860 l l l
5861 l l l
5862 l l l
5863 l l l
5864 l l l
5865 l l l
5866 l l l
5867 l l l
5868 l l l
5869 l l l
5870 l l l
5871 l l l
5872 l l l
5873 l l l
5874 l l l
5875 l l l
5876 l l l
5877 l l l
5878 l l l
5879 l l l
5880 l l l
5881 l l l
5882 l l l
5883 l l l
5884 l l l
5885 l l l
5886 l l l
5887 l l l
5888 l l l
5889 l l l
5890 l l l
5891 l l l
5892 l l l
5893 l l l
5894 l l l
5895 l l l
5896 l l l.
5897 T{
5898 200
5899 T}:T{
5900 \fBEXIT_CHDIR\fR
5901 T}:T{
5902 Changing to the requested working directory failed\&. See \fIWorkingDirectory=\fR above\&.
5903 T}
5904 T{
5905 201
5906 T}:T{
5907 \fBEXIT_NICE\fR
5908 T}:T{
5909 Failed to set up process scheduling priority (nice level)\&. See \fINice=\fR above\&.
5910 T}
5911 T{
5912 202
5913 T}:T{
5914 \fBEXIT_FDS\fR
5915 T}:T{
5916 Failed to close unwanted file descriptors, or to adjust passed file descriptors\&.
5917 T}
5918 T{
5919 203
5920 T}:T{
5921 \fBEXIT_EXEC\fR
5922 T}:T{
5923 The actual process execution failed (specifically, the \fBexecve\fR(2) system call)\&. Most likely this is caused by a missing or non\-accessible executable file\&.
5924 T}
5925 T{
5926 204
5927 T}:T{
5928 \fBEXIT_MEMORY\fR
5929 T}:T{
5930 Failed to perform an action due to memory shortage\&.
5931 T}
5932 T{
5933 205
5934 T}:T{
5935 \fBEXIT_LIMITS\fR
5936 T}:T{
5937 Failed to adjust resource limits\&. See \fILimitCPU=\fR and related settings above\&.
5938 T}
5939 T{
5940 206
5941 T}:T{
5942 \fBEXIT_OOM_ADJUST\fR
5943 T}:T{
5944 Failed to adjust the OOM setting\&. See \fIOOMScoreAdjust=\fR above\&.
5945 T}
5946 T{
5947 207
5948 T}:T{
5949 \fBEXIT_SIGNAL_MASK\fR
5950 T}:T{
5951 Failed to set process signal mask\&.
5952 T}
5953 T{
5954 208
5955 T}:T{
5956 \fBEXIT_STDIN\fR
5957 T}:T{
5958 Failed to set up standard input\&. See \fIStandardInput=\fR above\&.
5959 T}
5960 T{
5961 209
5962 T}:T{
5963 \fBEXIT_STDOUT\fR
5964 T}:T{
5965 Failed to set up standard output\&. See \fIStandardOutput=\fR above\&.
5966 T}
5967 T{
5968 210
5969 T}:T{
5970 \fBEXIT_CHROOT\fR
5971 T}:T{
5972 Failed to change root directory (\fBchroot\fR(2))\&. See \fIRootDirectory=\fR/\fIRootImage=\fR above\&.
5973 T}
5974 T{
5975 211
5976 T}:T{
5977 \fBEXIT_IOPRIO\fR
5978 T}:T{
5979 Failed to set up IO scheduling priority\&. See \fIIOSchedulingClass=\fR/\fIIOSchedulingPriority=\fR above\&.
5980 T}
5981 T{
5982 212
5983 T}:T{
5984 \fBEXIT_TIMERSLACK\fR
5985 T}:T{
5986 Failed to set up timer slack\&. See \fITimerSlackNSec=\fR above\&.
5987 T}
5988 T{
5989 213
5990 T}:T{
5991 \fBEXIT_SECUREBITS\fR
5992 T}:T{
5993 Failed to set process secure bits\&. See \fISecureBits=\fR above\&.
5994 T}
5995 T{
5996 214
5997 T}:T{
5998 \fBEXIT_SETSCHEDULER\fR
5999 T}:T{
6000 Failed to set up CPU scheduling\&. See \fICPUSchedulingPolicy=\fR/\fICPUSchedulingPriority=\fR above\&.
6001 T}
6002 T{
6003 215
6004 T}:T{
6005 \fBEXIT_CPUAFFINITY\fR
6006 T}:T{
6007 Failed to set up CPU affinity\&. See \fICPUAffinity=\fR above\&.
6008 T}
6009 T{
6010 216
6011 T}:T{
6012 \fBEXIT_GROUP\fR
6013 T}:T{
6014 Failed to determine or change group credentials\&. See \fIGroup=\fR/\fISupplementaryGroups=\fR above\&.
6015 T}
6016 T{
6017 217
6018 T}:T{
6019 \fBEXIT_USER\fR
6020 T}:T{
6021 Failed to determine or change user credentials, or to set up user namespacing\&. See \fIUser=\fR/\fIPrivateUsers=\fR above\&.
6022 T}
6023 T{
6024 218
6025 T}:T{
6026 \fBEXIT_CAPABILITIES\fR
6027 T}:T{
6028 Failed to drop capabilities, or apply ambient capabilities\&. See \fICapabilityBoundingSet=\fR/\fIAmbientCapabilities=\fR above\&.
6029 T}
6030 T{
6031 219
6032 T}:T{
6033 \fBEXIT_CGROUP\fR
6034 T}:T{
6035 Setting up the service control group failed\&.
6036 T}
6037 T{
6038 220
6039 T}:T{
6040 \fBEXIT_SETSID\fR
6041 T}:T{
6042 Failed to create new process session\&.
6043 T}
6044 T{
6045 221
6046 T}:T{
6047 \fBEXIT_CONFIRM\fR
6048 T}:T{
6049 Execution has been cancelled by the user\&. See the \fIsystemd\&.confirm_spawn=\fR kernel command line setting on \fBkernel-command-line\fR(7) for details\&.
6050 T}
6051 T{
6052 222
6053 T}:T{
6054 \fBEXIT_STDERR\fR
6055 T}:T{
6056 Failed to set up standard error output\&. See \fIStandardError=\fR above\&.
6057 T}
6058 T{
6059 224
6060 T}:T{
6061 \fBEXIT_PAM\fR
6062 T}:T{
6063 Failed to set up PAM session\&. See \fIPAMName=\fR above\&.
6064 T}
6065 T{
6066 225
6067 T}:T{
6068 \fBEXIT_NETWORK\fR
6069 T}:T{
6070 Failed to set up network namespacing\&. See \fIPrivateNetwork=\fR above\&.
6071 T}
6072 T{
6073 226
6074 T}:T{
6075 \fBEXIT_NAMESPACE\fR
6076 T}:T{
6077 Failed to set up mount, UTS, or IPC namespacing\&. See \fIReadOnlyPaths=\fR, \fIProtectHostname=\fR, \fIPrivateIPC=\fR, and related settings above\&.
6078 T}
6079 T{
6080 227
6081 T}:T{
6082 \fBEXIT_NO_NEW_PRIVILEGES\fR
6083 T}:T{
6084 Failed to disable new privileges\&. See \fINoNewPrivileges=yes\fR above\&.
6085 T}
6086 T{
6087 228
6088 T}:T{
6089 \fBEXIT_SECCOMP\fR
6090 T}:T{
6091 Failed to apply system call filters\&. See \fISystemCallFilter=\fR and related settings above\&.
6092 T}
6093 T{
6094 229
6095 T}:T{
6096 \fBEXIT_SELINUX_CONTEXT\fR
6097 T}:T{
6098 Determining or changing SELinux context failed\&. See \fISELinuxContext=\fR above\&.
6099 T}
6100 T{
6101 230
6102 T}:T{
6103 \fBEXIT_PERSONALITY\fR
6104 T}:T{
6105 Failed to set up an execution domain (personality)\&. See \fIPersonality=\fR above\&.
6106 T}
6107 T{
6108 231
6109 T}:T{
6110 \fBEXIT_APPARMOR_PROFILE\fR
6111 T}:T{
6112 Failed to prepare changing AppArmor profile\&. See \fIAppArmorProfile=\fR above\&.
6113 T}
6114 T{
6115 232
6116 T}:T{
6117 \fBEXIT_ADDRESS_FAMILIES\fR
6118 T}:T{
6119 Failed to restrict address families\&. See \fIRestrictAddressFamilies=\fR above\&.
6120 T}
6121 T{
6122 233
6123 T}:T{
6124 \fBEXIT_RUNTIME_DIRECTORY\fR
6125 T}:T{
6126 Setting up runtime directory failed\&. See \fIRuntimeDirectory=\fR and related settings above\&.
6127 T}
6128 T{
6129 235
6130 T}:T{
6131 \fBEXIT_CHOWN\fR
6132 T}:T{
6133 Failed to adjust socket ownership\&. Used for socket units only\&.
6134 T}
6135 T{
6136 236
6137 T}:T{
6138 \fBEXIT_SMACK_PROCESS_LABEL\fR
6139 T}:T{
6140 Failed to set SMACK label\&. See \fISmackProcessLabel=\fR above\&.
6141 T}
6142 T{
6143 237
6144 T}:T{
6145 \fBEXIT_KEYRING\fR
6146 T}:T{
6147 Failed to set up kernel keyring\&.
6148 T}
6149 T{
6150 238
6151 T}:T{
6152 \fBEXIT_STATE_DIRECTORY\fR
6153 T}:T{
6154 Failed to set up unit\*(Aqs state directory\&. See \fIStateDirectory=\fR above\&.
6155 T}
6156 T{
6157 239
6158 T}:T{
6159 \fBEXIT_CACHE_DIRECTORY\fR
6160 T}:T{
6161 Failed to set up unit\*(Aqs cache directory\&. See \fICacheDirectory=\fR above\&.
6162 T}
6163 T{
6164 240
6165 T}:T{
6166 \fBEXIT_LOGS_DIRECTORY\fR
6167 T}:T{
6168 Failed to set up unit\*(Aqs logging directory\&. See \fILogsDirectory=\fR above\&.
6169 T}
6170 T{
6171 241
6172 T}:T{
6173 \fBEXIT_CONFIGURATION_DIRECTORY\fR
6174 T}:T{
6175 Failed to set up unit\*(Aqs configuration directory\&. See \fIConfigurationDirectory=\fR above\&.
6176 T}
6177 T{
6178 242
6179 T}:T{
6180 \fBEXIT_NUMA_POLICY\fR
6181 T}:T{
6182 Failed to set up unit\*(Aqs NUMA memory policy\&. See \fINUMAPolicy=\fR and \fINUMAMask=\fR above\&.
6183 T}
6184 T{
6185 243
6186 T}:T{
6187 \fBEXIT_CREDENTIALS\fR
6188 T}:T{
6189 Failed to set up unit\*(Aqs credentials\&. See \fIImportCredential=\fR, \fILoadCredential=\fR and \fISetCredential=\fR above\&.
6190 T}
6191 T{
6192 245
6193 T}:T{
6194 \fBEXIT_BPF\fR
6195 T}:T{
6196 Failed to apply BPF restrictions\&. See \fIRestrictFileSystems=\fR above\&.
6197 T}
6198 .TE
6199 .sp 1
6200 .PP
6201 Finally, the BSD operating systems define a set of exit codes, typically defined on Linux systems too:
6202 .sp
6203 .it 1 an-trap
6204 .nr an-no-space-flag 1
6205 .nr an-break-flag 1
6206 .br
6207 .B Table\ \&11.\ \&BSD exit codes
6208 .TS
6209 allbox tab(:);
6210 lB lB lB.
6211 T{
6212 Exit Code
6213 T}:T{
6214 Symbolic Name
6215 T}:T{
6216 Description
6217 T}
6218 .T&
6219 l l l
6220 l l l
6221 l l l
6222 l l l
6223 l l l
6224 l l l
6225 l l l
6226 l l l
6227 l l l
6228 l l l
6229 l l l
6230 l l l
6231 l l l
6232 l l l
6233 l l l.
6234 T{
6235 64
6236 T}:T{
6237 \fBEX_USAGE\fR
6238 T}:T{
6239 Command line usage error
6240 T}
6241 T{
6242 65
6243 T}:T{
6244 \fBEX_DATAERR\fR
6245 T}:T{
6246 Data format error
6247 T}
6248 T{
6249 66
6250 T}:T{
6251 \fBEX_NOINPUT\fR
6252 T}:T{
6253 Cannot open input
6254 T}
6255 T{
6256 67
6257 T}:T{
6258 \fBEX_NOUSER\fR
6259 T}:T{
6260 Addressee unknown
6261 T}
6262 T{
6263 68
6264 T}:T{
6265 \fBEX_NOHOST\fR
6266 T}:T{
6267 Host name unknown
6268 T}
6269 T{
6270 69
6271 T}:T{
6272 \fBEX_UNAVAILABLE\fR
6273 T}:T{
6274 Service unavailable
6275 T}
6276 T{
6277 70
6278 T}:T{
6279 \fBEX_SOFTWARE\fR
6280 T}:T{
6281 internal software error
6282 T}
6283 T{
6284 71
6285 T}:T{
6286 \fBEX_OSERR\fR
6287 T}:T{
6288 System error (e\&.g\&., cannot fork)
6289 T}
6290 T{
6291 72
6292 T}:T{
6293 \fBEX_OSFILE\fR
6294 T}:T{
6295 Critical OS file missing
6296 T}
6297 T{
6298 73
6299 T}:T{
6300 \fBEX_CANTCREAT\fR
6301 T}:T{
6302 Cannot create (user) output file
6303 T}
6304 T{
6305 74
6306 T}:T{
6307 \fBEX_IOERR\fR
6308 T}:T{
6309 Input/output error
6310 T}
6311 T{
6312 75
6313 T}:T{
6314 \fBEX_TEMPFAIL\fR
6315 T}:T{
6316 Temporary failure; user is invited to retry
6317 T}
6318 T{
6319 76
6320 T}:T{
6321 \fBEX_PROTOCOL\fR
6322 T}:T{
6323 Remote error in protocol
6324 T}
6325 T{
6326 77
6327 T}:T{
6328 \fBEX_NOPERM\fR
6329 T}:T{
6330 Permission denied
6331 T}
6332 T{
6333 78
6334 T}:T{
6335 \fBEX_CONFIG\fR
6336 T}:T{
6337 Configuration error
6338 T}
6339 .TE
6340 .sp 1
6341 .SH "EXAMPLES"
6342 .PP
6343 \fBExample\ \&9.\ \&\fI$MONITOR_\fR\fI\fI*\fR\fR usage\fR
6344 .PP
6345 A service
6346 myfailer\&.service
6347 which can trigger an
6348 \fIOnFailure=\fR
6349 dependency\&.
6350 .sp
6351 .if n \{\
6352 .RS 4
6353 .\}
6354 .nf
6355 [Unit]
6356 Description=Service which can trigger an OnFailure= dependency
6357 OnFailure=myhandler\&.service
6358
6359 [Service]
6360 ExecStart=/bin/myprogram
6361 .fi
6362 .if n \{\
6363 .RE
6364 .\}
6365 .PP
6366 A service
6367 mysuccess\&.service
6368 which can trigger an
6369 \fIOnSuccess=\fR
6370 dependency\&.
6371 .sp
6372 .if n \{\
6373 .RS 4
6374 .\}
6375 .nf
6376 [Unit]
6377 Description=Service which can trigger an OnSuccess= dependency
6378 OnSuccess=myhandler\&.service
6379
6380 [Service]
6381 ExecStart=/bin/mysecondprogram
6382 .fi
6383 .if n \{\
6384 .RE
6385 .\}
6386 .PP
6387 A service
6388 myhandler\&.service
6389 which can be triggered by any of the above services\&.
6390 .sp
6391 .if n \{\
6392 .RS 4
6393 .\}
6394 .nf
6395 [Unit]
6396 Description=Acts on service failing or succeeding
6397
6398 [Service]
6399 ExecStart=/bin/bash \-c "echo $MONITOR_SERVICE_RESULT $MONITOR_EXIT_CODE $MONITOR_EXIT_STATUS $MONITOR_INVOCATION_ID $MONITOR_UNIT"
6400 .fi
6401 .if n \{\
6402 .RE
6403 .\}
6404 .PP
6405 If
6406 myfailer\&.service
6407 were to run and exit in failure, then
6408 myhandler\&.service
6409 would be triggered and the monitor variables would be set as follows:
6410 .sp
6411 .if n \{\
6412 .RS 4
6413 .\}
6414 .nf
6415 MONITOR_SERVICE_RESULT=exit\-code
6416 MONITOR_EXIT_CODE=exited
6417 MONITOR_EXIT_STATUS=1
6418 MONITOR_INVOCATION_ID=cc8fdc149b2b4ca698d4f259f4054236
6419 MONITOR_UNIT=myfailer\&.service
6420 .fi
6421 .if n \{\
6422 .RE
6423 .\}
6424 .PP
6425 If
6426 mysuccess\&.service
6427 were to run and exit in success, then
6428 myhandler\&.service
6429 would be triggered and the monitor variables would be set as follows:
6430 .sp
6431 .if n \{\
6432 .RS 4
6433 .\}
6434 .nf
6435 MONITOR_SERVICE_RESULT=success
6436 MONITOR_EXIT_CODE=exited
6437 MONITOR_EXIT_STATUS=0
6438 MONITOR_INVOCATION_ID=6ab9af147b8c4a3ebe36e7a5f8611697
6439 MONITOR_UNIT=mysuccess\&.service
6440 .fi
6441 .if n \{\
6442 .RE
6443 .\}
6444 .SH "SEE ALSO"
6445 .PP
6446 \fBsystemd\fR(1), \fBsystemctl\fR(1), \fBsystemd-analyze\fR(1), \fBjournalctl\fR(1), \fBsystemd-system.conf\fR(5), \fBsystemd.unit\fR(5), \fBsystemd.service\fR(5), \fBsystemd.socket\fR(5), \fBsystemd.swap\fR(5), \fBsystemd.mount\fR(5), \fBsystemd.kill\fR(5), \fBsystemd.resource-control\fR(5), \fBsystemd.time\fR(7), \fBsystemd.directives\fR(7), \fBtmpfiles.d\fR(5), \fBexec\fR(3), \fBfork\fR(2)
6447 .SH "NOTES"
6448 .IP " 1." 4
6449 UAPI.2 Discoverable Partitions Specification
6450 .RS 4
6451 \%https://uapi-group.org/specifications/specs/discoverable_partitions_specification
6452 .RE
6453 .IP " 2." 4
6454 polkit
6455 .RS 4
6456 \%https://www.freedesktop.org/software/polkit/docs/latest/
6457 .RE
6458 .IP " 3." 4
6459 The /proc Filesystem
6460 .RS 4
6461 \%https://docs.kernel.org/filesystems/proc.html#mount-options
6462 .RE
6463 .IP " 4." 4
6464 User/Group Name Syntax
6465 .RS 4
6466 \%https://systemd.io/USER_NAMES
6467 .RE
6468 .IP " 5." 4
6469 Password Agent
6470 .RS 4
6471 \%https://systemd.io/PASSWORD_AGENTS
6472 .RE
6473 .IP " 6." 4
6474 No New Privileges Flag
6475 .RS 4
6476 \%https://docs.kernel.org/userspace-api/no_new_privs.html
6477 .RE
6478 .IP " 7." 4
6479 JSON User Record
6480 .RS 4
6481 \%https://systemd.io/USER_RECORD
6482 .RE
6483 .IP " 8." 4
6484 The /proc Filesystem
6485 .RS 4
6486 \%https://docs.kernel.org/filesystems/proc.html
6487 .RE
6488 .IP " 9." 4
6489 id-mapped mounts
6490 .RS 4
6491 \%https://lwn.net/Articles/896255/
6492 .RE
6493 .IP "10." 4
6494 quotactl
6495 .RS 4
6496 \%https://man7.org/linux/man-pages/man2/quotactl.2.html
6497 .RE
6498 .IP "11." 4
6499 quotaon.
6500 .RS 4
6501 \%https://linux.die.net/man/8/quotaon
6502 .RE
6503 .IP "12." 4
6504 repquota
6505 .RS 4
6506 \%https://man7.org/linux/man-pages/man8/repquota.8.html
6507 .RE
6508 .IP "13." 4
6509 Kernel Samepage Merging
6510 .RS 4
6511 \%https://docs.kernel.org/admin-guide/mm/ksm.html
6512 .RE
6513 .IP "14." 4
6514 Transparent Hugepage Support
6515 .RS 4
6516 \%https://docs.kernel.org/admin-guide/mm/transhuge.html
6517 .RE
6518 .IP "15." 4
6519 LWN post
6520 .RS 4
6521 \%https://lwn.net/Articles/947173/
6522 .RE
6523 .IP "16." 4
6524 unicode scalar values
6525 .RS 4
6526 \%https://www.unicode.org/glossary/#unicode_scalar_value
6527 .RE
6528 .IP "17." 4
6529 unicode noncharacters
6530 .RS 4
6531 \%https://www.unicode.org/glossary/#noncharacter
6532 .RE
6533 .IP "18." 4
6534 unicode byte order mark
6535 .RS 4
6536 \%https://www.unicode.org/glossary/#byte_order_mark
6537 .RE
6538 .IP "19." 4
6539 POSIX shell unquoted text
6540 .RS 4
6541 \%https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02_01
6542 .RE
6543 .IP "20." 4
6544 POSIX shell single-quoted text
6545 .RS 4
6546 \%https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02_02
6547 .RE
6548 .IP "21." 4
6549 POSIX shell double-quoted text
6550 .RS 4
6551 \%https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02_03
6552 .RE
6553 .IP "22." 4
6554 Base64
6555 .RS 4
6556 \%https://tools.ietf.org/html/rfc2045#section-6.8
6557 .RE
6558 .IP "23." 4
6559 Container Interface
6560 .RS 4
6561 \%https://systemd.io/CONTAINER_INTERFACE
6562 .RE
6563 .IP "24." 4
6564 DMI/SMBIOS
6565 .RS 4
6566 \%https://www.dmtf.org/standards/smbios
6567 .RE
6568 .IP "25." 4
6569 qemu
6570 .RS 4
6571 \%https://www.qemu.org/docs/master/system/index.html
6572 .RE
6573 .IP "26." 4
6574 System and Service Credentials
6575 .RS 4
6576 \%https://systemd.io/CREDENTIALS
6577 .RE
6578 .IP "27." 4
6579 Resource Pressure Handling
6580 .RS 4
6581 \%https://systemd.io/PRESSURE
6582 .RE
6583 .IP "28." 4
6584 LSB specification
6585 .RS 4
6586 \%https://refspecs.linuxbase.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
6587 .RE