1SYSTEMD.EXEC(5)                  systemd.exec                  SYSTEMD.EXEC(5)
2
3
4

NAME

6       systemd.exec - Execution environment configuration
7

SYNOPSIS

9       service.service, socket.socket, mount.mount, swap.swap
10

DESCRIPTION

12       Unit configuration files for services, sockets, mount points, and swap
13       devices share a subset of configuration options which define the
14       execution environment of spawned processes.
15
16       This man page lists the configuration options shared by these four unit
17       types. See systemd.unit(5) for the common options of all unit
18       configuration files, and systemd.service(5), systemd.socket(5),
19       systemd.swap(5), and systemd.mount(5) for more information on the
20       specific unit configuration files. The execution specific configuration
21       options are configured in the [Service], [Socket], [Mount], or [Swap]
22       sections, depending on the unit type.
23
24       In addition, options which control resources through Linux Control
25       Groups (cgroups) are listed in systemd.resource-control(5). Those
26       options complement options listed here.
27

IMPLICIT DEPENDENCIES

29       A few execution parameters result in additional, automatic dependencies
30       to be added:
31
32       ·   Units with WorkingDirectory=, RootDirectory=, RootImage=,
33           RuntimeDirectory=, StateDirectory=, CacheDirectory=, LogsDirectory=
34           or ConfigurationDirectory= set automatically gain dependencies of
35           type Requires= and After= on all mount units required to access the
36           specified paths. This is equivalent to having them listed
37           explicitly in RequiresMountsFor=.
38
39       ·   Similar, units with PrivateTmp= enabled automatically get mount
40           unit dependencies for all mounts required to access /tmp and
41           /var/tmp. They will also gain an automatic After= dependency on
42           systemd-tmpfiles-setup.service(8).
43
44       ·   Units whose standard output or error output is connected to
45           journal, syslog or kmsg (or their combinations with console output,
46           see below) automatically acquire dependencies of type After= on
47           systemd-journald.socket.
48

PATHS

50       The following settings may be used to change a service's view of the
51       filesystem. Please note that the paths must be absolute and must not
52       contain a ".."  path component.
53
54       WorkingDirectory=
55           Takes a directory path relative to the service's root directory
56           specified by RootDirectory=, or the special value "~". Sets the
57           working directory for executed processes. If set to "~", the home
58           directory of the user specified in User= is used. If not set,
59           defaults to the root directory when systemd is running as a system
60           instance and the respective user's home directory if run as user.
61           If the setting is prefixed with the "-" character, a missing
62           working directory is not considered fatal. If
63           RootDirectory=/RootImage= is not set, then WorkingDirectory= is
64           relative to the root of the system running the service manager.
65           Note that setting this parameter might result in additional
66           dependencies to be added to the unit (see above).
67
68       RootDirectory=
69           Takes a directory path relative to the host's root directory (i.e.
70           the root of the system running the service manager). Sets the root
71           directory for executed processes, with the chroot(2) system call.
72           If this is used, it must be ensured that the process binary and all
73           its auxiliary files are available in the chroot() jail. Note that
74           setting this parameter might result in additional dependencies to
75           be added to the unit (see above).
76
77           The MountAPIVFS= and PrivateUsers= settings are particularly useful
78           in conjunction with RootDirectory=. For details, see below.
79
80       RootImage=
81           Takes a path to a block device node or regular file as argument.
82           This call is similar to RootDirectory= however mounts a file system
83           hierarchy from a block device node or loopback file instead of a
84           directory. The device node or file system image file needs to
85           contain a file system without a partition table, or a file system
86           within an MBR/MS-DOS or GPT partition table with only a single
87           Linux-compatible partition, or a set of file systems within a GPT
88           partition table that follows the Discoverable Partitions
89           Specification[1].
90
91       MountAPIVFS=
92           Takes a boolean argument. If on, a private mount namespace for the
93           unit's processes is created and the API file systems /proc, /sys,
94           and /dev are mounted inside of it, unless they are already mounted.
95           Note that this option has no effect unless used in conjunction with
96           RootDirectory=/RootImage= as these three mounts are generally
97           mounted in the host anyway, and unless the root directory is
98           changed, the private mount namespace will be a 1:1 copy of the
99           host's, and include these three mounts. Note that the /dev file
100           system of the host is bind mounted if this option is used without
101           PrivateDevices=. To run the service with a private, minimal version
102           of /dev/, combine this option with PrivateDevices=.
103
104       BindPaths=, BindReadOnlyPaths=
105           Configures unit-specific bind mounts. A bind mount makes a
106           particular file or directory available at an additional place in
107           the unit's view of the file system. Any bind mounts created with
108           this option are specific to the unit, and are not visible in the
109           host's mount table. This option expects a whitespace separated list
110           of bind mount definitions. Each definition consists of a
111           colon-separated triple of source path, destination path and option
112           string, where the latter two are optional. If only a source path is
113           specified the source and destination is taken to be the same. The
114           option string may be either "rbind" or "norbind" for configuring a
115           recursive or non-recursive bind mount. If the destination path is
116           omitted, the option string must be omitted too. Each bind mount
117           definition may be prefixed with "-", in which case it will be
118           ignored when its source path does not exist.
119
120           BindPaths= creates regular writable bind mounts (unless the source
121           file system mount is already marked read-only), while
122           BindReadOnlyPaths= creates read-only bind mounts. These settings
123           may be used more than once, each usage appends to the unit's list
124           of bind mounts. If the empty string is assigned to either of these
125           two options the entire list of bind mounts defined prior to this is
126           reset. Note that in this case both read-only and regular bind
127           mounts are reset, regardless which of the two settings is used.
128
129           This option is particularly useful when RootDirectory=/RootImage=
130           is used. In this case the source path refers to a path on the host
131           file system, while the destination path refers to a path below the
132           root directory of the unit.
133

CREDENTIALS

135       User=, Group=
136           Set the UNIX user or group that the processes are executed as,
137           respectively. Takes a single user or group name, or a numeric ID as
138           argument. For system services (services run by the system service
139           manager, i.e. managed by PID 1) and for user services of the root
140           user (services managed by root's instance of systemd --user), the
141           default is "root", but User= may be used to specify a different
142           user. For user services of any other user, switching user identity
143           is not permitted, hence the only valid setting is the same user the
144           user's service manager is running as. If no group is set, the
145           default group of the user is used. This setting does not affect
146           commands whose command line is prefixed with "+".
147
148           Note that restrictions on the user/group name syntax are enforced:
149           the specified name must consist only of the characters a-z, A-Z,
150           0-9, "_" and "-", except for the first character which must be one
151           of a-z, A-Z or "_" (i.e. numbers and "-" are not permitted as first
152           character). The user/group name must have at least one character,
153           and at most 31. These restrictions are enforced in order to avoid
154           ambiguities and to ensure user/group names and unit files remain
155           portable among Linux systems.
156
157           When used in conjunction with DynamicUser= the user/group name
158           specified is dynamically allocated at the time the service is
159           started, and released at the time the service is stopped — unless
160           it is already allocated statically (see below). If DynamicUser= is
161           not used the specified user and group must have been created
162           statically in the user database no later than the moment the
163           service is started, for example using the sysusers.d(5) facility,
164           which is applied at boot or package install time.
165
166       DynamicUser=
167           Takes a boolean parameter. If set, a UNIX user and group pair is
168           allocated dynamically when the unit is started, and released as
169           soon as it is stopped. The user and group will not be added to
170           /etc/passwd or /etc/group, but are managed transiently during
171           runtime. The nss-systemd(8) glibc NSS module provides integration
172           of these dynamic users/groups into the system's user and group
173           databases. The user and group name to use may be configured via
174           User= and Group= (see above). If these options are not used and
175           dynamic user/group allocation is enabled for a unit, the name of
176           the dynamic user/group is implicitly derived from the unit name. If
177           the unit name without the type suffix qualifies as valid user name
178           it is used directly, otherwise a name incorporating a hash of it is
179           used. If a statically allocated user or group of the configured
180           name already exists, it is used and no dynamic user/group is
181           allocated. Note that if User= is specified and the static group
182           with the name exists, then it is required that the static user with
183           the name already exists. Similarly, if Group= is specified and the
184           static user with the name exists, then it is required that the
185           static group with the name already exists. Dynamic users/groups are
186           allocated from the UID/GID range 61184...65519. It is recommended
187           to avoid this range for regular system or login users. At any point
188           in time each UID/GID from this range is only assigned to zero or
189           one dynamically allocated users/groups in use. However, UID/GIDs
190           are recycled after a unit is terminated. Care should be taken that
191           any processes running as part of a unit for which dynamic
192           users/groups are enabled do not leave files or directories owned by
193           these users/groups around, as a different unit might get the same
194           UID/GID assigned later on, and thus gain access to these files or
195           directories. If DynamicUser= is enabled, RemoveIPC=, PrivateTmp=
196           are implied. This ensures that the lifetime of IPC objects and
197           temporary files created by the executed processes is bound to the
198           runtime of the service, and hence the lifetime of the dynamic
199           user/group. Since /tmp and /var/tmp are usually the only
200           world-writable directories on a system this ensures that a unit
201           making use of dynamic user/group allocation cannot leave files
202           around after unit termination. Moreover ProtectSystem=strict and
203           ProtectHome=read-only are implied, thus prohibiting the service to
204           write to arbitrary file system locations. In order to allow the
205           service to write to certain directories, they have to be
206           whitelisted using ReadWritePaths=, but care must be taken so that
207           UID/GID recycling doesn't create security issues involving files
208           created by the service. Use RuntimeDirectory= (see below) in order
209           to assign a writable runtime directory to a service, owned by the
210           dynamic user/group and removed automatically when the unit is
211           terminated. Use StateDirectory=, CacheDirectory= and LogsDirectory=
212           in order to assign a set of writable directories for specific
213           purposes to the service in a way that they are protected from
214           vulnerabilities due to UID reuse (see below). Defaults to off.
215
216       SupplementaryGroups=
217           Sets the supplementary Unix groups the processes are executed as.
218           This takes a space-separated list of group names or IDs. This
219           option may be specified more than once, in which case all listed
220           groups are set as supplementary groups. When the empty string is
221           assigned, the list of supplementary groups is reset, and all
222           assignments prior to this one will have no effect. In any way, this
223           option does not override, but extends the list of supplementary
224           groups configured in the system group database for the user. This
225           does not affect commands prefixed with "+".
226
227       PAMName=
228           Sets the PAM service name to set up a session as. If set, the
229           executed process will be registered as a PAM session under the
230           specified service name. This is only useful in conjunction with the
231           User= setting, and is otherwise ignored. If not set, no PAM session
232           will be opened for the executed processes. See pam(8) for details.
233
234           Note that for each unit making use of this option a PAM session
235           handler process will be maintained as part of the unit and stays
236           around as long as the unit is active, to ensure that appropriate
237           actions can be taken when the unit and hence the PAM session
238           terminates. This process is named "(sd-pam)" and is an immediate
239           child process of the unit's main process.
240
241           Note that when this option is used for a unit it is very likely
242           (depending on PAM configuration) that the main unit process will be
243           migrated to its own session scope unit when it is activated. This
244           process will hence be associated with two units: the unit it was
245           originally started from (and for which PAMName= was configured),
246           and the session scope unit. Any child processes of that process
247           will however be associated with the session scope unit only. This
248           has implications when used in combination with NotifyAccess=all, as
249           these child processes will not be able to affect changes in the
250           original unit through notification messages. These messages will be
251           considered belonging to the session scope unit and not the original
252           unit. It is hence not recommended to use PAMName= in combination
253           with NotifyAccess=all.
254

CAPABILITIES

256       CapabilityBoundingSet=
257           Controls which capabilities to include in the capability bounding
258           set for the executed process. See capabilities(7) for details.
259           Takes a whitespace-separated list of capability names, e.g.
260           CAP_SYS_ADMIN, CAP_DAC_OVERRIDE, CAP_SYS_PTRACE. Capabilities
261           listed will be included in the bounding set, all others are
262           removed. If the list of capabilities is prefixed with "~", all but
263           the listed capabilities will be included, the effect of the
264           assignment inverted. Note that this option also affects the
265           respective capabilities in the effective, permitted and inheritable
266           capability sets. If this option is not used, the capability
267           bounding set is not modified on process execution, hence no limits
268           on the capabilities of the process are enforced. This option may
269           appear more than once, in which case the bounding sets are merged
270           by OR, or by AND if the lines are prefixed with "~" (see below). If
271           the empty string is assigned to this option, the bounding set is
272           reset to the empty capability set, and all prior settings have no
273           effect. If set to "~" (without any further argument), the bounding
274           set is reset to the full set of available capabilities, also
275           undoing any previous settings. This does not affect commands
276           prefixed with "+".
277
278           Example: if a unit has the following,
279
280               CapabilityBoundingSet=CAP_A CAP_B
281               CapabilityBoundingSet=CAP_B CAP_C
282
283           then CAP_A, CAP_B, and CAP_C are set. If the second line is
284           prefixed with "~", e.g.,
285
286               CapabilityBoundingSet=CAP_A CAP_B
287               CapabilityBoundingSet=~CAP_B CAP_C
288
289           then, only CAP_A is set.
290
291       AmbientCapabilities=
292           Controls which capabilities to include in the ambient capability
293           set for the executed process. Takes a whitespace-separated list of
294           capability names, e.g.  CAP_SYS_ADMIN, CAP_DAC_OVERRIDE,
295           CAP_SYS_PTRACE. This option may appear more than once in which case
296           the ambient capability sets are merged (see the above examples in
297           CapabilityBoundingSet=). If the list of capabilities is prefixed
298           with "~", all but the listed capabilities will be included, the
299           effect of the assignment inverted. If the empty string is assigned
300           to this option, the ambient capability set is reset to the empty
301           capability set, and all prior settings have no effect. If set to
302           "~" (without any further argument), the ambient capability set is
303           reset to the full set of available capabilities, also undoing any
304           previous settings. Note that adding capabilities to ambient
305           capability set adds them to the process's inherited capability set.
306
307           Ambient capability sets are useful if you want to execute a process
308           as a non-privileged user but still want to give it some
309           capabilities. Note that in this case option keep-caps is
310           automatically added to SecureBits= to retain the capabilities over
311           the user change.  AmbientCapabilities= does not affect commands
312           prefixed with "+".
313

SECURITY

315       NoNewPrivileges=
316           Takes a boolean argument. If true, ensures that the service process
317           and all its children can never gain new privileges through execve()
318           (e.g. via setuid or setgid bits, or filesystem capabilities). This
319           is the simplest and most effective way to ensure that a process and
320           its children can never elevate privileges again. Defaults to false,
321           but certain settings override this and ignore the value of this
322           setting. This is the case when SystemCallFilter=,
323           SystemCallArchitectures=, RestrictAddressFamilies=,
324           RestrictNamespaces=, PrivateDevices=, ProtectKernelTunables=,
325           ProtectKernelModules=, MemoryDenyWriteExecute=, RestrictRealtime=,
326           or LockPersonality= are specified. Note that even if this setting
327           is overridden by them, systemctl show shows the original value of
328           this setting. Also see No New Privileges Flag[2].
329
330       SecureBits=
331           Controls the secure bits set for the executed process. Takes a
332           space-separated combination of options from the following list:
333           keep-caps, keep-caps-locked, no-setuid-fixup,
334           no-setuid-fixup-locked, noroot, and noroot-locked. This option may
335           appear more than once, in which case the secure bits are ORed. If
336           the empty string is assigned to this option, the bits are reset to
337           0. This does not affect commands prefixed with "+". See
338           capabilities(7) for details.
339

MANDATORY ACCESS CONTROL

341       SELinuxContext=
342           Set the SELinux security context of the executed process. If set,
343           this will override the automated domain transition. However, the
344           policy still needs to authorize the transition. This directive is
345           ignored if SELinux is disabled. If prefixed by "-", all errors will
346           be ignored. This does not affect commands prefixed with "+". See
347           setexeccon(3) for details.
348
349       AppArmorProfile=
350           Takes a profile name as argument. The process executed by the unit
351           will switch to this profile when started. Profiles must already be
352           loaded in the kernel, or the unit will fail. This result in a non
353           operation if AppArmor is not enabled. If prefixed by "-", all
354           errors will be ignored. This does not affect commands prefixed with
355           "+".
356
357       SmackProcessLabel=
358           Takes a SMACK64 security label as argument. The process executed by
359           the unit will be started under this label and SMACK will decide
360           whether the process is allowed to run or not, based on it. The
361           process will continue to run under the label specified here unless
362           the executable has its own SMACK64EXEC label, in which case the
363           process will transition to run under that label. When not
364           specified, the label that systemd is running under is used. This
365           directive is ignored if SMACK is disabled.
366
367           The value may be prefixed by "-", in which case all errors will be
368           ignored. An empty value may be specified to unset previous
369           assignments. This does not affect commands prefixed with "+".
370

PROCESS PROPERTIES

372       LimitCPU=, LimitFSIZE=, LimitDATA=, LimitSTACK=, LimitCORE=, LimitRSS=,
373       LimitNOFILE=, LimitAS=, LimitNPROC=, LimitMEMLOCK=, LimitLOCKS=,
374       LimitSIGPENDING=, LimitMSGQUEUE=, LimitNICE=, LimitRTPRIO=,
375       LimitRTTIME=
376           Set soft and hard limits on various resources for executed
377           processes. See setrlimit(2) for details on the resource limit
378           concept. Resource limits may be specified in two formats: either as
379           single value to set a specific soft and hard limit to the same
380           value, or as colon-separated pair soft:hard to set both limits
381           individually (e.g.  "LimitAS=4G:16G"). Use the string infinity to
382           configure no limit on a specific resource. The multiplicative
383           suffixes K, M, G, T, P and E (to the base 1024) may be used for
384           resource limits measured in bytes (e.g. LimitAS=16G). For the
385           limits referring to time values, the usual time units ms, s, min, h
386           and so on may be used (see systemd.time(7) for details). Note that
387           if no time unit is specified for LimitCPU= the default unit of
388           seconds is implied, while for LimitRTTIME= the default unit of
389           microseconds is implied. Also, note that the effective granularity
390           of the limits might influence their enforcement. For example, time
391           limits specified for LimitCPU= will be rounded up implicitly to
392           multiples of 1s. For LimitNICE= the value may be specified in two
393           syntaxes: if prefixed with "+" or "-", the value is understood as
394           regular Linux nice value in the range -20..19. If not prefixed like
395           this the value is understood as raw resource limit parameter in the
396           range 0..40 (with 0 being equivalent to 1).
397
398           Note that most process resource limits configured with these
399           options are per-process, and processes may fork in order to acquire
400           a new set of resources that are accounted independently of the
401           original process, and may thus escape limits set. Also note that
402           LimitRSS= is not implemented on Linux, and setting it has no
403           effect. Often it is advisable to prefer the resource controls
404           listed in systemd.resource-control(5) over these per-process
405           limits, as they apply to services as a whole, may be altered
406           dynamically at runtime, and are generally more expressive. For
407           example, MemoryLimit= is a more powerful (and working) replacement
408           for LimitRSS=.
409
410           For system units these resource limits may be chosen freely. For
411           user units however (i.e. units run by a per-user instance of
412           systemd(1)), these limits are bound by (possibly more restrictive)
413           per-user limits enforced by the OS.
414
415           Resource limits not configured explicitly for a unit default to the
416           value configured in the various DefaultLimitCPU=,
417           DefaultLimitFSIZE=, ... options available in systemd-
418           system.conf(5), and – if not configured there – the kernel or
419           per-user defaults, as defined by the OS (the latter only for user
420           services, see above).
421
422           Table 1. Resource limit directives, their equivalent ulimit shell
423           commands and the unit used
424           ┌─────────────────┬───────────────────┬─────────────────────┐
425Directive        ulimit equivalent │ Unit                
426           ├─────────────────┼───────────────────┼─────────────────────┤
427           │LimitCPU=        │ ulimit -t         │ Seconds             │
428           ├─────────────────┼───────────────────┼─────────────────────┤
429           │LimitFSIZE=      │ ulimit -f         │ Bytes               │
430           ├─────────────────┼───────────────────┼─────────────────────┤
431           │LimitDATA=       │ ulimit -d         │ Bytes               │
432           ├─────────────────┼───────────────────┼─────────────────────┤
433           │LimitSTACK=      │ ulimit -s         │ Bytes               │
434           ├─────────────────┼───────────────────┼─────────────────────┤
435           │LimitCORE=       │ ulimit -c         │ Bytes               │
436           ├─────────────────┼───────────────────┼─────────────────────┤
437           │LimitRSS=        │ ulimit -m         │ Bytes               │
438           ├─────────────────┼───────────────────┼─────────────────────┤
439           │LimitNOFILE=     │ ulimit -n         │ Number of File      │
440           │                 │                   │ Descriptors         │
441           ├─────────────────┼───────────────────┼─────────────────────┤
442           │LimitAS=         │ ulimit -v         │ Bytes               │
443           ├─────────────────┼───────────────────┼─────────────────────┤
444           │LimitNPROC=      │ ulimit -u         │ Number of Processes │
445           ├─────────────────┼───────────────────┼─────────────────────┤
446           │LimitMEMLOCK=    │ ulimit -l         │ Bytes               │
447           ├─────────────────┼───────────────────┼─────────────────────┤
448           │LimitLOCKS=      │ ulimit -x         │ Number of Locks     │
449           ├─────────────────┼───────────────────┼─────────────────────┤
450           │LimitSIGPENDING= │ ulimit -i         │ Number of Queued    │
451           │                 │                   │ Signals             │
452           ├─────────────────┼───────────────────┼─────────────────────┤
453           │LimitMSGQUEUE=   │ ulimit -q         │ Bytes               │
454           ├─────────────────┼───────────────────┼─────────────────────┤
455           │LimitNICE=       │ ulimit -e         │ Nice Level          │
456           ├─────────────────┼───────────────────┼─────────────────────┤
457           │LimitRTPRIO=     │ ulimit -r         │ Realtime Priority   │
458           ├─────────────────┼───────────────────┼─────────────────────┤
459           │LimitRTTIME=     │ No equivalent     │ Microseconds        │
460           └─────────────────┴───────────────────┴─────────────────────┘
461
462       UMask=
463           Controls the file mode creation mask. Takes an access mode in octal
464           notation. See umask(2) for details. Defaults to 0022.
465
466       KeyringMode=
467           Controls how the kernel session keyring is set up for the service
468           (see session-keyring(7) for details on the session keyring). Takes
469           one of inherit, private, shared. If set to inherit no special
470           keyring setup is done, and the kernel's default behaviour is
471           applied. If private is used a new session keyring is allocated when
472           a service process is invoked, and it is not linked up with any user
473           keyring. This is the recommended setting for system services, as
474           this ensures that multiple services running under the same system
475           user ID (in particular the root user) do not share their key
476           material among each other. If shared is used a new session keyring
477           is allocated as for private, but the user keyring of the user
478           configured with User= is linked into it, so that keys assigned to
479           the user may be requested by the unit's processes. In this modes
480           multiple units running processes under the same user ID may share
481           key material. Unless inherit is selected the unique invocation ID
482           for the unit (see below) is added as a protected key by the name
483           "invocation_id" to the newly created session keyring. Defaults to
484           private for services of the system service manager and to inherit
485           for non-service units and for services of the user service manager.
486
487       OOMScoreAdjust=
488           Sets the adjustment level for the Out-Of-Memory killer for executed
489           processes. Takes an integer between -1000 (to disable OOM killing
490           for this process) and 1000 (to make killing of this process under
491           memory pressure very likely). See proc.txt[3] for details.
492
493       TimerSlackNSec=
494           Sets the timer slack in nanoseconds for the executed processes. The
495           timer slack controls the accuracy of wake-ups triggered by timers.
496           See prctl(2) for more information. Note that in contrast to most
497           other time span definitions this parameter takes an integer value
498           in nano-seconds if no unit is specified. The usual time units are
499           understood too.
500
501       Personality=
502           Controls which kernel architecture uname(2) shall report, when
503           invoked by unit processes. Takes one of the architecture
504           identifiers x86, x86-64, ppc, ppc-le, ppc64, ppc64-le, s390 or
505           s390x. Which personality architectures are supported depends on the
506           system architecture. Usually the 64bit versions of the various
507           system architectures support their immediate 32bit personality
508           architecture counterpart, but no others. For example, x86-64
509           systems support the x86-64 and x86 personalities but no others. The
510           personality feature is useful when running 32-bit services on a
511           64-bit host system. If not specified, the personality is left
512           unmodified and thus reflects the personality of the host system's
513           kernel.
514
515       IgnoreSIGPIPE=
516           Takes a boolean argument. If true, causes SIGPIPE to be ignored in
517           the executed process. Defaults to true because SIGPIPE generally is
518           useful only in shell pipelines.
519

SCHEDULING

521       Nice=
522           Sets the default nice level (scheduling priority) for executed
523           processes. Takes an integer between -20 (highest priority) and 19
524           (lowest priority). See setpriority(2) for details.
525
526       CPUSchedulingPolicy=
527           Sets the CPU scheduling policy for executed processes. Takes one of
528           other, batch, idle, fifo or rr. See sched_setscheduler(2) for
529           details.
530
531       CPUSchedulingPriority=
532           Sets the CPU scheduling priority for executed processes. The
533           available priority range depends on the selected CPU scheduling
534           policy (see above). For real-time scheduling policies an integer
535           between 1 (lowest priority) and 99 (highest priority) can be used.
536           See sched_setscheduler(2) for details.
537
538       CPUSchedulingResetOnFork=
539           Takes a boolean argument. If true, elevated CPU scheduling
540           priorities and policies will be reset when the executed processes
541           fork, and can hence not leak into child processes. See
542           sched_setscheduler(2) for details. Defaults to false.
543
544       CPUAffinity=
545           Controls the CPU affinity of the executed processes. Takes a list
546           of CPU indices or ranges separated by either whitespace or commas.
547           CPU ranges are specified by the lower and upper CPU indices
548           separated by a dash. This option may be specified more than once,
549           in which case the specified CPU affinity masks are merged. If the
550           empty string is assigned, the mask is reset, all assignments prior
551           to this will have no effect. See sched_setaffinity(2) for details.
552
553       IOSchedulingClass=
554           Sets the I/O scheduling class for executed processes. Takes an
555           integer between 0 and 3 or one of the strings none, realtime,
556           best-effort or idle. If the empty string is assigned to this
557           option, all prior assignments to both IOSchedulingClass= and
558           IOSchedulingPriority= have no effect. See ioprio_set(2) for
559           details.
560
561       IOSchedulingPriority=
562           Sets the I/O scheduling priority for executed processes. Takes an
563           integer between 0 (highest priority) and 7 (lowest priority). The
564           available priorities depend on the selected I/O scheduling class
565           (see above). If the empty string is assigned to this option, all
566           prior assignments to both IOSchedulingClass= and
567           IOSchedulingPriority= have no effect. See ioprio_set(2) for
568           details.
569

SANDBOXING

571       ProtectSystem=
572           Takes a boolean argument or the special values "full" or "strict".
573           If true, mounts the /usr and /boot directories read-only for
574           processes invoked by this unit. If set to "full", the /etc
575           directory is mounted read-only, too. If set to "strict" the entire
576           file system hierarchy is mounted read-only, except for the API file
577           system subtrees /dev, /proc and /sys (protect these directories
578           using PrivateDevices=, ProtectKernelTunables=,
579           ProtectControlGroups=). This setting ensures that any modification
580           of the vendor-supplied operating system (and optionally its
581           configuration, and local mounts) is prohibited for the service. It
582           is recommended to enable this setting for all long-running
583           services, unless they are involved with system updates or need to
584           modify the operating system in other ways. If this option is used,
585           ReadWritePaths= may be used to exclude specific directories from
586           being made read-only. This setting is implied if DynamicUser= is
587           set. For this setting the same restrictions regarding mount
588           propagation and privileges apply as for ReadOnlyPaths= and related
589           calls, see below. Defaults to off.
590
591       ProtectHome=
592           Takes a boolean argument or the special values "read-only" or
593           "tmpfs". If true, the directories /home, /root and /run/user are
594           made inaccessible and empty for processes invoked by this unit. If
595           set to "read-only", the three directories are made read-only
596           instead. If set to "tmpfs", temporary file systems are mounted on
597           the three directories in read-only mode. The value "tmpfs" is
598           useful to hide home directories not relevant to the processes
599           invoked by the unit, while necessary directories are still visible
600           by combining with BindPaths= or BindReadOnlyPaths=.
601
602           Setting this to "yes" is mostly equivalent to set the three
603           directories in InaccessiblePaths=. Similarly, "read-only" is mostly
604           equivalent to ReadOnlyPaths=, and "tmpfs" is mostly equivalent to
605           TemporaryFileSystem=.
606
607           It is recommended to enable this setting for all long-running
608           services (in particular network-facing ones), to ensure they cannot
609           get access to private user data, unless the services actually
610           require access to the user's private data. This setting is implied
611           if DynamicUser= is set. For this setting the same restrictions
612           regarding mount propagation and privileges apply as for
613           ReadOnlyPaths= and related calls, see below.
614
615       RuntimeDirectory=, StateDirectory=, CacheDirectory=, LogsDirectory=,
616       ConfigurationDirectory=
617           These options take a whitespace-separated list of directory names.
618           The specified directory names must be relative, and may not include
619           "..". If set, one or more directories by the specified names will
620           be created (including their parents) below the locations defined in
621           the following table, when the unit is started.
622
623           Table 2. Automatic directory creation
624           ┌────────────────────────┬────────────┬──────────────────────┐
625Locations               for system for users            
626           ├────────────────────────┼────────────┼──────────────────────┤
627RuntimeDirectory=       │ /run       │ $XDG_RUNTIME_DIR
628           ├────────────────────────┼────────────┼──────────────────────┤
629StateDirectory=         │ /var/lib   │ $XDG_CONFIG_HOME
630           ├────────────────────────┼────────────┼──────────────────────┤
631CacheDirectory=         │ /var/cache │ $XDG_CACHE_HOME
632           ├────────────────────────┼────────────┼──────────────────────┤
633LogsDirectory=          │ /var/log   │ $XDG_CONFIG_HOME/log │
634           ├────────────────────────┼────────────┼──────────────────────┤
635ConfigurationDirectory= │ /etc       │ $XDG_CONFIG_HOME
636           └────────────────────────┴────────────┴──────────────────────┘
637           In case of RuntimeDirectory= the lowest subdirectories are removed
638           when the unit is stopped. It is possible to preserve the specified
639           directories in this case if RuntimeDirectoryPreserve= is configured
640           to restart or yes (see below). The directories specified with
641           StateDirectory=, CacheDirectory=, LogsDirectory=,
642           ConfigurationDirectory= are not removed when the unit is stopped.
643
644           Except in case of ConfigurationDirectory=, the innermost specified
645           directories will be owned by the user and group specified in User=
646           and Group=. If the specified directories already exist and their
647           owning user or group do not match the configured ones, all files
648           and directories below the specified directories as well as the
649           directories themselves will have their file ownership recursively
650           changed to match what is configured. As an optimization, if the
651           specified directories are already owned by the right user and
652           group, files and directories below of them are left as-is, even if
653           they do not match what is requested. The innermost specified
654           directories will have their access mode adjusted to the what is
655           specified in RuntimeDirectoryMode=, StateDirectoryMode=,
656           CacheDirectoryMode=, LogsDirectoryMode= and
657           ConfigurationDirectoryMode=.
658
659           These options imply BindPaths= for the specified paths. When
660           combined with RootDirectory= or RootImage= these paths always
661           reside on the host and are mounted from there into the unit's file
662           system namespace.
663
664           If DynamicUser= is used in conjunction with StateDirectory=,
665           CacheDirectory= and LogsDirectory= is slightly altered: the
666           directories are created below /var/lib/private, /var/cache/private
667           and /var/log/private, respectively, which are host directories made
668           inaccessible to unprivileged users, which ensures that access to
669           these directories cannot be gained through dynamic user ID
670           recycling. Symbolic links are created to hide this difference in
671           behaviour. Both from perspective of the host and from inside the
672           unit, the relevant directories hence always appear directly below
673           /var/lib, /var/cache and /var/log.
674
675           Use RuntimeDirectory= to manage one or more runtime directories for
676           the unit and bind their lifetime to the daemon runtime. This is
677           particularly useful for unprivileged daemons that cannot create
678           runtime directories in /run due to lack of privileges, and to make
679           sure the runtime directory is cleaned up automatically after use.
680           For runtime directories that require more complex or different
681           configuration or lifetime guarantees, please consider using
682           tmpfiles.d(5).
683
684           Example: if a system service unit has the following,
685
686               RuntimeDirectory=foo/bar baz
687
688           the service manager creates /run/foo (if it does not exist),
689           /run/foo/bar, and /run/baz. The directories /run/foo/bar and
690           /run/baz except /run/foo are owned by the user and group specified
691           in User= and Group=, and removed when the service is stopped.
692
693       RuntimeDirectoryMode=, StateDirectoryMode=, CacheDirectoryMode=,
694       LogsDirectoryMode=, ConfigurationDirectoryMode=
695           Specifies the access mode of the directories specified in
696           RuntimeDirectory=, StateDirectory=, CacheDirectory=,
697           LogsDirectory=, or ConfigurationDirectory=, respectively, as an
698           octal number. Defaults to 0755. See "Permissions" in
699           path_resolution(7) for a discussion of the meaning of permission
700           bits.
701
702       RuntimeDirectoryPreserve=
703           Takes a boolean argument or restart. If set to no (the default),
704           the directories specified in RuntimeDirectory= are always removed
705           when the service stops. If set to restart the directories are
706           preserved when the service is both automatically and manually
707           restarted. Here, the automatic restart means the operation
708           specified in Restart=, and manual restart means the one triggered
709           by systemctl restart foo.service. If set to yes, then the
710           directories are not removed when the service is stopped. Note that
711           since the runtime directory /run is a mount point of "tmpfs", then
712           for system services the directories specified in RuntimeDirectory=
713           are removed when the system is rebooted.
714
715       ReadWritePaths=, ReadOnlyPaths=, InaccessiblePaths=
716           Sets up a new file system namespace for executed processes. These
717           options may be used to limit access a process might have to the
718           file system hierarchy. Each setting takes a space-separated list of
719           paths relative to the host's root directory (i.e. the system
720           running the service manager). Note that if paths contain symlinks,
721           they are resolved relative to the root directory set with
722           RootDirectory=/RootImage=.
723
724           Paths listed in ReadWritePaths= are accessible from within the
725           namespace with the same access modes as from outside of it. Paths
726           listed in ReadOnlyPaths= are accessible for reading only, writing
727           will be refused even if the usual file access controls would permit
728           this. Nest ReadWritePaths= inside of ReadOnlyPaths= in order to
729           provide writable subdirectories within read-only directories. Use
730           ReadWritePaths= in order to whitelist specific paths for write
731           access if ProtectSystem=strict is used.
732
733           Paths listed in InaccessiblePaths= will be made inaccessible for
734           processes inside the namespace along with everything below them in
735           the file system hierarchy. This may be more restrictive than
736           desired, because it is not possible to nest ReadWritePaths=,
737           ReadOnlyPaths=, BindPaths=, or BindReadOnlyPaths= inside it. For a
738           more flexible option, see TemporaryFileSystem=.
739
740           Note that restricting access with these options does not extend to
741           submounts of a directory that are created later on. Non-directory
742           paths may be specified as well. These options may be specified more
743           than once, in which case all paths listed will have limited access
744           from within the namespace. If the empty string is assigned to this
745           option, the specific list is reset, and all prior assignments have
746           no effect.
747
748           Paths in ReadWritePaths=, ReadOnlyPaths= and InaccessiblePaths= may
749           be prefixed with "-", in which case they will be ignored when they
750           do not exist. If prefixed with "+" the paths are taken relative to
751           the root directory of the unit, as configured with
752           RootDirectory=/RootImage=, instead of relative to the root
753           directory of the host (see above). When combining "-" and "+" on
754           the same path make sure to specify "-" first, and "+" second.
755
756           Note that using this setting will disconnect propagation of mounts
757           from the service to the host (propagation in the opposite direction
758           continues to work). This means that this setting may not be used
759           for services which shall be able to install mount points in the
760           main mount namespace. Note that the effect of these settings may be
761           undone by privileged processes. In order to set up an effective
762           sandboxed environment for a unit it is thus recommended to combine
763           these settings with either CapabilityBoundingSet=~CAP_SYS_ADMIN or
764           SystemCallFilter=~@mount.
765
766       TemporaryFileSystem=
767           Takes a space-separated list of mount points for temporary file
768           systems (tmpfs). If set, a new file system namespace is set up for
769           executed processes, and a temporary file system is mounted on each
770           mount point. This option may be specified more than once, in which
771           case temporary file systems are mounted on all listed mount points.
772           If the empty string is assigned to this option, the list is reset,
773           and all prior assignments have no effect. Each mount point may
774           optionally be suffixed with a colon (":") and mount options such as
775           "size=10%" or "ro". By default, each temporary file system is
776           mounted with "nodev,strictatime,mode=0755". These can be disabled
777           by explicitly specifying the corresponding mount options, e.g.,
778           "dev" or "nostrictatime".
779
780           This is useful to hide files or directories not relevant to the
781           processes invoked by the unit, while necessary files or directories
782           can be still accessed by combining with BindPaths= or
783           BindReadOnlyPaths=. See the example below.
784
785           Example: if a unit has the following,
786
787               TemporaryFileSystem=/var:ro
788               BindReadOnlyPaths=/var/lib/systemd
789
790           then the invoked processes by the unit cannot see any files or
791           directories under /var except for /var/lib/systemd or its contents.
792
793       PrivateTmp=
794           Takes a boolean argument. If true, sets up a new file system
795           namespace for the executed processes and mounts private /tmp and
796           /var/tmp directories inside it that is not shared by processes
797           outside of the namespace. This is useful to secure access to
798           temporary files of the process, but makes sharing between processes
799           via /tmp or /var/tmp impossible. If this is enabled, all temporary
800           files created by a service in these directories will be removed
801           after the service is stopped. Defaults to false. It is possible to
802           run two or more units within the same private /tmp and /var/tmp
803           namespace by using the JoinsNamespaceOf= directive, see
804           systemd.unit(5) for details. This setting is implied if
805           DynamicUser= is set. For this setting the same restrictions
806           regarding mount propagation and privileges apply as for
807           ReadOnlyPaths= and related calls, see above. Enabling this setting
808           has the side effect of adding Requires= and After= dependencies on
809           all mount units necessary to access /tmp and /var/tmp. Moreover an
810           implicitly After= ordering on systemd-tmpfiles-setup.service(8) is
811           added.
812
813           Note that the implementation of this setting might be impossible
814           (for example if mount namespaces are not available), and the unit
815           should be written in a way that does not solely rely on this
816           setting for security.
817
818       PrivateDevices=
819           Takes a boolean argument. If true, sets up a new /dev mount for the
820           executed processes and only adds API pseudo devices such as
821           /dev/null, /dev/zero or /dev/random (as well as the pseudo TTY
822           subsystem) to it, but no physical devices such as /dev/sda, system
823           memory /dev/mem, system ports /dev/port and others. This is useful
824           to securely turn off physical device access by the executed
825           process. Defaults to false. Enabling this option will install a
826           system call filter to block low-level I/O system calls that are
827           grouped in the @raw-io set, will also remove CAP_MKNOD and
828           CAP_SYS_RAWIO from the capability bounding set for the unit (see
829           above), and set DevicePolicy=closed (see systemd.resource-
830           control(5) for details). Note that using this setting will
831           disconnect propagation of mounts from the service to the host
832           (propagation in the opposite direction continues to work). This
833           means that this setting may not be used for services which shall be
834           able to install mount points in the main mount namespace. The new
835           /dev will be mounted read-only and 'noexec'. The latter may break
836           old programs which try to set up executable memory by using mmap(2)
837           of /dev/zero instead of using MAP_ANON. For this setting the same
838           restrictions regarding mount propagation and privileges apply as
839           for ReadOnlyPaths= and related calls, see above. If turned on and
840           if running in user mode, or in system mode, but without the
841           CAP_SYS_ADMIN capability (e.g. setting User=), NoNewPrivileges=yes
842           is implied.
843
844           Note that the implementation of this setting might be impossible
845           (for example if mount namespaces are not available), and the unit
846           should be written in a way that does not solely rely on this
847           setting for security.
848
849       PrivateNetwork=
850           Takes a boolean argument. If true, sets up a new network namespace
851           for the executed processes and configures only the loopback network
852           device "lo" inside it. No other network devices will be available
853           to the executed process. This is useful to turn off network access
854           by the executed process. Defaults to false. It is possible to run
855           two or more units within the same private network namespace by
856           using the JoinsNamespaceOf= directive, see systemd.unit(5) for
857           details. Note that this option will disconnect all socket families
858           from the host, this includes AF_NETLINK and AF_UNIX. The latter has
859           the effect that AF_UNIX sockets in the abstract socket namespace
860           will become unavailable to the processes (however, those located in
861           the file system will continue to be accessible).
862
863           Note that the implementation of this setting might be impossible
864           (for example if network namespaces are not available), and the unit
865           should be written in a way that does not solely rely on this
866           setting for security.
867
868       PrivateUsers=
869           Takes a boolean argument. If true, sets up a new user namespace for
870           the executed processes and configures a minimal user and group
871           mapping, that maps the "root" user and group as well as the unit's
872           own user and group to themselves and everything else to the
873           "nobody" user and group. This is useful to securely detach the user
874           and group databases used by the unit from the rest of the system,
875           and thus to create an effective sandbox environment. All files,
876           directories, processes, IPC objects and other resources owned by
877           users/groups not equaling "root" or the unit's own will stay
878           visible from within the unit but appear owned by the "nobody" user
879           and group. If this mode is enabled, all unit processes are run
880           without privileges in the host user namespace (regardless if the
881           unit's own user/group is "root" or not). Specifically this means
882           that the process will have zero process capabilities on the host's
883           user namespace, but full capabilities within the service's user
884           namespace. Settings such as CapabilityBoundingSet= will affect only
885           the latter, and there's no way to acquire additional capabilities
886           in the host's user namespace. Defaults to off.
887
888           This setting is particularly useful in conjunction with
889           RootDirectory=/RootImage=, as the need to synchronize the user and
890           group databases in the root directory and on the host is reduced,
891           as the only users and groups who need to be matched are "root",
892           "nobody" and the unit's own user and group.
893
894           Note that the implementation of this setting might be impossible
895           (for example if user namespaces are not available), and the unit
896           should be written in a way that does not solely rely on this
897           setting for security.
898
899       ProtectKernelTunables=
900           Takes a boolean argument. If true, kernel variables accessible
901           through /proc/sys, /sys, /proc/sysrq-trigger, /proc/latency_stats,
902           /proc/acpi, /proc/timer_stats, /proc/fs and /proc/irq will be made
903           read-only to all processes of the unit. Usually, tunable kernel
904           variables should be initialized only at boot-time, for example with
905           the sysctl.d(5) mechanism. Few services need to write to these at
906           runtime; it is hence recommended to turn this on for most services.
907           For this setting the same restrictions regarding mount propagation
908           and privileges apply as for ReadOnlyPaths= and related calls, see
909           above. Defaults to off. If turned on and if running in user mode,
910           or in system mode, but without the CAP_SYS_ADMIN capability (e.g.
911           services for which User= is set), NoNewPrivileges=yes is implied.
912           Note that this option does not prevent indirect changes to kernel
913           tunables effected by IPC calls to other processes. However,
914           InaccessiblePaths= may be used to make relevant IPC file system
915           objects inaccessible. If ProtectKernelTunables= is set,
916           MountAPIVFS=yes is implied.
917
918       ProtectKernelModules=
919           Takes a boolean argument. If true, explicit module loading will be
920           denied. This allows module load and unload operations to be turned
921           off on modular kernels. It is recommended to turn this on for most
922           services that do not need special file systems or extra kernel
923           modules to work. Defaults to off. Enabling this option removes
924           CAP_SYS_MODULE from the capability bounding set for the unit, and
925           installs a system call filter to block module system calls, also
926           /usr/lib/modules is made inaccessible. For this setting the same
927           restrictions regarding mount propagation and privileges apply as
928           for ReadOnlyPaths= and related calls, see above. Note that limited
929           automatic module loading due to user configuration or kernel
930           mapping tables might still happen as side effect of requested user
931           operations, both privileged and unprivileged. To disable module
932           auto-load feature please see sysctl.d(5) kernel.modules_disabled
933           mechanism and /proc/sys/kernel/modules_disabled documentation. If
934           turned on and if running in user mode, or in system mode, but
935           without the CAP_SYS_ADMIN capability (e.g. setting User=),
936           NoNewPrivileges=yes is implied.
937
938       ProtectControlGroups=
939           Takes a boolean argument. If true, the Linux Control Groups
940           (cgroups(7)) hierarchies accessible through /sys/fs/cgroup will be
941           made read-only to all processes of the unit. Except for container
942           managers no services should require write access to the control
943           groups hierarchies; it is hence recommended to turn this on for
944           most services. For this setting the same restrictions regarding
945           mount propagation and privileges apply as for ReadOnlyPaths= and
946           related calls, see above. Defaults to off. If ProtectControlGroups=
947           is set, MountAPIVFS=yes is implied.
948
949       RestrictAddressFamilies=
950           Restricts the set of socket address families accessible to the
951           processes of this unit. Takes a space-separated list of address
952           family names to whitelist, such as AF_UNIX, AF_INET or AF_INET6.
953           When prefixed with ~ the listed address families will be applied as
954           blacklist, otherwise as whitelist. Note that this restricts access
955           to the socket(2) system call only. Sockets passed into the process
956           by other means (for example, by using socket activation with socket
957           units, see systemd.socket(5)) are unaffected. Also, sockets created
958           with socketpair() (which creates connected AF_UNIX sockets only)
959           are unaffected. Note that this option has no effect on 32-bit x86,
960           s390, s390x, mips, mips-le, ppc, ppc-le, pcc64, ppc64-le and is
961           ignored (but works correctly on other ABIs, including x86-64). Note
962           that on systems supporting multiple ABIs (such as x86/x86-64) it is
963           recommended to turn off alternative ABIs for services, so that they
964           cannot be used to circumvent the restrictions of this option.
965           Specifically, it is recommended to combine this option with
966           SystemCallArchitectures=native or similar. If running in user mode,
967           or in system mode, but without the CAP_SYS_ADMIN capability (e.g.
968           setting User=nobody), NoNewPrivileges=yes is implied. By default,
969           no restrictions apply, all address families are accessible to
970           processes. If assigned the empty string, any previous address
971           familiy restriction changes are undone. This setting does not
972           affect commands prefixed with "+".
973
974           Use this option to limit exposure of processes to remote access, in
975           particular via exotic and sensitive network protocols, such as
976           AF_PACKET. Note that in most cases, the local AF_UNIX address
977           family should be included in the configured whitelist as it is
978           frequently used for local communication, including for syslog(2)
979           logging.
980
981       RestrictNamespaces=
982           Restricts access to Linux namespace functionality for the processes
983           of this unit. For details about Linux namespaces, see
984           namespaces(7). Either takes a boolean argument, or a
985           space-separated list of namespace type identifiers. If false (the
986           default), no restrictions on namespace creation and switching are
987           made. If true, access to any kind of namespacing is prohibited.
988           Otherwise, a space-separated list of namespace type identifiers
989           must be specified, consisting of any combination of: cgroup, ipc,
990           net, mnt, pid, user and uts. Any namespace type listed is made
991           accessible to the unit's processes, access to namespace types not
992           listed is prohibited (whitelisting). By prepending the list with a
993           single tilde character ("~") the effect may be inverted: only the
994           listed namespace types will be made inaccessible, all unlisted ones
995           are permitted (blacklisting). If the empty string is assigned, the
996           default namespace restrictions are applied, which is equivalent to
997           false. This option may appear more than once, in which case the
998           namespace types are merged by OR, or by AND if the lines are
999           prefixed with "~" (see examples below). Internally, this setting
1000           limits access to the unshare(2), clone(2) and setns(2) system
1001           calls, taking the specified flags parameters into account. Note
1002           that — if this option is used — in addition to restricting creation
1003           and switching of the specified types of namespaces (or all of them,
1004           if true) access to the setns() system call with a zero flags
1005           parameter is prohibited. This setting is only supported on x86,
1006           x86-64, mips, mips-le, mips64, mips64-le, mips64-n32,
1007           mips64-le-n32, ppc64, ppc64-le, s390 and s390x, and enforces no
1008           restrictions on other architectures. If running in user mode, or in
1009           system mode, but without the CAP_SYS_ADMIN capability (e.g. setting
1010           User=), NoNewPrivileges=yes is implied.
1011
1012           Example: if a unit has the following,
1013
1014               RestrictNamespaces=cgroup ipc
1015               RestrictNamespaces=cgroup net
1016
1017           then cgroup, ipc, and net are set. If the second line is prefixed
1018           with "~", e.g.,
1019
1020               RestrictNamespaces=cgroup ipc
1021               RestrictNamespaces=~cgroup net
1022
1023           then, only ipc is set.
1024
1025       LockPersonality=
1026           Takes a boolean argument. If set, locks down the personality(2)
1027           system call so that the kernel execution domain may not be changed
1028           from the default or the personality selected with Personality=
1029           directive. This may be useful to improve security, because odd
1030           personality emulations may be poorly tested and source of
1031           vulnerabilities. If running in user mode, or in system mode, but
1032           without the CAP_SYS_ADMIN capability (e.g. setting User=),
1033           NoNewPrivileges=yes is implied.
1034
1035       MemoryDenyWriteExecute=
1036           Takes a boolean argument. If set, attempts to create memory
1037           mappings that are writable and executable at the same time, or to
1038           change existing memory mappings to become executable, or mapping
1039           shared memory segments as executable are prohibited. Specifically,
1040           a system call filter is added that rejects mmap(2) system calls
1041           with both PROT_EXEC and PROT_WRITE set, mprotect(2) or
1042           pkey_mprotect(2) system calls with PROT_EXEC set and shmat(2)
1043           system calls with SHM_EXEC set. Note that this option is
1044           incompatible with programs and libraries that generate program code
1045           dynamically at runtime, including JIT execution engines, executable
1046           stacks, and code "trampoline" feature of various C compilers. This
1047           option improves service security, as it makes harder for software
1048           exploits to change running code dynamically. Note that this feature
1049           is fully available on x86-64, and partially on x86. Specifically,
1050           the shmat() protection is not available on x86. Note that on
1051           systems supporting multiple ABIs (such as x86/x86-64) it is
1052           recommended to turn off alternative ABIs for services, so that they
1053           cannot be used to circumvent the restrictions of this option.
1054           Specifically, it is recommended to combine this option with
1055           SystemCallArchitectures=native or similar. If running in user mode,
1056           or in system mode, but without the CAP_SYS_ADMIN capability (e.g.
1057           setting User=), NoNewPrivileges=yes is implied.
1058
1059       RestrictRealtime=
1060           Takes a boolean argument. If set, any attempts to enable realtime
1061           scheduling in a process of the unit are refused. This restricts
1062           access to realtime task scheduling policies such as SCHED_FIFO,
1063           SCHED_RR or SCHED_DEADLINE. See sched(7) for details about these
1064           scheduling policies. If running in user mode, or in system mode,
1065           but without the CAP_SYS_ADMIN capability (e.g. setting User=),
1066           NoNewPrivileges=yes is implied. Realtime scheduling policies may be
1067           used to monopolize CPU time for longer periods of time, and may
1068           hence be used to lock up or otherwise trigger Denial-of-Service
1069           situations on the system. It is hence recommended to restrict
1070           access to realtime scheduling to the few programs that actually
1071           require them. Defaults to off.
1072
1073       RemoveIPC=
1074           Takes a boolean parameter. If set, all System V and POSIX IPC
1075           objects owned by the user and group the processes of this unit are
1076           run as are removed when the unit is stopped. This setting only has
1077           an effect if at least one of User=, Group= and DynamicUser= are
1078           used. It has no effect on IPC objects owned by the root user.
1079           Specifically, this removes System V semaphores, as well as System V
1080           and POSIX shared memory segments and message queues. If multiple
1081           units use the same user or group the IPC objects are removed when
1082           the last of these units is stopped. This setting is implied if
1083           DynamicUser= is set.
1084
1085       PrivateMounts=
1086           Takes a boolean parameter. If set, the processes of this unit will
1087           be run in their own private file system (mount) namespace with all
1088           mount propagation from the processes towards the host's main file
1089           system namespace turned off. This means any file system mount
1090           points established or removed by the unit's processes will be
1091           private to them and not be visible to the host. However, file
1092           system mount points established or removed on the host will be
1093           propagated to the unit's processes. See mount_namespaces(7) for
1094           details on file system namespaces. Defaults to off.
1095
1096           When turned on, this executes three operations for each invoked
1097           process: a new CLONE_NEWNS namespace is created, after which all
1098           existing mounts are remounted to MS_SLAVE to disable propagation
1099           from the unit's processes to the host (but leaving propagation in
1100           the opposite direction in effect). Finally, the mounts are
1101           remounted again to the propagation mode configured with
1102           MountFlags=, see below.
1103
1104           File system namespaces are set up individually for each process
1105           forked off by the service manager. Mounts established in the
1106           namespace of the process created by ExecStartPre= will hence be
1107           cleaned up automatically as soon as that process exits and will not
1108           be available to subsequent processes forked off for ExecStart= (and
1109           similar applies to the various other commands configured for
1110           units). Similarly, JoinsNamespaceOf= does not permit sharing kernel
1111           mount namespaces between units, it only enables sharing of the
1112           /tmp/ and /var/tmp/ directories.
1113
1114           Other file system namespace unit settings — PrivateMounts=,
1115           PrivateTmp=, PrivateDevices=, ProtectSystem=, ProtectHome=,
1116           ReadOnlyPaths=, InaccessiblePaths=, ReadWritePaths=, ... — also
1117           enable file system namespacing in a fashion equivalent to this
1118           option. Hence it is primarily useful to explicitly request this
1119           behaviour if none of the other settings are used.
1120
1121       MountFlags=
1122           Takes a mount propagation setting: shared, slave or private, which
1123           controls whether file system mount points in the file system
1124           namespaces set up for this unit's processes will receive or
1125           propagate mounts and unmounts from other file system namespaces.
1126           See mount(2) for details on mount propagation, and the three
1127           propagation flags in particular.
1128
1129           This setting only controls the final propagation setting in effect
1130           on all mount points of the file system namespace created for each
1131           process of this unit. Other file system namespacing unit settings
1132           (see the discussion in PrivateMounts= above) will implicitly
1133           disable mount and unmount propagation from the unit's processes
1134           towards the host by changing the propagation setting of all mount
1135           points in the unit's file system namepace to slave first. Setting
1136           this option to shared does not reestablish propagation in that
1137           case.
1138
1139           If not set – but file system namespaces are enabled through another
1140           file system namespace unit setting – shared mount propagation is
1141           used, but — as mentioned — as slave is applied first, propagation
1142           from the unit's processes to the host is still turned off.
1143
1144           It is not recommended to to use private mount propagation for
1145           units, as this means temporary mounts (such as removable media) of
1146           the host will stay mounted and thus indefinitely busy in forked off
1147           processes, as unmount propagation events won't be received by the
1148           file system namespace of the unit.
1149
1150           Usually, it is best to leave this setting unmodified, and use
1151           higher level file system namespacing options instead, in particular
1152           PrivateMounts=, see above.
1153

SYSTEM CALL FILTERING

1155       SystemCallFilter=
1156           Takes a space-separated list of system call names. If this setting
1157           is used, all system calls executed by the unit processes except for
1158           the listed ones will result in immediate process termination with
1159           the SIGSYS signal (whitelisting). If the first character of the
1160           list is "~", the effect is inverted: only the listed system calls
1161           will result in immediate process termination (blacklisting).
1162           Blacklisted system calls and system call groups may optionally be
1163           suffixed with a colon (":") and "errno" error number (between 0 and
1164           4095) or errno name such as EPERM, EACCES or EUCLEAN. This value
1165           will be returned when a blacklisted system call is triggered,
1166           instead of terminating the processes immediately. This value takes
1167           precedence over the one given in SystemCallErrorNumber=. If running
1168           in user mode, or in system mode, but without the CAP_SYS_ADMIN
1169           capability (e.g. setting User=nobody), NoNewPrivileges=yes is
1170           implied. This feature makes use of the Secure Computing Mode 2
1171           interfaces of the kernel ('seccomp filtering') and is useful for
1172           enforcing a minimal sandboxing environment. Note that the execve,
1173           exit, exit_group, getrlimit, rt_sigreturn, sigreturn system calls
1174           and the system calls for querying time and sleeping are implicitly
1175           whitelisted and do not need to be listed explicitly. This option
1176           may be specified more than once, in which case the filter masks are
1177           merged. If the empty string is assigned, the filter is reset, all
1178           prior assignments will have no effect. This does not affect
1179           commands prefixed with "+".
1180
1181           Note that on systems supporting multiple ABIs (such as x86/x86-64)
1182           it is recommended to turn off alternative ABIs for services, so
1183           that they cannot be used to circumvent the restrictions of this
1184           option. Specifically, it is recommended to combine this option with
1185           SystemCallArchitectures=native or similar.
1186
1187           Note that strict system call filters may impact execution and error
1188           handling code paths of the service invocation. Specifically, access
1189           to the execve system call is required for the execution of the
1190           service binary — if it is blocked service invocation will
1191           necessarily fail. Also, if execution of the service binary fails
1192           for some reason (for example: missing service executable), the
1193           error handling logic might require access to an additional set of
1194           system calls in order to process and log this failure correctly. It
1195           might be necessary to temporarily disable system call filters in
1196           order to simplify debugging of such failures.
1197
1198           If you specify both types of this option (i.e. whitelisting and
1199           blacklisting), the first encountered will take precedence and will
1200           dictate the default action (termination or approval of a system
1201           call). Then the next occurrences of this option will add or delete
1202           the listed system calls from the set of the filtered system calls,
1203           depending of its type and the default action. (For example, if you
1204           have started with a whitelisting of read and write, and right after
1205           it add a blacklisting of write, then write will be removed from the
1206           set.)
1207
1208           As the number of possible system calls is large, predefined sets of
1209           system calls are provided. A set starts with "@" character,
1210           followed by name of the set.
1211
1212           Table 3. Currently predefined system call sets
1213           ┌────────────────┬────────────────────────────┐
1214Set             Description                
1215           ├────────────────┼────────────────────────────┤
1216           │@aio            │ Asynchronous I/O           │
1217           │                │ (io_setup(2),              │
1218           │                │ io_submit(2), and related  │
1219           │                │ calls)                     │
1220           ├────────────────┼────────────────────────────┤
1221           │@basic-io       │ System calls for basic     │
1222           │                │ I/O: reading, writing,     │
1223           │                │ seeking, file descriptor   │
1224           │                │ duplication and closing    │
1225           │                │ (read(2), write(2), and    │
1226           │                │ related calls)             │
1227           ├────────────────┼────────────────────────────┤
1228           │@chown          │ Changing file ownership    │
1229           │                │ (chown(2), fchownat(2),    │
1230           │                │ and related calls)         │
1231           ├────────────────┼────────────────────────────┤
1232           │@clock          │ System calls for changing  │
1233           │                │ the system clock           │
1234           │                │ (adjtimex(2),              │
1235           │                │ settimeofday(2), and       │
1236           │                │ related calls)             │
1237           ├────────────────┼────────────────────────────┤
1238           │@cpu-emulation  │ System calls for CPU       │
1239           │                │ emulation functionality    │
1240           │                │ (vm86(2) and related       │
1241           │                │ calls)                     │
1242           ├────────────────┼────────────────────────────┤
1243           │@debug          │ Debugging, performance     │
1244           │                │ monitoring and tracing     │
1245           │                │ functionality (ptrace(2),  │
1246           │                │ perf_event_open(2) and     │
1247           │                │ related calls)             │
1248           ├────────────────┼────────────────────────────┤
1249           │@file-system    │ File system operations:    │
1250           │                │ opening, creating files    │
1251           │                │ and directories for read   │
1252           │                │ and write, renaming and    │
1253           │                │ removing them, reading     │
1254           │                │ file properties, or        │
1255           │                │ creating hard and symbolic │
1256           │                │ links.                     │
1257           ├────────────────┼────────────────────────────┤
1258           │@io-event       │ Event loop system calls    │
1259           │                │ (poll(2), select(2),       │
1260           │                │ epoll(7), eventfd(2) and   │
1261           │                │ related calls)             │
1262           ├────────────────┼────────────────────────────┤
1263           │@ipc            │ Pipes, SysV IPC, POSIX     │
1264           │                │ Message Queues and other   │
1265           │                │ IPC (mq_overview(7),       │
1266           │                │ svipc(7))                  │
1267           ├────────────────┼────────────────────────────┤
1268           │@keyring        │ Kernel keyring access      │
1269           │                │ (keyctl(2) and related     │
1270           │                │ calls)                     │
1271           ├────────────────┼────────────────────────────┤
1272           │@memlock        │ Locking of memory into RAM │
1273           │                │ (mlock(2), mlockall(2) and │
1274           │                │ related calls)             │
1275           ├────────────────┼────────────────────────────┤
1276           │@module         │ Loading and unloading of   │
1277           │                │ kernel modules             │
1278           │                │ (init_module(2),           │
1279           │                │ delete_module(2) and       │
1280           │                │ related calls)             │
1281           ├────────────────┼────────────────────────────┤
1282           │@mount          │ Mounting and unmounting of │
1283           │                │ file systems (mount(2),    │
1284           │                │ chroot(2), and related     │
1285           │                │ calls)                     │
1286           ├────────────────┼────────────────────────────┤
1287           │@network-io     │ Socket I/O (including      │
1288           │                │ local AF_UNIX): socket(7), │
1289           │                │ unix(7)
1290           ├────────────────┼────────────────────────────┤
1291           │@obsolete       │ Unusual, obsolete or       │
1292           │                │ unimplemented              │
1293           │                │ (create_module(2),         │
1294           │                │ gtty(2), ...)              │
1295           ├────────────────┼────────────────────────────┤
1296           │@privileged     │ All system calls which     │
1297           │                │ need super-user            │
1298           │                │ capabilities               │
1299           │                │ (capabilities(7))          │
1300           ├────────────────┼────────────────────────────┤
1301           │@process        │ Process control,           │
1302           │                │ execution, namespaceing    │
1303           │                │ operations (clone(2),      │
1304           │                │ kill(2), namespaces(7),    │
1305           │                │ ...                        │
1306           ├────────────────┼────────────────────────────┤
1307           │@raw-io         │ Raw I/O port access        │
1308           │                │ (ioperm(2), iopl(2),       │
1309           │                │ pciconfig_read(), ...)     │
1310           ├────────────────┼────────────────────────────┤
1311           │@reboot         │ System calls for rebooting │
1312           │                │ and reboot preparation     │
1313           │                │ (reboot(2), kexec(), ...)  │
1314           ├────────────────┼────────────────────────────┤
1315           │@resources      │ System calls for changing  │
1316           │                │ resource limits, memory    │
1317           │                │ and scheduling parameters  │
1318           │                │ (setrlimit(2),             │
1319           │                │ setpriority(2), ...)       │
1320           ├────────────────┼────────────────────────────┤
1321           │@setuid         │ System calls for changing  │
1322           │                │ user ID and group ID       │
1323           │                │ credentials, (setuid(2),   │
1324           │                │ setgid(2), setresuid(2),   │
1325           │                │ ...)                       │
1326           ├────────────────┼────────────────────────────┤
1327           │@signal         │ System calls for           │
1328           │                │ manipulating and handling  │
1329           │                │ process signals            │
1330           │                │ (signal(2),                │
1331           │                │ sigprocmask(2), ...)       │
1332           ├────────────────┼────────────────────────────┤
1333           │@swap           │ System calls for           │
1334           │                │ enabling/disabling swap    │
1335           │                │ devices (swapon(2),        │
1336           │                │ swapoff(2))                │
1337           ├────────────────┼────────────────────────────┤
1338           │@sync           │ Synchronizing files and    │
1339           │                │ memory to disk: (fsync(2), │
1340           │                │ msync(2), and related      │
1341           │                │ calls)                     │
1342           ├────────────────┼────────────────────────────┤
1343           │@system-service │ A reasonable set of system │
1344           │                │ calls used by common       │
1345           │                │ system services, excluding │
1346           │                │ any special purpose calls. │
1347           │                │ This is the recommended    │
1348           │                │ starting point for         │
1349           │                │ whitelisting system calls  │
1350           │                │ for system services, as it │
1351           │                │ contains what is typically │
1352           │                │ needed by system services, │
1353           │                │ but excludes overly        │
1354           │                │ specific interfaces. For   │
1355           │                │ example, the following     │
1356           │                │ APIs are excluded:         │
1357           │                │ "@clock", "@mount",        │
1358           │                │ "@swap", "@reboot".        │
1359           ├────────────────┼────────────────────────────┤
1360           │@timer          │ System calls for           │
1361           │                │ scheduling operations by   │
1362           │                │ time (alarm(2),            │
1363           │                │ timer_create(2), ...)      │
1364           └────────────────┴────────────────────────────┘
1365           Note, that as new system calls are added to the kernel, additional
1366           system calls might be added to the groups above. Contents of the
1367           sets may also change between systemd versions. In addition, the
1368           list of system calls depends on the kernel version and architecture
1369           for which systemd was compiled. Use systemd-analyze syscall-filter
1370           to list the actual list of system calls in each filter.
1371
1372           Generally, whitelisting system calls (rather than blacklisting) is
1373           the safer mode of operation. It is recommended to enforce system
1374           call whitelists for all long-running system services. Specifically,
1375           the following lines are a relatively safe basic choice for the
1376           majority of system services:
1377
1378               [Service]
1379               SystemCallFilter=@system-service
1380               SystemCallErrorNumber=EPERM
1381
1382           It is recommended to combine the file system namespacing related
1383           options with SystemCallFilter=~@mount, in order to prohibit the
1384           unit's processes to undo the mappings. Specifically these are the
1385           options PrivateTmp=, PrivateDevices=, ProtectSystem=, ProtectHome=,
1386           ProtectKernelTunables=, ProtectControlGroups=, ReadOnlyPaths=,
1387           InaccessiblePaths= and ReadWritePaths=.
1388
1389       SystemCallErrorNumber=
1390           Takes an "errno" error number (between 1 and 4095) or errno name
1391           such as EPERM, EACCES or EUCLEAN, to return when the system call
1392           filter configured with SystemCallFilter= is triggered, instead of
1393           terminating the process immediately. When this setting is not used,
1394           or when the empty string is assigned, the process will be
1395           terminated immediately when the filter is triggered.
1396
1397       SystemCallArchitectures=
1398           Takes a space-separated list of architecture identifiers to include
1399           in the system call filter. The known architecture identifiers are
1400           the same as for ConditionArchitecture= described in
1401           systemd.unit(5), as well as x32, mips64-n32, mips64-le-n32, and the
1402           special identifier native. The special identifier native implicitly
1403           maps to the native architecture of the system (or more precisely:
1404           to the architecture the system manager is compiled for). If running
1405           in user mode, or in system mode, but without the CAP_SYS_ADMIN
1406           capability (e.g. setting User=nobody), NoNewPrivileges=yes is
1407           implied. By default, this option is set to the empty list, i.e. no
1408           system call architecture filtering is applied.
1409
1410           If this setting is used, processes of this unit will only be
1411           permitted to call native system calls, and system calls of the
1412           specified architectures. For the purposes of this option, the x32
1413           architecture is treated as including x86-64 system calls. However,
1414           this setting still fulfills its purpose, as explained below, on
1415           x32.
1416
1417           System call filtering is not equally effective on all
1418           architectures. For example, on x86 filtering of network
1419           socket-related calls is not possible, due to ABI limitations — a
1420           limitation that x86-64 does not have, however. On systems
1421           supporting multiple ABIs at the same time — such as x86/x86-64 — it
1422           is hence recommended to limit the set of permitted system call
1423           architectures so that secondary ABIs may not be used to circumvent
1424           the restrictions applied to the native ABI of the system. In
1425           particular, setting SystemCallArchitectures=native is a good choice
1426           for disabling non-native ABIs.
1427
1428           System call architectures may also be restricted system-wide via
1429           the SystemCallArchitectures= option in the global configuration.
1430           See systemd-system.conf(5) for details.
1431

ENVIRONMENT

1433       Environment=
1434           Sets environment variables for executed processes. Takes a
1435           space-separated list of variable assignments. This option may be
1436           specified more than once, in which case all listed variables will
1437           be set. If the same variable is set twice, the later setting will
1438           override the earlier setting. If the empty string is assigned to
1439           this option, the list of environment variables is reset, all prior
1440           assignments have no effect. Variable expansion is not performed
1441           inside the strings, however, specifier expansion is possible. The $
1442           character has no special meaning. If you need to assign a value
1443           containing spaces or the equals sign to a variable, use double
1444           quotes (") for the assignment.
1445
1446           Example:
1447
1448               Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6"
1449
1450           gives three variables "VAR1", "VAR2", "VAR3" with the values "word1
1451           word2", "word3", "$word 5 6".
1452
1453           See environ(7) for details about environment variables.
1454
1455       EnvironmentFile=
1456           Similar to Environment= but reads the environment variables from a
1457           text file. The text file should contain new-line-separated variable
1458           assignments. Empty lines, lines without an "=" separator, or lines
1459           starting with ; or # will be ignored, which may be used for
1460           commenting. A line ending with a backslash will be concatenated
1461           with the following one, allowing multiline variable definitions.
1462           The parser strips leading and trailing whitespace from the values
1463           of assignments, unless you use double quotes (").
1464
1465           The argument passed should be an absolute filename or wildcard
1466           expression, optionally prefixed with "-", which indicates that if
1467           the file does not exist, it will not be read and no error or
1468           warning message is logged. This option may be specified more than
1469           once in which case all specified files are read. If the empty
1470           string is assigned to this option, the list of file to read is
1471           reset, all prior assignments have no effect.
1472
1473           The files listed with this directive will be read shortly before
1474           the process is executed (more specifically, after all processes
1475           from a previous unit state terminated. This means you can generate
1476           these files in one unit state, and read it with this option in the
1477           next).
1478
1479           Settings from these files override settings made with Environment=.
1480           If the same variable is set twice from these files, the files will
1481           be read in the order they are specified and the later setting will
1482           override the earlier setting.
1483
1484       PassEnvironment=
1485           Pass environment variables set for the system service manager to
1486           executed processes. Takes a space-separated list of variable names.
1487           This option may be specified more than once, in which case all
1488           listed variables will be passed. If the empty string is assigned to
1489           this option, the list of environment variables to pass is reset,
1490           all prior assignments have no effect. Variables specified that are
1491           not set for the system manager will not be passed and will be
1492           silently ignored. Note that this option is only relevant for the
1493           system service manager, as system services by default do not
1494           automatically inherit any environment variables set for the service
1495           manager itself. However, in case of the user service manager all
1496           environment variables are passed to the executed processes anyway,
1497           hence this option is without effect for the user service manager.
1498
1499           Variables set for invoked processes due to this setting are subject
1500           to being overridden by those configured with Environment= or
1501           EnvironmentFile=.
1502
1503           Example:
1504
1505               PassEnvironment=VAR1 VAR2 VAR3
1506
1507           passes three variables "VAR1", "VAR2", "VAR3" with the values set
1508           for those variables in PID1.
1509
1510           See environ(7) for details about environment variables.
1511
1512       UnsetEnvironment=
1513           Explicitly unset environment variable assignments that would
1514           normally be passed from the service manager to invoked processes of
1515           this unit. Takes a space-separated list of variable names or
1516           variable assignments. This option may be specified more than once,
1517           in which case all listed variables/assignments will be unset. If
1518           the empty string is assigned to this option, the list of
1519           environment variables/assignments to unset is reset. If a variable
1520           assignment is specified (that is: a variable name, followed by "=",
1521           followed by its value), then any environment variable matching this
1522           precise assignment is removed. If a variable name is specified
1523           (that is a variable name without any following "=" or value), then
1524           any assignment matching the variable name, regardless of its value
1525           is removed. Note that the effect of UnsetEnvironment= is applied as
1526           final step when the environment list passed to executed processes
1527           is compiled. That means it may undo assignments from any
1528           configuration source, including assignments made through
1529           Environment= or EnvironmentFile=, inherited from the system
1530           manager's global set of environment variables, inherited via
1531           PassEnvironment=, set by the service manager itself (such as
1532           $NOTIFY_SOCKET and such), or set by a PAM module (in case PAMName=
1533           is used).
1534
1535           See environ(7) for details about environment variables.
1536

LOGGING AND STANDARD INPUT/OUTPUT

1538       StandardInput=
1539           Controls where file descriptor 0 (STDIN) of the executed processes
1540           is connected to. Takes one of null, tty, tty-force, tty-fail, data,
1541           file:path, socket or fd:name.
1542
1543           If null is selected, standard input will be connected to /dev/null,
1544           i.e. all read attempts by the process will result in immediate EOF.
1545
1546           If tty is selected, standard input is connected to a TTY (as
1547           configured by TTYPath=, see below) and the executed process becomes
1548           the controlling process of the terminal. If the terminal is already
1549           being controlled by another process, the executed process waits
1550           until the current controlling process releases the terminal.
1551
1552           tty-force is similar to tty, but the executed process is forcefully
1553           and immediately made the controlling process of the terminal,
1554           potentially removing previous controlling processes from the
1555           terminal.
1556
1557           tty-fail is similar to tty, but if the terminal already has a
1558           controlling process start-up of the executed process fails.
1559
1560           The data option may be used to configure arbitrary textual or
1561           binary data to pass via standard input to the executed process. The
1562           data to pass is configured via
1563           StandardInputText=/StandardInputData= (see below). Note that the
1564           actual file descriptor type passed (memory file, regular file, UNIX
1565           pipe, ...) might depend on the kernel and available privileges. In
1566           any case, the file descriptor is read-only, and when read returns
1567           the specified data followed by EOF.
1568
1569           The file:path option may be used to connect a specific file system
1570           object to standard input. An absolute path following the ":"
1571           character is expected, which may refer to a regular file, a FIFO or
1572           special file. If an AF_UNIX socket in the file system is specified,
1573           a stream socket is connected to it. The latter is useful for
1574           connecting standard input of processes to arbitrary system
1575           services.
1576
1577           The socket option is valid in socket-activated services only, and
1578           requires the relevant socket unit file (see systemd.socket(5) for
1579           details) to have Accept=yes set, or to specify a single socket
1580           only. If this option is set, standard input will be connected to
1581           the socket the service was activated from, which is primarily
1582           useful for compatibility with daemons designed for use with the
1583           traditional inetd(8) socket activation daemon.
1584
1585           The fd:name option connects standard input to a specific, named
1586           file descriptor provided by a socket unit. The name may be
1587           specified as part of this option, following a ":" character (e.g.
1588           "fd:foobar"). If no name is specified, the name "stdin" is implied
1589           (i.e.  "fd" is equivalent to "fd:stdin"). At least one socket unit
1590           defining the specified name must be provided via the Sockets=
1591           option, and the file descriptor name may differ from the name of
1592           its containing socket unit. If multiple matches are found, the
1593           first one will be used. See FileDescriptorName= in
1594           systemd.socket(5) for more details about named file descriptors and
1595           their ordering.
1596
1597           This setting defaults to null.
1598
1599       StandardOutput=
1600           Controls where file descriptor 1 (STDOUT) of the executed processes
1601           is connected to. Takes one of inherit, null, tty, journal, syslog,
1602           kmsg, journal+console, syslog+console, kmsg+console, file:path,
1603           socket or fd:name.
1604
1605           inherit duplicates the file descriptor of standard input for
1606           standard output.
1607
1608           null connects standard output to /dev/null, i.e. everything written
1609           to it will be lost.
1610
1611           tty connects standard output to a tty (as configured via TTYPath=,
1612           see below). If the TTY is used for output only, the executed
1613           process will not become the controlling process of the terminal,
1614           and will not fail or wait for other processes to release the
1615           terminal.
1616
1617           journal connects standard output with the journal which is
1618           accessible via journalctl(1). Note that everything that is written
1619           to syslog or kmsg (see below) is implicitly stored in the journal
1620           as well, the specific two options listed below are hence supersets
1621           of this one.
1622
1623           syslog connects standard output to the syslog(3) system syslog
1624           service, in addition to the journal. Note that the journal daemon
1625           is usually configured to forward everything it receives to syslog
1626           anyway, in which case this option is no different from journal.
1627
1628           kmsg connects standard output with the kernel log buffer which is
1629           accessible via dmesg(1), in addition to the journal. The journal
1630           daemon might be configured to send all logs to kmsg anyway, in
1631           which case this option is no different from journal.
1632
1633           journal+console, syslog+console and kmsg+console work in a similar
1634           way as the three options above but copy the output to the system
1635           console as well.
1636
1637           The file:path option may be used to connect a specific file system
1638           object to standard output. The semantics are similar to the same
1639           option of StandardInput=, see above. If standard input and output
1640           are directed to the same file path, it is opened only once, for
1641           reading as well as writing and duplicated. This is particular
1642           useful when the specified path refers to an AF_UNIX socket in the
1643           file system, as in that case only a single stream connection is
1644           created for both input and output.
1645
1646           socket connects standard output to a socket acquired via socket
1647           activation. The semantics are similar to the same option of
1648           StandardInput=, see above.
1649
1650           The fd:name option connects standard output to a specific, named
1651           file descriptor provided by a socket unit. A name may be specified
1652           as part of this option, following a ":" character (e.g.
1653           "fd:foobar"). If no name is specified, the name "stdout" is implied
1654           (i.e.  "fd" is equivalent to "fd:stdout"). At least one socket unit
1655           defining the specified name must be provided via the Sockets=
1656           option, and the file descriptor name may differ from the name of
1657           its containing socket unit. If multiple matches are found, the
1658           first one will be used. See FileDescriptorName= in
1659           systemd.socket(5) for more details about named descriptors and
1660           their ordering.
1661
1662           If the standard output (or error output, see below) of a unit is
1663           connected to the journal, syslog or the kernel log buffer, the unit
1664           will implicitly gain a dependency of type After= on
1665           systemd-journald.socket (also see the "Implicit Dependencies"
1666           section above). Also note that in this case stdout (or stderr, see
1667           below) will be an AF_UNIX stream socket, and not a pipe or FIFO
1668           that can be re-opened. This means when executing shell scripts the
1669           construct echo "hello" > /dev/stderr for writing text to stderr
1670           will not work. To mitigate this use the construct echo "hello" >&2
1671           instead, which is mostly equivalent and avoids this pitfall.
1672
1673           This setting defaults to the value set with DefaultStandardOutput=
1674           in systemd-system.conf(5), which defaults to journal. Note that
1675           setting this parameter might result in additional dependencies to
1676           be added to the unit (see above).
1677
1678       StandardError=
1679           Controls where file descriptor 2 (STDERR) of the executed processes
1680           is connected to. The available options are identical to those of
1681           StandardOutput=, with some exceptions: if set to inherit the file
1682           descriptor used for standard output is duplicated for standard
1683           error, while fd:name will use a default file descriptor name of
1684           "stderr".
1685
1686           This setting defaults to the value set with DefaultStandardError=
1687           in systemd-system.conf(5), which defaults to inherit. Note that
1688           setting this parameter might result in additional dependencies to
1689           be added to the unit (see above).
1690
1691       StandardInputText=, StandardInputData=
1692           Configures arbitrary textual or binary data to pass via file
1693           descriptor 0 (STDIN) to the executed processes. These settings have
1694           no effect unless StandardInput= is set to data. Use this option to
1695           embed process input data directly in the unit file.
1696
1697           StandardInputText= accepts arbitrary textual data. C-style escapes
1698           for special characters as well as the usual "%"-specifiers are
1699           resolved. Each time this setting is used the specified text is
1700           appended to the per-unit data buffer, followed by a newline
1701           character (thus every use appends a new line to the end of the
1702           buffer). Note that leading and trailing whitespace of lines
1703           configured with this option is removed. If an empty line is
1704           specified the buffer is cleared (hence, in order to insert an empty
1705           line, add an additional "\n" to the end or beginning of a line).
1706
1707           StandardInputData= accepts arbitrary binary data, encoded in
1708           Base64[4]. No escape sequences or specifiers are resolved. Any
1709           whitespace in the encoded version is ignored during decoding.
1710
1711           Note that StandardInputText= and StandardInputData= operate on the
1712           same data buffer, and may be mixed in order to configure both
1713           binary and textual data for the same input stream. The textual or
1714           binary data is joined strictly in the order the settings appear in
1715           the unit file. Assigning an empty string to either will reset the
1716           data buffer.
1717
1718           Please keep in mind that in order to maintain readability long unit
1719           file settings may be split into multiple lines, by suffixing each
1720           line (except for the last) with a "\" character (see
1721           systemd.unit(5) for details). This is particularly useful for large
1722           data configured with these two options. Example:
1723
1724               ...
1725               StandardInput=data
1726               StandardInputData=SWNrIHNpdHplIGRhIHVuJyBlc3NlIEtsb3BzLAp1ZmYgZWVtYWwga2xvcHAncy4KSWNrIGtpZWtl \
1727                                 LCBzdGF1bmUsIHd1bmRyZSBtaXIsCnVmZiBlZW1hbCBqZWh0IHNlIHVmZiBkaWUgVMO8ci4KTmFu \
1728                                 dSwgZGVuayBpY2ssIGljayBkZW5rIG5hbnUhCkpldHogaXNzZSB1ZmYsIGVyc2NodCB3YXIgc2Ug \
1729                                 enUhCkljayBqZWhlIHJhdXMgdW5kIGJsaWNrZSDigJQKdW5kIHdlciBzdGVodCBkcmF1w59lbj8g \
1730                                 SWNrZSEK
1731               ...
1732
1733       LogLevelMax=
1734           Configures filtering by log level of log messages generated by this
1735           unit. Takes a syslog log level, one of emerg (lowest log level,
1736           only highest priority messages), alert, crit, err, warning, notice,
1737           info, debug (highest log level, also lowest priority messages). See
1738           syslog(3) for details. By default no filtering is applied (i.e. the
1739           default maximum log level is debug). Use this option to configure
1740           the logging system to drop log messages of a specific service above
1741           the specified level. For example, set LogLevelMax=info in order to
1742           turn off debug logging of a particularly chatty unit. Note that the
1743           configured level is applied to any log messages written by any of
1744           the processes belonging to this unit, sent via any supported
1745           logging protocol. The filtering is applied early in the logging
1746           pipeline, before any kind of further processing is done. Moreover,
1747           messages which pass through this filter successfully might still be
1748           dropped by filters applied at a later stage in the logging
1749           subsystem. For example, MaxLevelStore= configured in
1750           journald.conf(5) might prohibit messages of higher log levels to be
1751           stored on disk, even though the per-unit LogLevelMax= permitted it
1752           to be processed.
1753
1754       LogExtraFields=
1755           Configures additional log metadata fields to include in all log
1756           records generated by processes associated with this unit. This
1757           setting takes one or more journal field assignments in the format
1758           "FIELD=VALUE" separated by whitespace. See systemd.journal-
1759           fields(7) for details on the journal field concept. Even though the
1760           underlying journal implementation permits binary field values, this
1761           setting accepts only valid UTF-8 values. To include space
1762           characters in a journal field value, enclose the assignment in
1763           double quotes ("). The usual specifiers are expanded in all
1764           assignments (see below). Note that this setting is not only useful
1765           for attaching additional metadata to log records of a unit, but
1766           given that all fields and values are indexed may also be used to
1767           implement cross-unit log record matching. Assign an empty string to
1768           reset the list.
1769
1770       SyslogIdentifier=
1771           Sets the process name ("syslog tag") to prefix log lines sent to
1772           the logging system or the kernel log buffer with. If not set,
1773           defaults to the process name of the executed process. This option
1774           is only useful when StandardOutput= or StandardError= are set to
1775           journal, syslog or kmsg (or to the same settings in combination
1776           with +console) and only applies to log messages written to stdout
1777           or stderr.
1778
1779       SyslogFacility=
1780           Sets the syslog facility identifier to use when logging. One of
1781           kern, user, mail, daemon, auth, syslog, lpr, news, uucp, cron,
1782           authpriv, ftp, local0, local1, local2, local3, local4, local5,
1783           local6 or local7. See syslog(3) for details. This option is only
1784           useful when StandardOutput= or StandardError= are set to journal,
1785           syslog or kmsg (or to the same settings in combination with
1786           +console), and only applies to log messages written to stdout or
1787           stderr. Defaults to daemon.
1788
1789       SyslogLevel=
1790           The default syslog log level to use when logging to the logging
1791           system or the kernel log buffer. One of emerg, alert, crit, err,
1792           warning, notice, info, debug. See syslog(3) for details. This
1793           option is only useful when StandardOutput= or StandardError= are
1794           set to journal, syslog or kmsg (or to the same settings in
1795           combination with +console), and only applies to log messages
1796           written to stdout or stderr. Note that individual lines output by
1797           executed processes may be prefixed with a different log level which
1798           can be used to override the default log level specified here. The
1799           interpretation of these prefixes may be disabled with
1800           SyslogLevelPrefix=, see below. For details, see sd-daemon(3).
1801           Defaults to info.
1802
1803       SyslogLevelPrefix=
1804           Takes a boolean argument. If true and StandardOutput= or
1805           StandardError= are set to journal, syslog or kmsg (or to the same
1806           settings in combination with +console), log lines written by the
1807           executed process that are prefixed with a log level will be
1808           processed with this log level set but the prefix removed. If set to
1809           false, the interpretation of these prefixes is disabled and the
1810           logged lines are passed on as-is. This only applies to log messages
1811           written to stdout or stderr. For details about this prefixing see
1812           sd-daemon(3). Defaults to true.
1813
1814       TTYPath=
1815           Sets the terminal device node to use if standard input, output, or
1816           error are connected to a TTY (see above). Defaults to /dev/console.
1817
1818       TTYReset=
1819           Reset the terminal device specified with TTYPath= before and after
1820           execution. Defaults to "no".
1821
1822       TTYVHangup=
1823           Disconnect all clients which have opened the terminal device
1824           specified with TTYPath= before and after execution. Defaults to
1825           "no".
1826
1827       TTYVTDisallocate=
1828           If the terminal device specified with TTYPath= is a virtual console
1829           terminal, try to deallocate the TTY before and after execution.
1830           This ensures that the screen and scrollback buffer is cleared.
1831           Defaults to "no".
1832

SYSTEM V COMPATIBILITY

1834       UtmpIdentifier=
1835           Takes a four character identifier string for an utmp(5) and wtmp
1836           entry for this service. This should only be set for services such
1837           as getty implementations (such as agetty(8)) where utmp/wtmp
1838           entries must be created and cleared before and after execution, or
1839           for services that shall be executed as if they were run by a getty
1840           process (see below). If the configured string is longer than four
1841           characters, it is truncated and the terminal four characters are
1842           used. This setting interprets %I style string replacements. This
1843           setting is unset by default, i.e. no utmp/wtmp entries are created
1844           or cleaned up for this service.
1845
1846       UtmpMode=
1847           Takes one of "init", "login" or "user". If UtmpIdentifier= is set,
1848           controls which type of utmp(5)/wtmp entries for this service are
1849           generated. This setting has no effect unless UtmpIdentifier= is set
1850           too. If "init" is set, only an INIT_PROCESS entry is generated and
1851           the invoked process must implement a getty-compatible utmp/wtmp
1852           logic. If "login" is set, first an INIT_PROCESS entry, followed by
1853           a LOGIN_PROCESS entry is generated. In this case, the invoked
1854           process must implement a login(1)-compatible utmp/wtmp logic. If
1855           "user" is set, first an INIT_PROCESS entry, then a LOGIN_PROCESS
1856           entry and finally a USER_PROCESS entry is generated. In this case,
1857           the invoked process may be any process that is suitable to be run
1858           as session leader. Defaults to "init".
1859

ENVIRONMENT VARIABLES IN SPAWNED PROCESSES

1861       Processes started by the service manager are executed with an
1862       environment variable block assembled from multiple sources. Processes
1863       started by the system service manager generally do not inherit
1864       environment variables set for the service manager itself (but this may
1865       be altered via PassEnvironment=), but processes started by the user
1866       service manager instances generally do inherit all environment
1867       variables set for the service manager itself.
1868
1869       For each invoked process the list of environment variables set is
1870       compiled from the following sources:
1871
1872       ·   Variables globally configured for the service manager, using the
1873           DefaultEnvironment= setting in systemd-system.conf(5), the kernel
1874           command line option systemd.setenv= (see systemd(1)) or via
1875           systemctl set-environment (see systemctl(1)).
1876
1877       ·   Variables defined by the service manager itself (see the list
1878           below)
1879
1880       ·   Variables set in the service manager's own environment variable
1881           block (subject to PassEnvironment= for the system service manager)
1882
1883       ·   Variables set via Environment= in the unit file
1884
1885       ·   Variables read from files specified via EnvironmentFile= in the
1886           unit file
1887
1888       ·   Variables set by any PAM modules in case PAMName= is in effect,
1889           cf. pam_env(8)
1890
1891       If the same environment variables are set by multiple of these sources,
1892       the later source — according to the order of the list above — wins.
1893       Note that as final step all variables listed in UnsetEnvironment= are
1894       removed again from the compiled environment variable list, immediately
1895       before it is passed to the executed process.
1896
1897       The following select environment variables are set or propagated by the
1898       service manager for each invoked process:
1899
1900       $PATH
1901           Colon-separated list of directories to use when launching
1902           executables. systemd uses a fixed value of
1903           /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin.
1904
1905       $LANG
1906           Locale. Can be set in locale.conf(5) or on the kernel command line
1907           (see systemd(1) and kernel-command-line(7)).
1908
1909       $USER, $LOGNAME, $HOME, $SHELL
1910           User name (twice), home directory, and the login shell. The
1911           variables are set for the units that have User= set, which includes
1912           user systemd instances. See passwd(5).
1913
1914       $INVOCATION_ID
1915           Contains a randomized, unique 128bit ID identifying each runtime
1916           cycle of the unit, formatted as 32 character hexadecimal string. A
1917           new ID is assigned each time the unit changes from an inactive
1918           state into an activating or active state, and may be used to
1919           identify this specific runtime cycle, in particular in data stored
1920           offline, such as the journal. The same ID is passed to all
1921           processes run as part of the unit.
1922
1923       $XDG_RUNTIME_DIR
1924           The directory to use for runtime objects (such as IPC objects) and
1925           volatile state. Set for all services run by the user systemd
1926           instance, as well as any system services that use PAMName= with a
1927           PAM stack that includes pam_systemd. See below and pam_systemd(8)
1928           for more information.
1929
1930       $MAINPID
1931           The PID of the unit's main process if it is known. This is only set
1932           for control processes as invoked by ExecReload= and similar.
1933
1934       $MANAGERPID
1935           The PID of the user systemd instance, set for processes spawned by
1936           it.
1937
1938       $LISTEN_FDS, $LISTEN_PID, $LISTEN_FDNAMES
1939           Information about file descriptors passed to a service for socket
1940           activation. See sd_listen_fds(3).
1941
1942       $NOTIFY_SOCKET
1943           The socket sd_notify() talks to. See sd_notify(3).
1944
1945       $WATCHDOG_PID, $WATCHDOG_USEC
1946           Information about watchdog keep-alive notifications. See
1947           sd_watchdog_enabled(3).
1948
1949       $TERM
1950           Terminal type, set only for units connected to a terminal
1951           (StandardInput=tty, StandardOutput=tty, or StandardError=tty). See
1952           termcap(5).
1953
1954       $JOURNAL_STREAM
1955           If the standard output or standard error output of the executed
1956           processes are connected to the journal (for example, by setting
1957           StandardError=journal) $JOURNAL_STREAM contains the device and
1958           inode numbers of the connection file descriptor, formatted in
1959           decimal, separated by a colon (":"). This permits invoked processes
1960           to safely detect whether their standard output or standard error
1961           output are connected to the journal. The device and inode numbers
1962           of the file descriptors should be compared with the values set in
1963           the environment variable to determine whether the process output is
1964           still connected to the journal. Note that it is generally not
1965           sufficient to only check whether $JOURNAL_STREAM is set at all as
1966           services might invoke external processes replacing their standard
1967           output or standard error output, without unsetting the environment
1968           variable.
1969
1970           If both standard output and standard error of the executed
1971           processes are connected to the journal via a stream socket, this
1972           environment variable will contain information about the standard
1973           error stream, as that's usually the preferred destination for log
1974           data. (Note that typically the same stream is used for both
1975           standard output and standard error, hence very likely the
1976           environment variable contains device and inode information matching
1977           both stream file descriptors.)
1978
1979           This environment variable is primarily useful to allow services to
1980           optionally upgrade their used log protocol to the native journal
1981           protocol (using sd_journal_print(3) and other functions) if their
1982           standard output or standard error output is connected to the
1983           journal anyway, thus enabling delivery of structured metadata along
1984           with logged messages.
1985
1986       $SERVICE_RESULT
1987           Only defined for the service unit type, this environment variable
1988           is passed to all ExecStop= and ExecStopPost= processes, and encodes
1989           the service "result". Currently, the following values are defined:
1990
1991           Table 4. Defined $SERVICE_RESULT values
1992           ┌──────────────────┬────────────────────────────┐
1993Value             Meaning                    
1994           ├──────────────────┼────────────────────────────┤
1995           │"success"         │ The service ran            │
1996           │                  │ successfully and exited    │
1997           │                  │ cleanly.                   │
1998           ├──────────────────┼────────────────────────────┤
1999           │"protocol"        │ A protocol violation       │
2000           │                  │ occurred: the service did  │
2001           │                  │ not take the steps         │
2002           │                  │ required by its unit       │
2003           │                  │ configuration              │
2004           │                  │ (specifically what is      │
2005           │                  │ configured in its Type=
2006           │                  │ setting).                  │
2007           ├──────────────────┼────────────────────────────┤
2008           │"timeout"         │ One of the steps timed     │
2009           │                  │ out.                       │
2010           ├──────────────────┼────────────────────────────┤
2011           │"exit-code"       │ Service process exited     │
2012           │                  │ with a non-zero exit code; │
2013           │                  │ see $EXIT_CODE below for   │
2014           │                  │ the actual exit code       │
2015           │                  │ returned.                  │
2016           ├──────────────────┼────────────────────────────┤
2017           │"signal"          │ A service process was      │
2018           │                  │ terminated abnormally by a │
2019           │                  │ signal, without dumping    │
2020           │                  │ core. See $EXIT_CODE below │
2021           │                  │ for the actual signal      │
2022           │                  │ causing the termination.   │
2023           ├──────────────────┼────────────────────────────┤
2024           │"core-dump"       │ A service process          │
2025           │                  │ terminated abnormally with │
2026           │                  │ a signal and dumped core.  │
2027           │                  │ See $EXIT_CODE below for   │
2028           │                  │ the signal causing the     │
2029           │                  │ termination.               │
2030           ├──────────────────┼────────────────────────────┤
2031           │"watchdog"        │ Watchdog keep-alive ping   │
2032           │                  │ was enabled for the        │
2033           │                  │ service, but the deadline  │
2034           │                  │ was missed.                │
2035           ├──────────────────┼────────────────────────────┤
2036           │"start-limit-hit" │ A start limit was defined  │
2037           │                  │ for the unit and it was    │
2038           │                  │ hit, causing the unit to   │
2039           │                  │ fail to start. See         │
2040           │                  │ systemd.unit(5)'s          │
2041           │                  │ StartLimitIntervalSec= and │
2042           │                  │ StartLimitBurst= for       │
2043           │                  │ details.                   │
2044           ├──────────────────┼────────────────────────────┤
2045           │"resources"       │ A catch-all condition in   │
2046           │                  │ case a system operation    │
2047           │                  │ failed.                    │
2048           └──────────────────┴────────────────────────────┘
2049           This environment variable is useful to monitor failure or
2050           successful termination of a service. Even though this variable is
2051           available in both ExecStop= and ExecStopPost=, it is usually a
2052           better choice to place monitoring tools in the latter, as the
2053           former is only invoked for services that managed to start up
2054           correctly, and the latter covers both services that failed during
2055           their start-up and those which failed during their runtime.
2056
2057       $EXIT_CODE, $EXIT_STATUS
2058           Only defined for the service unit type, these environment variables
2059           are passed to all ExecStop=, ExecStopPost= processes and contain
2060           exit status/code information of the main process of the service.
2061           For the precise definition of the exit code and status, see
2062           wait(2).  $EXIT_CODE is one of "exited", "killed", "dumped".
2063           $EXIT_STATUS contains the numeric exit code formatted as string if
2064           $EXIT_CODE is "exited", and the signal name in all other cases.
2065           Note that these environment variables are only set if the service
2066           manager succeeded to start and identify the main process of the
2067           service.
2068
2069           Table 5. Summary of possible service result variable values
2070           ┌──────────────────┬──────────────────┬─────────────────────┐
2071$SERVICE_RESULT$EXIT_CODE$EXIT_STATUS
2072           ├──────────────────┼──────────────────┼─────────────────────┤
2073           │"success"         │ "exited"         │ "0"                 │
2074           ├──────────────────┼──────────────────┼─────────────────────┤
2075           │"protocol"        │ not set          │ not set             │
2076           │                  ├──────────────────┼─────────────────────┤
2077           │                  │ "exited"         │ "0"                 │
2078           ├──────────────────┼──────────────────┼─────────────────────┤
2079           │"timeout"         │ "killed"         │ "TERM", "KILL"      │
2080           │                  ├──────────────────┼─────────────────────┤
2081           │                  │ "exited"         │ "0", "1", "2", "3", │
2082           │                  │                  │ ..., "255"          │
2083           ├──────────────────┼──────────────────┼─────────────────────┤
2084           │"exit-code"       │ "exited"         │ "1", "2", "3", ..., │
2085           │                  │                  │ "255"               │
2086           ├──────────────────┼──────────────────┼─────────────────────┤
2087           │"signal"          │ "killed"         │ "HUP", "INT",       │
2088           │                  │                  │ "KILL", ...         │
2089           ├──────────────────┼──────────────────┼─────────────────────┤
2090           │"core-dump"       │ "dumped"         │ "ABRT", "SEGV",     │
2091           │                  │                  │ "QUIT", ...         │
2092           ├──────────────────┼──────────────────┼─────────────────────┤
2093           │"watchdog"        │ "dumped"         │ "ABRT"              │
2094           │                  ├──────────────────┼─────────────────────┤
2095           │                  │ "killed"         │ "TERM", "KILL"      │
2096           │                  ├──────────────────┼─────────────────────┤
2097           │                  │ "exited"         │ "0", "1", "2", "3", │
2098           │                  │                  │ ..., "255"          │
2099           ├──────────────────┼──────────────────┼─────────────────────┤
2100           │"start-limit-hit" │ not set          │ not set             │
2101           ├──────────────────┼──────────────────┼─────────────────────┤
2102           │"resources"       │ any of the above │ any of the above    │
2103           ├──────────────────┴──────────────────┴─────────────────────┤
2104           │Note: the process may be also terminated by a signal not   │
2105           │sent by systemd. In particular the process may send an     │
2106           │arbitrary signal to itself in a handler for any of the     │
2107           │non-maskable signals. Nevertheless, in the "timeout" and   │
2108           │"watchdog" rows above only the signals that systemd sends  │
2109           │have been included. Moreover, using SuccessExitStatus=
2110           │additional exit statuses may be declared to indicate clean │
2111           │termination, which is not reflected by this table.         │
2112           └───────────────────────────────────────────────────────────┘
2113
2114       For system services, when PAMName= is enabled and pam_systemd is part
2115       of the selected PAM stack, additional environment variables defined by
2116       systemd may be set for services. Specifically, these are $XDG_SEAT,
2117       $XDG_VTNR, see pam_systemd(8) for details.
2118

PROCESS EXIT CODES

2120       When invoking a unit process the service manager possibly fails to
2121       apply the execution parameters configured with the settings above. In
2122       that case the already created service process will exit with a non-zero
2123       exit code before the configured command line is executed. (Or in other
2124       words, the child process possibly exits with these error codes, after
2125       having been created by the fork(2) system call, but before the matching
2126       execve(2) system call is called.) Specifically, exit codes defined by
2127       the C library, by the LSB specification and by the systemd service
2128       manager itself are used.
2129
2130       The following basic service exit codes are defined by the C library.
2131
2132       Table 6. Basic C library exit codes
2133       ┌──────────┬───────────────┬────────────────────┐
2134Exit Code Symbolic Name Description        
2135       ├──────────┼───────────────┼────────────────────┤
2136       │0         │ EXIT_SUCCESS  │ Generic success    │
2137       │          │               │ code.              │
2138       ├──────────┼───────────────┼────────────────────┤
2139       │1         │ EXIT_FAILURE  │ Generic failure or │
2140       │          │               │ unspecified error. │
2141       └──────────┴───────────────┴────────────────────┘
2142
2143       The following service exit codes are defined by the LSB
2144       specification[5].
2145
2146       Table 7. LSB service exit codes
2147       ┌──────────┬──────────────────────┬────────────────────┐
2148Exit Code Symbolic Name        Description        
2149       ├──────────┼──────────────────────┼────────────────────┤
2150       │2         │ EXIT_INVALIDARGUMENT │ Invalid or excess  │
2151       │          │                      │ arguments.         │
2152       ├──────────┼──────────────────────┼────────────────────┤
2153       │3         │ EXIT_NOTIMPLEMENTED  │ Unimplemented      │
2154       │          │                      │ feature.           │
2155       ├──────────┼──────────────────────┼────────────────────┤
2156       │4         │ EXIT_NOPERMISSION    │ The user has       │
2157       │          │                      │ insufficient       │
2158       │          │                      │ privileges.        │
2159       ├──────────┼──────────────────────┼────────────────────┤
2160       │5         │ EXIT_NOTINSTALLED    │ The program is not │
2161       │          │                      │ installed.         │
2162       ├──────────┼──────────────────────┼────────────────────┤
2163       │6         │ EXIT_NOTCONFIGURED   │ The program is not │
2164       │          │                      │ configured.        │
2165       ├──────────┼──────────────────────┼────────────────────┤
2166       │7         │ EXIT_NOTRUNNING      │ The program is not │
2167       │          │                      │ running.           │
2168       └──────────┴──────────────────────┴────────────────────┘
2169
2170       The LSB specification suggests that error codes 200 and above are
2171       reserved for implementations. Some of them are used by the service
2172       manager to indicate problems during process invocation:
2173
2174       Table 8. systemd-specific exit codes
2175       ┌──────────┬──────────────────────────────┬─────────────────────────────────────────────┐
2176Exit Code Symbolic Name                Description                                 
2177       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2178       │200       │ EXIT_CHDIR                   │ Changing to the                             │
2179       │          │                              │ requested working                           │
2180       │          │                              │ directory failed.                           │
2181       │          │                              │ See                                         │
2182       │          │                              │ WorkingDirectory=
2183       │          │                              │ above.                                      │
2184       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2185       │201       │ EXIT_NICE                    │ Failed to set up                            │
2186       │          │                              │ process scheduling                          │
2187       │          │                              │ priority (nice                              │
2188       │          │                              │ level). See Nice=
2189       │          │                              │ above.                                      │
2190       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2191       │202       │ EXIT_FDS                     │ Failed to close                             │
2192       │          │                              │ unwanted file                               │
2193       │          │                              │ descriptors, or to                          │
2194       │          │                              │ adjust passed file                          │
2195       │          │                              │ descriptors.                                │
2196       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2197       │203       │ EXIT_EXEC                    │ The actual process                          │
2198       │          │                              │ execution failed                            │
2199       │          │                              │ (specifically, the                          │
2200       │          │                              │ execve(2) system                            │
2201       │          │                              │ call). Most likely                          │
2202       │          │                              │ this is caused by a                         │
2203       │          │                              │ missing or                                  │
2204       │          │                              │ non-accessible                              │
2205       │          │                              │ executable file.                            │
2206       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2207       │204       │ EXIT_MEMORY                  │ Failed to perform                           │
2208       │          │                              │ an action due to                            │
2209       │          │                              │ memory shortage.                            │
2210       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2211       │205       │ EXIT_LIMITS                  │ Failed to adjust                            │
2212       │          │                              │ resource limits.                            │
2213       │          │                              │ See LimitCPU= and                           │
2214       │          │                              │ related settings                            │
2215       │          │                              │ above.                                      │
2216       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2217       │206       │ EXIT_OOM_ADJUST              │ Failed to adjust                            │
2218       │          │                              │ the OOM setting.                            │
2219       │          │                              │ See OOMScoreAdjust=
2220       │          │                              │ above.                                      │
2221       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2222       │207       │ EXIT_SIGNAL_MASK             │ Failed to set                               │
2223       │          │                              │ process signal                              │
2224       │          │                              │ mask.                                       │
2225       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2226       │208       │ EXIT_STDIN                   │ Failed to set up                            │
2227       │          │                              │ standard input. See                         │
2228       │          │                              │ StandardInput=
2229       │          │                              │ above.                                      │
2230       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2231       │209       │ EXIT_STDOUT                  │ Failed to set up                            │
2232       │          │                              │ standard output.                            │
2233       │          │                              │ See StandardOutput=
2234       │          │                              │ above.                                      │
2235       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2236       │210       │ EXIT_CHROOT                  │ Failed to change                            │
2237       │          │                              │ root directory                              │
2238       │          │                              │ (chroot(2)). See                            │
2239       │          │                              │ RootDirectory=/RootImage=
2240       │          │                              │ above.                                      │
2241       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2242       │211       │ EXIT_IOPRIO                  │ Failed to set up IO                         │
2243       │          │                              │ scheduling priority. See                    │
2244       │          │                              │ IOSchedulingClass=/IOSchedulingPriority=
2245       │          │                              │ above.                                      │
2246       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2247       │212       │ EXIT_TIMERSLACK              │ Failed to set up timer slack. See           │
2248       │          │                              │ TimerSlackNSec= above.                      │
2249       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2250       │213       │ EXIT_SECUREBITS              │ Failed to set process secure bits. See      │
2251       │          │                              │ SecureBits= above.                          │
2252       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2253       │214       │ EXIT_SETSCHEDULER            │ Failed to set up CPU scheduling. See        │
2254       │          │                              │ CPUSchedulingPolicy=/CPUSchedulingPriority=
2255       │          │                              │ above.                                      │
2256       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2257       │215       │ EXIT_CPUAFFINITY             │ Failed to set up CPU affinity. See          │
2258       │          │                              │ CPUAffinity= above.                         │
2259       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2260       │216       │ EXIT_GROUP                   │ Failed to determine or change group         │
2261       │          │                              │ credentials. See                            │
2262       │          │                              │ Group=/SupplementaryGroups= above.          │
2263       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2264       │217       │ EXIT_USER                    │ Failed to determine or change user          │
2265       │          │                              │ credentials, or to set up user namespacing. │
2266       │          │                              │ See User=/PrivateUsers= above.              │
2267       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2268       │218       │ EXIT_CAPABILITIES            │ Failed to drop capabilities, or apply       │
2269       │          │                              │ ambient capabilities. See                   │
2270       │          │                              │ CapabilityBoundingSet=/AmbientCapabilities=
2271       │          │                              │ above.                                      │
2272       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2273       │219       │ EXIT_CGROUP                  │ Setting up the service control group        │
2274       │          │                              │ failed.                                     │
2275       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2276       │220       │ EXIT_SETSID                  │ Failed to create new process session.       │
2277       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2278       │221       │ EXIT_CONFIRM                 │ Execution has been cancelled by the user.   │
2279       │          │                              │ See the systemd.confirm_spawn= kernel       │
2280       │          │                              │ command line setting on kernel-command-     
2281       │          │                              │ line(7) for details.                        │
2282       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2283       │222       │ EXIT_STDERR                  │ Failed to set up standard error output. See │
2284       │          │                              │ StandardError= above.                       │
2285       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2286       │224       │ EXIT_PAM                     │ Failed to set up PAM session. See PAMName=
2287       │          │                              │ above.                                      │
2288       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2289       │225       │ EXIT_NETWORK                 │ Failed to set up network namespacing. See   │
2290       │          │                              │ PrivateNetwork= above.                      │
2291       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2292       │226       │ EXIT_NAMESPACE               │ Failed to set up mount namespacing. See     │
2293       │          │                              │ ReadOnlyPaths= and related settings above.  │
2294       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2295       │227       │ EXIT_NO_NEW_PRIVILEGES       │ Failed to disable new privileges. See       │
2296       │          │                              │ NoNewPrivileges=yes above.                  │
2297       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2298       │228       │ EXIT_SECCOMP                 │ Failed to apply system call filters. See    │
2299       │          │                              │ SystemCallFilter= and related settings      │
2300       │          │                              │ above.                                      │
2301       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2302       │229       │ EXIT_SELINUX_CONTEXT         │ Determining or changing SELinux context     │
2303       │          │                              │ failed. See SELinuxContext= above.          │
2304       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2305       │230       │ EXIT_PERSONALITY             │ Failed to set up an execution domain        │
2306       │          │                              │ (personality). See Personality= above.      │
2307       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2308       │231       │ EXIT_APPARMOR_PROFILE        │ Failed to prepare changing AppArmor         │
2309       │          │                              │ profile. See AppArmorProfile= above.        │
2310       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2311       │232       │ EXIT_ADDRESS_FAMILIES        │ Failed to restrict address families. See    │
2312       │          │                              │ RestrictAddressFamilies= above.             │
2313       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2314       │233       │ EXIT_RUNTIME_DIRECTORY       │ Setting up runtime directory failed. See    │
2315       │          │                              │ RuntimeDirectory= and related settings      │
2316       │          │                              │ above.                                      │
2317       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2318       │235       │ EXIT_CHOWN                   │ Failed to adjust socket ownership. Used for │
2319       │          │                              │ socket units only.                          │
2320       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2321       │236       │ EXIT_SMACK_PROCESS_LABEL     │ Failed to set SMACK label. See              │
2322       │          │                              │ SmackProcessLabel= above.                   │
2323       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2324       │237       │ EXIT_KEYRING                 │ Failed to set up kernel keyring.            │
2325       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2326       │238       │ EXIT_STATE_DIRECTORY         │ Failed to set up unit's state directory.    │
2327       │          │                              │ See StateDirectory= above.                  │
2328       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2329       │239       │ EXIT_CACHE_DIRECTORY         │ Failed to set up unit's cache directory.    │
2330       │          │                              │ See CacheDirectory= above.                  │
2331       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2332       │240       │ EXIT_LOGS_DIRECTORY          │ Failed to set up unit's logging directory.  │
2333       │          │                              │ See LogsDirectory= above.                   │
2334       ├──────────┼──────────────────────────────┼─────────────────────────────────────────────┤
2335       │241       │ EXIT_CONFIGURATION_DIRECTORY │ Failed to set up unit's configuration       │
2336       │          │                              │ directory. See ConfigurationDirectory=
2337       │          │                              │ above.                                      │
2338       └──────────┴──────────────────────────────┴─────────────────────────────────────────────┘
2339
2340       Finally, the BSD operating systems define a set of exit codes,
2341       typically defined on Linux systems too:
2342
2343       Table 9. BSD exit codes
2344       ┌──────────┬────────────────┬─────────────────────┐
2345Exit Code Symbolic Name  Description         
2346       ├──────────┼────────────────┼─────────────────────┤
2347       │64        │ EX_USAGE       │ Command line usage  │
2348       │          │                │ error               │
2349       ├──────────┼────────────────┼─────────────────────┤
2350       │65        │ EX_DATAERR     │ Data format error   │
2351       ├──────────┼────────────────┼─────────────────────┤
2352       │66        │ EX_NOINPUT     │ Cannot open input   │
2353       ├──────────┼────────────────┼─────────────────────┤
2354       │67        │ EX_NOUSER      │ Addressee unknown   │
2355       ├──────────┼────────────────┼─────────────────────┤
2356       │68        │ EX_NOHOST      │ Host name unknown   │
2357       ├──────────┼────────────────┼─────────────────────┤
2358       │69        │ EX_UNAVAILABLE │ Service unavailable │
2359       ├──────────┼────────────────┼─────────────────────┤
2360       │70        │ EX_SOFTWARE    │ internal software   │
2361       │          │                │ error               │
2362       ├──────────┼────────────────┼─────────────────────┤
2363       │71        │ EX_OSERR       │ System error (e.g., │
2364       │          │                │ can't fork)         │
2365       ├──────────┼────────────────┼─────────────────────┤
2366       │72        │ EX_OSFILE      │ Critical OS file    │
2367       │          │                │ missing             │
2368       ├──────────┼────────────────┼─────────────────────┤
2369       │73        │ EX_CANTCREAT   │ Can't create (user) │
2370       │          │                │ output file         │
2371       ├──────────┼────────────────┼─────────────────────┤
2372       │74        │ EX_IOERR       │ Input/output error  │
2373       ├──────────┼────────────────┼─────────────────────┤
2374       │75        │ EX_TEMPFAIL    │ Temporary failure;  │
2375       │          │                │ user is invited to  │
2376       │          │                │ retry               │
2377       ├──────────┼────────────────┼─────────────────────┤
2378       │76        │ EX_PROTOCOL    │ Remote error in     │
2379       │          │                │ protocol            │
2380       ├──────────┼────────────────┼─────────────────────┤
2381       │77        │ EX_NOPERM      │ Permission denied   │
2382       ├──────────┼────────────────┼─────────────────────┤
2383       │78        │ EX_CONFIG      │ Configuration error │
2384       └──────────┴────────────────┴─────────────────────┘
2385

SEE ALSO

2387       systemd(1), systemctl(1), systemd-analyze(1), journalctl(1),
2388       systemd.unit(5), systemd.service(5), systemd.socket(5),
2389       systemd.swap(5), systemd.mount(5), systemd.kill(5), systemd.resource-
2390       control(5), systemd.time(7), systemd.directives(7), tmpfiles.d(5),
2391       exec(3)
2392

NOTES

2394        1. Discoverable Partitions Specification
2395           https://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/
2396
2397        2. No New Privileges Flag
2398           https://www.kernel.org/doc/html/latest/userspace-api/no_new_privs.html
2399
2400        3. proc.txt
2401           https://www.kernel.org/doc/Documentation/filesystems/proc.txt
2402
2403        4. Base64
2404           https://tools.ietf.org/html/rfc2045#section-6.8
2405
2406        5. LSB specification
2407           https://refspecs.linuxbase.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
2408
2409
2410
2411systemd 239                                                    SYSTEMD.EXEC(5)
Impressum