| 1 | # | ||
| 2 | # This file is part of Config-Model-Systemd | ||
| 3 | # | ||
| 4 | # This software is Copyright (c) 2008-2026 by Dominique Dumont. | ||
| 5 | # | ||
| 6 | # This is free software, licensed under: | ||
| 7 | # | ||
| 8 | # The GNU Lesser General Public License, Version 2.1, February 1999 | ||
| 9 | # | ||
| 10 | 4 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 4 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 4 | ▶ | use v5.20; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 4 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | |||
| 15 | return [ | ||
| 16 | { | ||
| 17 | 3 | 'accept' => [ | |
| 18 | '.*', | ||
| 19 | { | ||
| 20 | 'type' => 'leaf', | ||
| 21 | 'value_type' => 'uniline', | ||
| 22 | 'warn' => 'Unexpected systemd parameter. Please contact cme author to update systemd model.' | ||
| 23 | } | ||
| 24 | ], | ||
| 25 | 'class_description' => 'Unit configuration files for services, sockets, mount points, and swap devices share a subset of | ||
| 26 | configuration options which define the execution environment of spawned processes. | ||
| 27 | |||
| 28 | This man page lists the configuration options shared by these four unit types. See | ||
| 29 | L<systemd.unit(5)> for the common | ||
| 30 | options of all unit configuration files, and | ||
| 31 | L<systemd.service(5)>, | ||
| 32 | L<systemd.socket(5)>, | ||
| 33 | L<systemd.swap(5)>, and | ||
| 34 | L<systemd.mount(5)> for more | ||
| 35 | information on the specific unit configuration files. The execution specific configuration options are configured | ||
| 36 | in the [Service], [Socket], [Mount], or [Swap] sections, depending on the unit type. | ||
| 37 | |||
| 38 | In addition, options which control resources through Linux Control Groups (cgroups) are listed in | ||
| 39 | L<systemd.resource-control(5)>. | ||
| 40 | Those options complement options listed here. | ||
| 41 | |||
| 42 | The following service exit codes are defined by the L<LSB specification|https://refspecs.linuxbase.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html>. | ||
| 43 | |||
| 44 | |||
| 45 | |||
| 46 | The LSB specification suggests that error codes 200 and above are reserved for implementations. Some of them are | ||
| 47 | used by the service manager to indicate problems during process invocation: | ||
| 48 | |||
| 49 | |||
| 50 | Finally, the BSD operating systems define a set of exit codes, typically defined on Linux systems too: | ||
| 51 | This configuration class was generated from systemd documentation. | ||
| 52 | by L<parse-man.pl|https://github.com/dod38fr/config-model-systemd/contrib/parse-man.pl> | ||
| 53 | ', | ||
| 54 | 'copyright' => [ | ||
| 55 | '2010-2016 Lennart Poettering and others', | ||
| 56 | '2016 Dominique Dumont' | ||
| 57 | ], | ||
| 58 | 'description' => { | ||
| 59 | 'AmbientCapabilities' => 'Controls which capabilities to include in the ambient capability set for the executed | ||
| 60 | process. Takes a whitespace-separated list of capability names, e.g. C<CAP_SYS_ADMIN>, | ||
| 61 | C<CAP_DAC_OVERRIDE>, C<CAP_SYS_PTRACE>. This option may appear more than | ||
| 62 | once, in which case the ambient capability sets are merged (see the above examples in | ||
| 63 | C<CapabilityBoundingSet>). If the list of capabilities is prefixed with C<~>, | ||
| 64 | all but the listed capabilities will be included, the effect of the assignment inverted. If the empty string is | ||
| 65 | assigned to this option, the ambient capability set is reset to the empty capability set, and all prior | ||
| 66 | settings have no effect. If set to C<~> (without any further argument), the ambient capability | ||
| 67 | set is reset to the full set of available capabilities, also undoing any previous settings. Note that adding | ||
| 68 | capabilities to the ambient capability set adds them to the process\'s inherited capability set. | ||
| 69 | |||
| 70 | Ambient capability sets are useful if you want to execute a process as a non-privileged user but | ||
| 71 | still want to give it some capabilities. Note that, in this case, option C<keep-caps> | ||
| 72 | is automatically added to C<SecureBits> to retain the capabilities over the user | ||
| 73 | change. C<AmbientCapabilities> does not affect commands prefixed with | ||
| 74 | C<+>.', | ||
| 75 | 'AppArmorProfile' => 'Takes a profile name as argument. The process executed by the unit will switch to | ||
| 76 | this profile when started. Profiles must already be loaded in the kernel, or the unit will fail. If | ||
| 77 | prefixed by C<->, all errors will be ignored. This setting has no effect if AppArmor | ||
| 78 | is not enabled. This setting does not affect commands prefixed with C<+>.', | ||
| 79 | 'BPFDelegateAttachments' => 'Accepts a list of BPF attach points to allow or C<any> to allow everything. | ||
| 80 | Defaults to none. The accepted values are: | ||
| 81 | |||
| 82 | This will set the C<delegate_attachs> bpffs mount option. | ||
| 83 | |||
| 84 | Requires C<PrivateBPF=yes> to be effective, | ||
| 85 | see C<PrivateBPF> more details.', | ||
| 86 | 'BPFDelegateCommands' => 'Accepts a list of BPF commands to allow or C<any> to allow everything. | ||
| 87 | Defaults to none. The accepted values are: | ||
| 88 | |||
| 89 | This will set the C<delegate_cmds> bpffs mount option. | ||
| 90 | |||
| 91 | Requires C<PrivateBPF=yes> to be effective, | ||
| 92 | see C<PrivateBPF> more details.', | ||
| 93 | 'BPFDelegateMaps' => 'Accepts a list of BPF maps to allow or C<any> to allow everything. | ||
| 94 | Defaults to none. The accepted values are: | ||
| 95 | |||
| 96 | This will set the C<delegate_maps> bpffs mount option. | ||
| 97 | |||
| 98 | Requires C<PrivateBPF=yes> to be effective, | ||
| 99 | see C<PrivateBPF> more details.', | ||
| 100 | 'BPFDelegatePrograms' => 'Accepts a list of BPF programs to allow or C<any> to allow everything. | ||
| 101 | Defaults to none. The accepted values are: | ||
| 102 | |||
| 103 | This will set the C<delegate_progs> bpffs mount option. | ||
| 104 | |||
| 105 | Requires C<PrivateBPF=yes> to be effective, | ||
| 106 | see C<PrivateBPF> more details.', | ||
| 107 | 'BindLogSockets' => 'Takes a boolean argument. If true, sockets from L<systemd-journald.socket(8)> | ||
| 108 | will be bind mounted into the mount namespace. This is particularly useful when a different instance | ||
| 109 | of C</run/> is employed, to make sure processes running in the namespace | ||
| 110 | can still make use of L<sd-journal(3)>. | ||
| 111 | |||
| 112 | This option is implied when C<LogNamespace> is used, | ||
| 113 | when C<MountAPIVFS=yes>, or when C<PrivateDevices=yes> is used | ||
| 114 | in conjunction with either C<RootDirectory> or C<RootImage>.', | ||
| 115 | 'BindPaths' => 'Configures unit-specific bind mounts. A bind mount makes a particular file or | ||
| 116 | directory available at an additional place in the unit\'s view of the file system. Any bind mounts | ||
| 117 | created with this option are specific to the unit, and are not visible in the host\'s mount | ||
| 118 | table. This option expects a whitespace separated list of bind mount definitions. Each definition | ||
| 119 | consists of a colon-separated triple of source path, destination path and option string, where the | ||
| 120 | latter two are optional. If only a source path is specified the source and destination is taken to be | ||
| 121 | the same. The option string may be either C<rbind> or C<norbind> for | ||
| 122 | configuring a recursive or non-recursive bind mount. If the destination path is omitted, the option | ||
| 123 | string must be omitted too. Each bind mount definition may be prefixed with C<->, in | ||
| 124 | which case it will be ignored when its source path does not exist or is not accessible. | ||
| 125 | |||
| 126 | C<BindPaths> creates regular writable bind mounts (unless the source file system mount | ||
| 127 | is already marked read-only), while C<BindReadOnlyPaths> creates read-only bind mounts. These | ||
| 128 | settings may be used more than once, each usage appends to the unit\'s list of bind mounts. If the empty string | ||
| 129 | is assigned to either of these two options the entire list of bind mounts defined prior to this is reset. Note | ||
| 130 | that, in this case, both read-only and regular bind mounts are reset, regardless which of the two settings is | ||
| 131 | used. | ||
| 132 | |||
| 133 | Using this option implies that a mount namespace is allocated for the unit, i.e. it implies the | ||
| 134 | effect of C<PrivateMounts> (see below). | ||
| 135 | |||
| 136 | This option is particularly useful when C<RootDirectory>/C<RootImage> | ||
| 137 | is used. In this case, the source path refers to a path on the host file system, while the destination path | ||
| 138 | refers to a path below the root directory of the unit. | ||
| 139 | |||
| 140 | Note that the destination directory must exist or systemd must be able to create it. Thus, it | ||
| 141 | is not possible to use those options for mount points nested underneath paths specified in | ||
| 142 | C<InaccessiblePaths>, or under C</home/> and other protected | ||
| 143 | directories if C<ProtectHome=yes> is | ||
| 144 | specified. C<TemporaryFileSystem> with C<:ro> or | ||
| 145 | C<ProtectHome=tmpfs> should be used instead.', | ||
| 146 | 'BindReadOnlyPaths' => '*BindPaths', | ||
| 147 | 'CPUAffinity' => 'Controls the CPU affinity of the executed processes. Takes a list of CPU indices or ranges | ||
| 148 | separated by either whitespace or commas. Alternatively, takes a special "numa" value in which case systemd | ||
| 149 | automatically derives allowed CPU range based on the value of C<NUMAMask> option. CPU ranges | ||
| 150 | are specified by the lower and upper CPU indices separated by a dash. This option may be specified more than | ||
| 151 | once, in which case the specified CPU affinity masks are merged. If the empty string is assigned, the mask | ||
| 152 | is reset, all assignments prior to this will have no effect. See | ||
| 153 | L<sched_setaffinity(2)> for | ||
| 154 | details.', | ||
| 155 | 'CPUSchedulingPolicy' => 'Sets the CPU scheduling policy for executed processes. Takes one of C<other>, | ||
| 156 | C<batch>, C<idle>, C<fifo>, C<rr> or C<ext>. See | ||
| 157 | L<sched_setscheduler(2)> for | ||
| 158 | details.', | ||
| 159 | 'CPUSchedulingPriority' => 'Sets the CPU scheduling priority for executed processes. The available priority range | ||
| 160 | depends on the selected CPU scheduling policy (see above). For real-time scheduling policies an | ||
| 161 | integer between 1 (lowest priority) and 99 (highest priority) can be used. In case of CPU resource | ||
| 162 | contention, smaller values mean less CPU time is made available to the service, larger values mean | ||
| 163 | more. See L<sched_setscheduler(2)> | ||
| 164 | for details.', | ||
| 165 | 'CPUSchedulingResetOnFork' => 'Takes a boolean argument. If true, elevated CPU scheduling priorities and policies | ||
| 166 | will be reset when the executed processes call | ||
| 167 | L<fork(2)>, | ||
| 168 | and can hence not leak into child processes. See | ||
| 169 | L<sched_setscheduler(2)> | ||
| 170 | for details. Defaults to false.', | ||
| 171 | 'CacheDirectory' => "These options take a whitespace-separated list of directory names. The specified | ||
| 172 | directory names must be relative, and may not include C<..>. If set, when the unit is | ||
| 173 | started, one or more directories by the specified names will be created (including their parents) | ||
| 174 | below the locations defined in the following table. Also, the corresponding environment variable will | ||
| 175 | be defined with the full paths of the directories. If multiple directories are set, then in the | ||
| 176 | environment variable the paths are concatenated with colon (C<:>). | ||
| 177 | |||
| 178 | If C<DynamicUser> is used, and if the kernel version supports | ||
| 179 | L<id-mapped mounts|https://lwn.net/Articles/896255/>, the specified directories will | ||
| 180 | be owned by \"nobody\" in the host namespace and will be mapped to (and will be owned by) the service's | ||
| 181 | UID/GID in its own namespace. For backward compatibility, existing directories created without id-mapped | ||
| 182 | mounts will be kept untouched. | ||
| 183 | |||
| 184 | In case of C<RuntimeDirectory> the innermost subdirectories are removed when | ||
| 185 | the unit is stopped. It is possible to preserve the specified directories in this case if | ||
| 186 | C<RuntimeDirectoryPreserve> is configured to C<restart> or | ||
| 187 | C<yes> (see below). The directories specified with C<StateDirectory>, | ||
| 188 | C<CacheDirectory>, C<LogsDirectory>, | ||
| 189 | C<ConfigurationDirectory> are not removed when the unit is stopped. | ||
| 190 | |||
| 191 | Except in case of C<ConfigurationDirectory>, the innermost specified directories will be | ||
| 192 | owned by the user and group specified in C<User> and C<Group>. If the | ||
| 193 | specified directories already exist and their owning user or group do not match the configured ones, all files | ||
| 194 | and directories below the specified directories as well as the directories themselves will have their file | ||
| 195 | ownership recursively changed to match what is configured. As an optimization, if the specified directories are | ||
| 196 | already owned by the right user and group, files and directories below of them are left as-is, even if they do | ||
| 197 | not match what is requested. The innermost specified directories will have their access mode adjusted to the | ||
| 198 | what is specified in C<RuntimeDirectoryMode>, C<StateDirectoryMode>, | ||
| 199 | C<CacheDirectoryMode>, C<LogsDirectoryMode> and | ||
| 200 | C<ConfigurationDirectoryMode>. | ||
| 201 | |||
| 202 | These options imply C<BindPaths> for the specified paths. When combined with | ||
| 203 | C<RootDirectory> or C<RootImage> these paths always reside on the host and | ||
| 204 | are mounted from there into the unit's file system namespace. | ||
| 205 | |||
| 206 | If C<DynamicUser> is used, the logic for C<CacheDirectory>, | ||
| 207 | C<LogsDirectory> and C<StateDirectory> is slightly altered: the directories are created below | ||
| 208 | C</var/cache/private>, C</var/log/private> and C</var/lib/private>, | ||
| 209 | respectively, which are host directories made inaccessible to | ||
| 210 | unprivileged users, which ensures that access to these directories cannot be gained through dynamic | ||
| 211 | user ID recycling. Symbolic links are created to hide this difference in behaviour. Both from | ||
| 212 | perspective of the host and from inside the unit, the relevant directories hence always appear | ||
| 213 | directly below C</var/cache>, C</var/log> and | ||
| 214 | C</var/lib>. | ||
| 215 | |||
| 216 | Use C<RuntimeDirectory> to manage one or more runtime directories for the unit and bind | ||
| 217 | their lifetime to the daemon runtime. This is particularly useful for unprivileged daemons that cannot create | ||
| 218 | runtime directories in C</run/> due to lack of privileges, and to make sure the runtime | ||
| 219 | directory is cleaned up automatically after use. For runtime directories that require more complex or different | ||
| 220 | configuration or lifetime guarantees, please consider using | ||
| 221 | L<tmpfiles.d(5)>. | ||
| 222 | |||
| 223 | C<RuntimeDirectory>, C<StateDirectory>, | ||
| 224 | C<CacheDirectory> and C<LogsDirectory> optionally support two | ||
| 225 | more parameters, separated by C<:>. The second parameter will be interpreted as a | ||
| 226 | destination path that will be created as a symlink to the directory. The symlinks will be created | ||
| 227 | after any C<BindPaths> or C<TemporaryFileSystem> options have been | ||
| 228 | set up, to make ephemeral symlinking possible. The same source can have multiple symlinks, by using | ||
| 229 | the same first parameter, but a different second parameter. The third parameter is a flags field, | ||
| 230 | and since v257 can take a value of C<ro> to make the directory read only for the | ||
| 231 | service. This is also supported for C<ConfigurationDirectory>. If multiple symlinks | ||
| 232 | are set up, the directory will be read only if at least one is configured to be read only. To pass a | ||
| 233 | flag without a destination symlink, the second parameter can be empty, for example: | ||
| 234 | |||
| 235 | ConfigurationDirectory=foo::ro | ||
| 236 | |||
| 237 | The directories defined by these options are always created under the standard paths used by systemd | ||
| 238 | (C</var/>, C</run/>, C</etc/>, \x{2026}). If the service needs | ||
| 239 | directories in a different location, a different mechanism has to be used to create them. | ||
| 240 | |||
| 241 | L<tmpfiles.d(5)> provides | ||
| 242 | functionality that overlaps with these options. Using these options is recommended, because the lifetime of | ||
| 243 | the directories is tied directly to the lifetime of the unit, and it is not necessary to ensure that the | ||
| 244 | C<tmpfiles.d> configuration is executed before the unit is started. | ||
| 245 | |||
| 246 | To remove any of the directories created by these settings, use the systemctl clean | ||
| 247 | \x{2026} command on the relevant units, see | ||
| 248 | L<systemctl(1)> for | ||
| 249 | details. | ||
| 250 | |||
| 251 | Example: if a system service unit has the following, | ||
| 252 | |||
| 253 | RuntimeDirectory=foo/bar baz | ||
| 254 | |||
| 255 | the service manager creates C</run/foo> (if it does not exist), | ||
| 256 | C</run/foo/bar>, and C</run/baz>. The | ||
| 257 | directories C</run/foo/bar> and | ||
| 258 | C</run/baz> except C</run/foo> are | ||
| 259 | owned by the user and group specified in C<User> and C<Group>, and removed | ||
| 260 | when the service is stopped. | ||
| 261 | |||
| 262 | Example: if a system service unit has the following, | ||
| 263 | |||
| 264 | RuntimeDirectory=foo/bar | ||
| 265 | StateDirectory=aaa/bbb ccc | ||
| 266 | |||
| 267 | then the environment variable C<RUNTIME_DIRECTORY> is set with C</run/foo/bar>, and | ||
| 268 | C<STATE_DIRECTORY> is set with C</var/lib/aaa/bbb:/var/lib/ccc>. | ||
| 269 | |||
| 270 | Example: if a system service unit has the following, | ||
| 271 | |||
| 272 | RuntimeDirectory=foo:bar foo:baz | ||
| 273 | |||
| 274 | the service manager creates C</run/foo> (if it does not exist), and | ||
| 275 | C</run/bar> plus C</run/baz> as symlinks to | ||
| 276 | C</run/foo>.", | ||
| 277 | 'CacheDirectoryAccounting' => 'Takes a boolean argument. If true, a project ID is assigned to the directories specified in | ||
| 278 | C<StateDirectory>, C<CacheDirectory>, or C<LogsDirectory> | ||
| 279 | respectively, which is used for tracking disk usage when disk quotas are turned on | ||
| 280 | (see L<repquota|https://man7.org/linux/man-pages/man8/repquota.8.html>). Defaults to false. | ||
| 281 | |||
| 282 | To set and enforce disk quotas, C<StateDirectoryQuota>, C<CacheDirectoryQuota>, | ||
| 283 | or C<LogsDirectoryQuota> must be specified.', | ||
| 284 | 'CacheDirectoryMode' => 'Specifies the access mode of the directories specified in C<RuntimeDirectory>, | ||
| 285 | C<StateDirectory>, C<CacheDirectory>, C<LogsDirectory>, or | ||
| 286 | C<ConfigurationDirectory>, respectively, as an octal number. Defaults to | ||
| 287 | C<0755>. See "Permissions" in L<path_resolution(7)> for a | ||
| 288 | discussion of the meaning of permission bits.', | ||
| 289 | 'CacheDirectoryQuota' => 'Specifies the storage limits for the directories specified in C<StateDirectory>, | ||
| 290 | C<CacheDirectory>, or C<LogsDirectory> respectively. | ||
| 291 | |||
| 292 | The storage quota is defined in terms of disk blocks and inodes, as per | ||
| 293 | L<quotactl|https://man7.org/linux/man-pages/man2/quotactl.2.html>. Takes an absolute size limit | ||
| 294 | in bytes. If the value is suffixed with K, M, G or T, the specified size is parsed as Kilobytes, Megabytes, Gigabytes, | ||
| 295 | or Terabytes (with the base 1024), respectively. If an absolute size limit is specified, only the block quota is set | ||
| 296 | (rounded up to the nearest block). Alternatively, a percentage value may be specified, which applies the same percent | ||
| 297 | quota to both blocks and inodes. Defaults to C<off>, in which case no storage limits will be set. | ||
| 298 | |||
| 299 | Only hard limits are set, not soft limits. If the underlying filesystem for the specified directories does not | ||
| 300 | support project quotas, the specified storage limits will not be set. In addition to enabling per-unit quotas with | ||
| 301 | these settings, it is necessary to enable C<prjquota> on the file system level as well | ||
| 302 | (i.e. tune2fs -Q prjquota). Quotas must also be turned on with | ||
| 303 | L<quotaon.|https://linux.die.net/man/8/quotaon>', | ||
| 304 | 'CapabilityBoundingSet' => 'Controls which capabilities to include in the capability bounding set for the | ||
| 305 | executed process. See L<capabilities(7)> | ||
| 306 | for details. Takes a whitespace-separated list of capability names, | ||
| 307 | e.g. C<CAP_SYS_ADMIN>, C<CAP_DAC_OVERRIDE>, | ||
| 308 | C<CAP_SYS_PTRACE>. Capabilities listed will be included in the bounding set, all | ||
| 309 | others are removed. If the list of capabilities is prefixed with C<~>, all but the | ||
| 310 | listed capabilities will be included, the effect of the assignment inverted. Note that this option | ||
| 311 | also affects the respective capabilities in the effective, permitted and inheritable capability | ||
| 312 | sets. If this option is not used, the capability bounding set is not modified on process execution, | ||
| 313 | hence no limits on the capabilities of the process are enforced. This option may appear more than | ||
| 314 | once, in which case the bounding sets are merged by C<OR>, or by | ||
| 315 | C<AND> if the lines are prefixed with C<~> (see below). If the | ||
| 316 | empty string is assigned to this option, the bounding set is reset to the empty capability set, and | ||
| 317 | all prior settings have no effect. If set to C<~> (without any further argument), | ||
| 318 | the bounding set is reset to the full set of available capabilities, also undoing any previous | ||
| 319 | settings. This does not affect commands prefixed with C<+>. | ||
| 320 | |||
| 321 | Use | ||
| 322 | L<systemd-analyze(1)>\'s | ||
| 323 | capability command to retrieve a list of capabilities defined on the local | ||
| 324 | system. | ||
| 325 | |||
| 326 | Example: if a unit has the following, | ||
| 327 | |||
| 328 | CapabilityBoundingSet=CAP_A CAP_B | ||
| 329 | CapabilityBoundingSet=CAP_B CAP_C | ||
| 330 | |||
| 331 | then C<CAP_A>, C<CAP_B>, and | ||
| 332 | C<CAP_C> are set. If the second line is prefixed with | ||
| 333 | C<~>, e.g., | ||
| 334 | |||
| 335 | CapabilityBoundingSet=CAP_A CAP_B | ||
| 336 | CapabilityBoundingSet=~CAP_B CAP_C | ||
| 337 | |||
| 338 | then, only C<CAP_A> is set.', | ||
| 339 | 'ConfigurationDirectory' => '*CacheDirectory', | ||
| 340 | 'ConfigurationDirectoryMode' => '*CacheDirectoryMode', | ||
| 341 | 'CoredumpFilter' => 'Controls which types of memory mappings will be saved if the process dumps core | ||
| 342 | (using the C</proc/pid/coredump_filter> file). Takes a | ||
| 343 | whitespace-separated combination of mapping type names or numbers (with the default base 16). Mapping | ||
| 344 | type names are C<private-anonymous>, C<shared-anonymous>, | ||
| 345 | C<private-file-backed>, C<shared-file-backed>, | ||
| 346 | C<elf-headers>, C<private-huge>, | ||
| 347 | C<shared-huge>, C<private-dax>, C<shared-dax>, | ||
| 348 | and the special values C<all> (all types) and C<default> (the | ||
| 349 | kernel default of C<private-anonymous>C<shared-anonymous> C<elf-headers>C<private-huge>). See | ||
| 350 | L<core(5)> | ||
| 351 | for the meaning of the mapping types. When specified multiple times, all specified masks are | ||
| 352 | ORed. When not set, or if the empty value is assigned, the inherited value is not changed.', | ||
| 353 | 'DelegateNamespaces' => 'Delegates ownership of the given namespace types to the user namespace of the | ||
| 354 | processes of this unit. For details about Linux namespaces, see L<namespaces(7)>. | ||
| 355 | Either takes a boolean argument, or a space-separated list of namespace type identifiers. If false | ||
| 356 | (the default), the unit\'s processes\' user namespace will not have ownership over any namespaces | ||
| 357 | created during setup of the unit\'s sandboxed environment. If true, ownership of all namespace types | ||
| 358 | (except for user namespaces, where the concept doesn\'t apply) created during setup of the unit\'s | ||
| 359 | sandboxed environment is delegated to the unit\'s processes\' user namespace. Otherwise, a | ||
| 360 | space-separated list of namespace type identifiers must be specified, consisting of any combination | ||
| 361 | of: C<cgroup>, C<ipc>, C<net>, | ||
| 362 | C<mnt>, C<pid>, and C<uts>. All namespaces of | ||
| 363 | the listed types will be owned by the unit\'s processes\' user namespace if they are created during | ||
| 364 | setup of the unit\'s sandboxed environment (allow-listing). By prepending the list with a single tilde | ||
| 365 | character (C<~>) the effect may be inverted: all namespaces of types not listed and | ||
| 366 | created during setup of the unit\'s sandboxed environment will be owned by the unit\'s processes\' user | ||
| 367 | namespace (deny-listing). If the empty string is assigned, the default namespace ownership is | ||
| 368 | applied, which is equivalent to false. This option may appear more than once, in which case the | ||
| 369 | namespace types are merged by C<OR>, or by C<AND> if the lines | ||
| 370 | are prefixed with C<~> (see examples below). Internally, this setting controls the | ||
| 371 | order in which namespaces are unshared by systemd. Namespace types that should be owned by the unit\'s | ||
| 372 | processes\' user namespace will be unshared after unsharing the user namespace. Internally, this | ||
| 373 | setting controls the order in which namespaces are unshared. Delegated namespaces will be unshared | ||
| 374 | after the user namespace is unshared. Other namespaces will be unshared before the user namespace is | ||
| 375 | unshared. | ||
| 376 | |||
| 377 | Delegating any namespace with C<DelegateNamespaces> implies | ||
| 378 | C<PrivateUsers=self> unless C<PrivateUsers> is explicitly enabled | ||
| 379 | already by the unit. Delegating a namespace does not imply that the namespace is unshared, that is | ||
| 380 | done with the namespace specific unit setting such as C<PrivateNetwork> or | ||
| 381 | C<PrivateMounts>. | ||
| 382 | |||
| 383 | Note that some namespace sandboxing options might entail mount namespace for private API VFS instances, | ||
| 384 | such as C<PrivatePIDs>, C<ProtectControlGroups=private/strict>, or | ||
| 385 | C<PrivateNetwork>. If any of the mentioned options are enabled, mount namespace | ||
| 386 | is implicitly delegated.', | ||
| 387 | 'DynamicUser' => "Takes a boolean parameter. If set, a UNIX user and group pair is allocated | ||
| 388 | dynamically when the unit is started, and released as soon as it is stopped. The user and group will | ||
| 389 | not be added to C</etc/passwd> or C</etc/group>, but are managed | ||
| 390 | transiently during runtime. The | ||
| 391 | L<nss-systemd(8)> glibc | ||
| 392 | NSS module provides integration of these dynamic users/groups into the system's user and group | ||
| 393 | databases. The user and group name to use may be configured via C<User> and | ||
| 394 | C<Group> (see above). If these options are not used and dynamic user/group | ||
| 395 | allocation is enabled for a unit, the name of the dynamic user/group is implicitly derived from the | ||
| 396 | unit name. If the unit name without the type suffix qualifies as valid user name it is used directly, | ||
| 397 | otherwise a name incorporating a hash of it is used. If a statically allocated user or group of the | ||
| 398 | configured name already exists, it is used and no dynamic user/group is allocated. Note that if | ||
| 399 | C<User> is specified and the static group with the name exists, then it is required | ||
| 400 | that the static user with the name already exists. Similarly, if C<Group> is | ||
| 401 | specified and the static user with the name exists, then it is required that the static group with | ||
| 402 | the name already exists. Dynamic users/groups are allocated from the UID/GID range 61184\x{2026}65519. It is | ||
| 403 | recommended to avoid this range for regular system or login users. At any point in time each UID/GID | ||
| 404 | from this range is only assigned to zero or one dynamically allocated users/groups in use. However, | ||
| 405 | UID/GIDs are recycled after a unit is terminated. Care should be taken that any processes running as | ||
| 406 | part of a unit for which dynamic users/groups are enabled do not leave files or directories owned by | ||
| 407 | these users/groups around, as a different unit might get the same UID/GID assigned later on, and thus | ||
| 408 | gain access to these files or directories. If C<DynamicUser> is enabled, | ||
| 409 | C<RemoveIPC> is implied (and cannot be turned off). This ensures that the lifetime | ||
| 410 | of IPC objects and temporary files created by the executed processes is bound to the runtime of the | ||
| 411 | service, and hence the lifetime of the dynamic user/group. Since C</tmp/> and | ||
| 412 | C</var/tmp/> are usually the only world-writable directories on a system, unless | ||
| 413 | C<PrivateTmp> is manually set to C<true>, C<disconnected> | ||
| 414 | would be implied. This ensures that a unit making use of dynamic user/group allocation cannot | ||
| 415 | leave files around after unit termination. Furthermore | ||
| 416 | C<NoNewPrivileges> and C<RestrictSUIDSGID> are implicitly enabled | ||
| 417 | (and cannot be disabled), to ensure that processes invoked cannot take benefit or create SUID/SGID | ||
| 418 | files or directories. Moreover, C<ProtectSystem=strict> and | ||
| 419 | C<ProtectHome=read-only> are implied, thus prohibiting the service to write to | ||
| 420 | arbitrary file system locations. In order to allow the service to write to certain directories, they | ||
| 421 | have to be allow-listed using C<ReadWritePaths>, but care must be taken so that | ||
| 422 | UID/GID recycling does not create security issues involving files created by the service. Use | ||
| 423 | C<RuntimeDirectory> (see below) in order to assign a writable runtime directory to a | ||
| 424 | service, owned by the dynamic user/group and removed automatically when the unit is terminated. Use | ||
| 425 | C<StateDirectory>, C<CacheDirectory> and | ||
| 426 | C<LogsDirectory> in order to assign a set of writable directories for specific | ||
| 427 | purposes to the service in a way that they are protected from vulnerabilities due to UID reuse (see | ||
| 428 | below). If this option is enabled, care should be taken that the unit's processes do not get access | ||
| 429 | to directories outside of these explicitly configured and managed ones. Specifically, do not use | ||
| 430 | C<BindPaths> and be careful with C<AF_UNIX> file descriptor | ||
| 431 | passing for directory file descriptors, as this would permit processes to create files or directories | ||
| 432 | owned by the dynamic user/group that are not subject to the lifecycle and access guarantees of the | ||
| 433 | service. Note that this option is currently incompatible with D-Bus policies, thus a service using | ||
| 434 | this option may currently not allocate a D-Bus service name (note that this does not affect calling | ||
| 435 | into other D-Bus services). Defaults to off.", | ||
| 436 | 'Environment' => "Sets environment variables for executed processes. Each line is unquoted using the | ||
| 437 | rules described in \"Quoting\" section in | ||
| 438 | L<systemd.syntax(7)> | ||
| 439 | and becomes a list of variable assignments. If you need to assign a value containing spaces or the | ||
| 440 | equals sign to a variable, put quotes around the whole assignment. Variable expansion is not | ||
| 441 | performed inside the strings and the C<\$> character has no special meaning. Specifier | ||
| 442 | expansion is performed, see the \"Specifiers\" section in | ||
| 443 | L<systemd.unit(5)>. | ||
| 444 | |||
| 445 | This option may be specified more than once, in which case all listed variables will be set. If | ||
| 446 | the same variable is listed twice, the later setting will override the earlier setting. If the empty | ||
| 447 | string is assigned to this option, the list of environment variables is reset, all prior assignments | ||
| 448 | have no effect. | ||
| 449 | |||
| 450 | The names of the variables can contain ASCII letters, digits, and the underscore character. | ||
| 451 | Variable names cannot be empty or start with a digit. In variable values, most characters are | ||
| 452 | allowed, but non-printable characters are currently rejected. | ||
| 453 | |||
| 454 | Example: | ||
| 455 | |||
| 456 | Environment=\"VAR1=word1 word2\" VAR2=word3 \"VAR3=\$word 5 6\" | ||
| 457 | |||
| 458 | gives three variables C<VAR1>, | ||
| 459 | C<VAR2>, C<VAR3> | ||
| 460 | with the values C<word1 word2>, | ||
| 461 | C<word3>, C<\$word 5 6>. | ||
| 462 | |||
| 463 | See L<environ(7)> for | ||
| 464 | details about environment variables. | ||
| 465 | |||
| 466 | Note that environment variables are not suitable for passing secrets (such as passwords, key | ||
| 467 | material, \x{2026}) to service processes. Environment variables set for a unit are exposed to unprivileged | ||
| 468 | clients via D-Bus IPC, and generally not understood as being data that requires protection. Moreover, | ||
| 469 | environment variables are propagated down the process tree, including across security boundaries | ||
| 470 | (such as setuid/setgid executables), and hence might leak to processes that should not have access to | ||
| 471 | the secret data. Use C<LoadCredential>, C<LoadCredentialEncrypted> | ||
| 472 | or C<SetCredentialEncrypted> (see below) to pass data to unit processes | ||
| 473 | securely.", | ||
| 474 | 'EnvironmentFile' => 'Similar to C<Environment>, but reads the environment variables from | ||
| 475 | a text file. The text file should contain newline-separated variable assignments. Empty lines, lines | ||
| 476 | without an C<=> separator, or lines starting with C<;> or | ||
| 477 | C<#> will be ignored, which may be used for commenting. The file must be encoded with | ||
| 478 | UTF-8. Valid characters are | ||
| 479 | L<unicode scalar values|https://www.unicode.org/glossary/#unicode_scalar_value> | ||
| 480 | other than | ||
| 481 | L<unicode noncharacters|https://www.unicode.org/glossary/#noncharacter>, | ||
| 482 | C<U+0000> C<NUL>, and C<U+FEFF>L<unicode byte order mark|https://www.unicode.org/glossary/#byte_order_mark>. | ||
| 483 | Control codes other than C<NUL> are allowed. | ||
| 484 | |||
| 485 | In the file, an unquoted value after the C<=> is parsed with the same backslash-escape | ||
| 486 | rules as L<POSIX shell unquoted | ||
| 487 | text|https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02_01>, but unlike in a shell, | ||
| 488 | interior whitespace is preserved and quotes after the | ||
| 489 | first non-whitespace character are preserved. Leading and trailing whitespace (space, tab, carriage return) is | ||
| 490 | discarded, but interior whitespace within the line is preserved verbatim. A line ending with a backslash will be | ||
| 491 | continued to the following one, with the newline itself discarded. A backslash | ||
| 492 | C<\\> followed by any character other than newline will preserve the following character, so that | ||
| 493 | C<\\\\> will become the value C<\\>. | ||
| 494 | |||
| 495 | In the file, a C<\'>-quoted value after the C<=> can span | ||
| 496 | multiple lines and contain any character verbatim other than single quote, like L<POSIX | ||
| 497 | shell single-quoted text|https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02_02>. No | ||
| 498 | backslash-escape sequences are recognized. Leading and trailing | ||
| 499 | whitespace outside of the single quotes is discarded. | ||
| 500 | |||
| 501 | In the file, a C<">-quoted value after the C<=> can span | ||
| 502 | multiple lines, and the same escape sequences are recognized as in L<POSIX | ||
| 503 | shell double-quoted text|https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02_03>. | ||
| 504 | Backslash (C<\\>) followed by any of | ||
| 505 | C<"\\`$> will preserve that character. A backslash followed by newline is a line | ||
| 506 | continuation, and the newline itself is discarded. A backslash followed by any other character is | ||
| 507 | ignored; both the backslash and the following character are preserved verbatim. Leading and trailing | ||
| 508 | whitespace outside of the double quotes is discarded. | ||
| 509 | |||
| 510 | The argument passed should be an absolute filename or wildcard expression. If the file does not | ||
| 511 | exist, cannot be read, or contains invalid content, the service will fail to start. To make the file | ||
| 512 | optional, prefix the path with C<->, which causes all errors related to the file to be | ||
| 513 | silently ignored. This option may be specified more than once in which case all specified files are read. | ||
| 514 | If the empty string is assigned to this option, the list of files to read is reset, all prior assignments | ||
| 515 | have no effect. | ||
| 516 | |||
| 517 | Note that shell variables such as C<$HOME> are not expanded in this path. | ||
| 518 | Use C<%>-specifiers instead; for example, C<%h> expands to the | ||
| 519 | user\'s home directory. | ||
| 520 | |||
| 521 | The files listed with this directive will be read shortly before the process is executed (more | ||
| 522 | specifically, after all processes from a previous unit state terminated. This means you can generate these | ||
| 523 | files in one unit state, and read it with this option in the next. The files are read from the file | ||
| 524 | system of the service manager, before any file system changes like bind mounts take place). | ||
| 525 | |||
| 526 | Settings from these files override settings made with C<Environment>. If the same | ||
| 527 | variable is set twice from these files, the files will be read in the order they are specified and the later | ||
| 528 | setting will override the earlier setting.', | ||
| 529 | 'ExecPaths' => 'Sets up a new file system namespace for executed processes. These options may be used | ||
| 530 | to limit access a process has to the file system. Each setting takes a space-separated list of paths | ||
| 531 | relative to the host\'s root directory (i.e. the system running the service manager). Note that if | ||
| 532 | paths contain symlinks, they are resolved relative to the root directory set with | ||
| 533 | C<RootDirectory>/C<RootImage>. | ||
| 534 | |||
| 535 | Paths listed in C<ReadWritePaths> are accessible from within the namespace | ||
| 536 | with the same access modes as from outside of it. Paths listed in C<ReadOnlyPaths> | ||
| 537 | are accessible for reading only, writing will be refused even if the usual file access controls would | ||
| 538 | permit this. Nest C<ReadWritePaths> inside of C<ReadOnlyPaths> in | ||
| 539 | order to provide writable subdirectories within read-only directories. Use | ||
| 540 | C<ReadWritePaths> in order to allow-list specific paths for write access if | ||
| 541 | C<ProtectSystem=strict> is used. Note that C<ReadWritePaths> cannot | ||
| 542 | be used to gain write access to a file system whose superblock is mounted read-only. On Linux, for | ||
| 543 | each mount point write access is granted only if the mount point itself and the | ||
| 544 | file system superblock backing it are not marked read-only. C<ReadWritePaths> only | ||
| 545 | controls the former, not the latter, hence a read-only file system superblock remains | ||
| 546 | protected. | ||
| 547 | |||
| 548 | Paths listed in C<InaccessiblePaths> will be made inaccessible for processes inside | ||
| 549 | the namespace along with everything below them in the file system hierarchy. This may be more restrictive than | ||
| 550 | desired, because it is not possible to nest C<ReadWritePaths>, C<ReadOnlyPaths>, | ||
| 551 | C<BindPaths>, or C<BindReadOnlyPaths> inside it. For a more flexible option, | ||
| 552 | see C<TemporaryFileSystem>. | ||
| 553 | |||
| 554 | Content in paths listed in C<NoExecPaths> are not executable even if the usual | ||
| 555 | file access controls would permit this. Nest C<ExecPaths> inside of | ||
| 556 | C<NoExecPaths> in order to provide executable content within non-executable | ||
| 557 | directories. | ||
| 558 | |||
| 559 | Non-directory paths may be specified as well. These options may be specified more than once, | ||
| 560 | in which case all paths listed will have limited access from within the namespace. If the empty string is | ||
| 561 | assigned to this option, the specific list is reset, and all prior assignments have no effect. | ||
| 562 | |||
| 563 | Paths in C<ReadWritePaths>, C<ReadOnlyPaths>, | ||
| 564 | C<InaccessiblePaths>, C<ExecPaths> and | ||
| 565 | C<NoExecPaths> may be prefixed with C<->, in which case they will be | ||
| 566 | ignored when they do not exist. If prefixed with C<+> the paths are taken relative to the root | ||
| 567 | directory of the unit, as configured with C<RootDirectory>/C<RootImage>, | ||
| 568 | instead of relative to the root directory of the host (see above). When combining C<-> and | ||
| 569 | C<+> on the same path make sure to specify C<-> first, and C<+> | ||
| 570 | second. | ||
| 571 | |||
| 572 | Note that these settings will disconnect propagation of mounts from the unit\'s processes to the | ||
| 573 | host. This means that this setting may not be used for services which shall be able to install mount points in | ||
| 574 | the main mount namespace. For C<ReadWritePaths> and C<ReadOnlyPaths>, | ||
| 575 | propagation in the other direction is not affected, i.e. mounts created on the host generally appear in the | ||
| 576 | unit processes\' namespace, and mounts removed on the host also disappear there too. In particular, note that | ||
| 577 | mount propagation from host to unit will result in unmodified mounts to be created in the unit\'s namespace, | ||
| 578 | i.e. writable mounts appearing on the host will be writable in the unit\'s namespace too, even when propagated | ||
| 579 | below a path marked with C<ReadOnlyPaths>! Restricting access with these options hence does | ||
| 580 | not extend to submounts of a directory that are created later on. This means the lock-down offered by that | ||
| 581 | setting is not complete, and does not offer full protection. | ||
| 582 | |||
| 583 | Note that the effect of these settings may be undone by privileged processes. In order to set up an | ||
| 584 | effective sandboxed environment for a unit it is thus recommended to combine these settings with either | ||
| 585 | C<CapabilityBoundingSet=~CAP_SYS_ADMIN> or C<SystemCallFilter=~@mount>. | ||
| 586 | |||
| 587 | Please be extra careful when applying these options to API file systems (a list of them could be | ||
| 588 | found in C<MountAPIVPS>), since they may be required for basic system functionalities. | ||
| 589 | Moreover, C</run/> needs to be writable for setting up mount namespace and propagation. | ||
| 590 | |||
| 591 | Simple allow-list example using these directives: | ||
| 592 | |||
| 593 | [Service] | ||
| 594 | ReadOnlyPaths=/ | ||
| 595 | ReadWritePaths=/var /run | ||
| 596 | InaccessiblePaths=-/lost+found | ||
| 597 | NoExecPaths=/ | ||
| 598 | ExecPaths=/usr/sbin/my_daemon /usr/lib /usr/lib64 | ||
| 599 | ', | ||
| 600 | 'ExecSearchPath' => 'Takes a colon separated list of absolute paths relative to which the executable | ||
| 601 | used by the C<Exec*=> (e.g. C<ExecStart>, | ||
| 602 | C<ExecStop>, etc.) properties can be found. C<ExecSearchPath> | ||
| 603 | overrides C<$PATH> if C<$PATH> is not supplied by the user through | ||
| 604 | C<Environment>, C<EnvironmentFile> or | ||
| 605 | C<PassEnvironment>. Assigning an empty string removes previous assignments | ||
| 606 | and setting C<ExecSearchPath> to a value multiple times will append | ||
| 607 | to the previous setting. | ||
| 608 | ', | ||
| 609 | 'ExtensionDirectories' => 'This setting is similar to C<BindReadOnlyPaths> in that it mounts a file | ||
| 610 | system hierarchy from a directory, but instead of providing a destination path, an overlay will be set | ||
| 611 | up. This option expects a whitespace separated list of source directories. | ||
| 612 | |||
| 613 | A read-only OverlayFS will be set up on top of C</usr/> and | ||
| 614 | C</opt/> hierarchies for sysext images and C</etc/> | ||
| 615 | hierarchy for confext images. The order in which the directories are listed will determine | ||
| 616 | the order in which the overlay is laid down: directories specified first to last will result in overlayfs | ||
| 617 | layers bottom to top. | ||
| 618 | |||
| 619 | Each directory listed in C<ExtensionDirectories> may be prefixed with C<->, | ||
| 620 | in which case it will be ignored when its source path does not exist. Any mounts created with this option are | ||
| 621 | specific to the unit, and are not visible in the host\'s mount table. | ||
| 622 | |||
| 623 | These settings may be used more than once, each usage appends to the unit\'s list of directories | ||
| 624 | paths. If the empty string is assigned, the entire list of mount paths defined prior to this is | ||
| 625 | reset. | ||
| 626 | |||
| 627 | Each sysext directory must contain a C</usr/lib/extension-release.d/extension-release.IMAGE> | ||
| 628 | file while each confext directory must carry a C</etc/extension-release.d/extension-release.IMAGE> | ||
| 629 | file, with the appropriate metadata which matches C<RootImage>/C<RootDirectory> | ||
| 630 | or the host. See: | ||
| 631 | L<os-release(5)>. | ||
| 632 | |||
| 633 | If a service employs this option with | ||
| 634 | L<systemd.v(7)>, | ||
| 635 | and has C<RefreshOnReload=extensions> enabled (the default), the confexts will | ||
| 636 | be refreshed to pick up any changes on service reload. This only applies to confext extensions. | ||
| 637 | Note that in case a service has this configuration enabled at first, and then it is subsequently | ||
| 638 | removed in an update followed by a daemon-reload operation, reloading the confexts will be a no-op, | ||
| 639 | and a full service restart is required instead. See | ||
| 640 | L<systemd.service(5)> | ||
| 641 | also for details. | ||
| 642 | |||
| 643 | Note that usage from user units requires overlayfs support in unprivileged user namespaces, | ||
| 644 | which was first introduced in kernel v5.11.', | ||
| 645 | 'ExtensionImagePolicy' => 'Takes an image policy string as per | ||
| 646 | L<systemd.image-policy(7)> | ||
| 647 | to use when mounting the disk images (DDI) specified in C<RootImage>, | ||
| 648 | C<MountImage>, C<ExtensionImage>, respectively. If not specified | ||
| 649 | the following policy string is the default for C<RootImagePolicy> and C<MountImagePolicy>: | ||
| 650 | |||
| 651 | root=verity+signed+encrypted+unprotected+absent: \\ | ||
| 652 | usr=verity+signed+encrypted+unprotected+absent: \\ | ||
| 653 | home=encrypted+unprotected+absent: \\ | ||
| 654 | srv=encrypted+unprotected+absent: \\ | ||
| 655 | tmp=encrypted+unprotected+absent: \\ | ||
| 656 | var=encrypted+unprotected+absent | ||
| 657 | |||
| 658 | The default policy for C<ExtensionImagePolicy> is: | ||
| 659 | |||
| 660 | root=verity+signed+encrypted+unprotected+absent: \\ | ||
| 661 | usr=verity+signed+encrypted+unprotected+absent | ||
| 662 | ', | ||
| 663 | 'ExtensionImages' => 'This setting is similar to C<MountImages> in that it mounts a file | ||
| 664 | system hierarchy from a block device node or loopback file, but instead of providing a destination | ||
| 665 | path, an overlay will be set up. This option expects a whitespace separated list of mount | ||
| 666 | definitions. Each definition consists of a source path, optionally followed by a colon and a list of | ||
| 667 | mount options. | ||
| 668 | |||
| 669 | A read-only OverlayFS will be set up on top of C</usr/> and | ||
| 670 | C</opt/> hierarchies for sysext images and C</etc/> | ||
| 671 | hierarchy for confext images. The order in which the images are listed will determine the | ||
| 672 | order in which the overlay is laid down: images specified first to last will result in overlayfs | ||
| 673 | layers bottom to top. | ||
| 674 | |||
| 675 | Mount options may be defined as a single comma-separated list of options, in which case they | ||
| 676 | will be implicitly applied to the root partition on the image, or a series of colon-separated tuples | ||
| 677 | of partition name and mount options. Valid partition names and mount options are the same as for | ||
| 678 | C<RootImageOptions> setting described above. | ||
| 679 | |||
| 680 | Each mount definition may be prefixed with C<->, in which case it will be | ||
| 681 | ignored when its source path does not exist. The source argument is a path to a block device node or | ||
| 682 | regular file. If the source path contains a C<:>, it needs to be escaped as | ||
| 683 | C<\\:>. The device node or file system image file needs to follow the same rules as | ||
| 684 | specified for C<RootImage>. Any mounts created with this option are specific to the | ||
| 685 | unit, and are not visible in the host\'s mount table. | ||
| 686 | |||
| 687 | These settings may be used more than once, each usage appends to the unit\'s list of image | ||
| 688 | paths. If the empty string is assigned, the entire list of mount paths defined prior to this is | ||
| 689 | reset. | ||
| 690 | |||
| 691 | Each sysext image must carry a C</usr/lib/extension-release.d/extension-release.IMAGE> | ||
| 692 | file while each confext image must carry a C</etc/extension-release.d/extension-release.IMAGE> | ||
| 693 | file, with the appropriate metadata which matches C<RootImage>/C<RootDirectory> | ||
| 694 | or the host. See: | ||
| 695 | L<os-release(5)>. | ||
| 696 | To disable the safety check that the extension-release file name matches the image file name, the | ||
| 697 | C<x-systemd.relax-extension-release-check> mount option may be appended. | ||
| 698 | |||
| 699 | If a service employs this option with | ||
| 700 | L<systemd.v(7)>, | ||
| 701 | and has C<RefreshOnReload=extensions> enabled (the default), the confexts will | ||
| 702 | be refreshed to pick up any changes on service reload. This only applies to confext extensions. | ||
| 703 | Note that in case a service has this configuration enabled at first, and then it is subsequently | ||
| 704 | removed in an update followed by a daemon-reload operation, reloading the confexts will be a no-op, | ||
| 705 | and a full service restart is required instead. See | ||
| 706 | L<systemd.service(5)> | ||
| 707 | also for details. | ||
| 708 | |||
| 709 | When C<DevicePolicy> is set to C<closed> or | ||
| 710 | C<strict>, or set to C<auto> and C<DeviceAllow> is | ||
| 711 | set, then this setting adds C</dev/loop-control> with C<rw> mode, | ||
| 712 | C<block-loop> and C<block-blkext> with C<rwm> mode | ||
| 713 | to C<DeviceAllow>. See | ||
| 714 | L<systemd.resource-control(5)> | ||
| 715 | for the details about C<DevicePolicy> or C<DeviceAllow>. Also, see | ||
| 716 | C<PrivateDevices> below, as it may change the setting of | ||
| 717 | C<DevicePolicy>.', | ||
| 718 | 'Group' => "Set the UNIX user or group that the processes are executed as, respectively. Takes a single | ||
| 719 | user or group name, or a numeric ID as argument. For system services (services run by the system service | ||
| 720 | manager, i.e. managed by PID 1) and for user services of the root user (services managed by root's instance of | ||
| 721 | systemd --user), the default is C<root>, but C<User> may be | ||
| 722 | used to specify a different user. For user services of any other user, switching user identity is not | ||
| 723 | permitted, hence the only valid setting is the same user the user's service manager is running as. If no group | ||
| 724 | is set, the default group of the user is used. This setting does not affect commands whose command line is | ||
| 725 | prefixed with C<+>. | ||
| 726 | |||
| 727 | Note that this enforces only weak restrictions on the user/group name syntax, but will generate | ||
| 728 | warnings in many cases where user/group names do not adhere to the following rules: the specified | ||
| 729 | name should consist only of the characters a-z, A-Z, 0-9, C<_> and | ||
| 730 | C<->, except for the first character which must be one of a-z, A-Z and | ||
| 731 | C<_> (i.e. digits and C<-> are not permitted as first character). The | ||
| 732 | user/group name must have at least one character, and at most 31. These restrictions are made in | ||
| 733 | order to avoid ambiguities and to ensure user/group names and unit files remain portable among Linux | ||
| 734 | systems. For further details on the names accepted and the names warned about see L<User/Group Name | ||
| 735 | Syntax|https://systemd.io/USER_NAMES>. | ||
| 736 | |||
| 737 | When used in conjunction with C<DynamicUser> the user/group name specified is | ||
| 738 | dynamically allocated at the time the service is started, and released at the time the service is | ||
| 739 | stopped \x{2014} unless it is already allocated statically (see below). If C<DynamicUser> | ||
| 740 | is not used the specified user and group must have been created statically in the user database no | ||
| 741 | later than the moment the service is started, for example using the | ||
| 742 | L<sysusers.d(5)> | ||
| 743 | facility, which is applied at boot or package install time. If the user does not exist by then | ||
| 744 | program invocation will fail. | ||
| 745 | |||
| 746 | If the C<User> setting is used the supplementary group list is initialized | ||
| 747 | from the specified user's default group list, as defined in the system's user and group | ||
| 748 | database. Additional groups may be configured through the C<SupplementaryGroups> | ||
| 749 | setting (see below).", | ||
| 750 | 'IOSchedulingClass' => 'Sets the I/O scheduling class for executed processes. Takes one of the strings | ||
| 751 | C<realtime>, C<best-effort> or C<idle>. The kernel\'s | ||
| 752 | default scheduling class is C<best-effort> at a priority of 4. If the empty string is | ||
| 753 | assigned to this option, all prior assignments to both C<IOSchedulingClass> and | ||
| 754 | C<IOSchedulingPriority> have no effect. See | ||
| 755 | L<ioprio_set(2)> for | ||
| 756 | details.', | ||
| 757 | 'IOSchedulingPriority' => 'Sets the I/O scheduling priority for executed processes. Takes an integer between 0 | ||
| 758 | (highest priority) and 7 (lowest priority). In case of I/O contention, smaller values mean more I/O | ||
| 759 | bandwidth is made available to the unit\'s processes, larger values mean less bandwidth. The available | ||
| 760 | priorities depend on the selected I/O scheduling class (see above). If the empty string is assigned | ||
| 761 | to this option, all prior assignments to both C<IOSchedulingClass> and | ||
| 762 | C<IOSchedulingPriority> have no effect. For the kernel\'s default scheduling class | ||
| 763 | (C<best-effort>) this defaults to 4. See | ||
| 764 | L<ioprio_set(2)> for | ||
| 765 | details.', | ||
| 766 | 'IPCNamespacePath' => 'Takes an absolute file system path referring to a Linux IPC namespace | ||
| 767 | pseudo-file (i.e. a file like C</proc/$PID/ns/ipc> or a bind mount or symlink to | ||
| 768 | one). When set the invoked processes are added to the network namespace referenced by that path. The | ||
| 769 | path has to point to a valid namespace file at the moment the processes are forked off. If this | ||
| 770 | option is used C<PrivateIPC> has no effect. If this option is used together with | ||
| 771 | C<JoinsNamespaceOf> then it only has an effect if this unit is started before any of | ||
| 772 | the listed units that have C<PrivateIPC> or | ||
| 773 | C<IPCNamespacePath> configured, as otherwise the network namespace of those | ||
| 774 | units is reused.', | ||
| 775 | 'IgnoreSIGPIPE' => 'Takes a boolean argument. If true, C<SIGPIPE> is ignored in the | ||
| 776 | executed process. Defaults to true since C<SIGPIPE> is generally only useful in | ||
| 777 | shell pipelines.', | ||
| 778 | 'ImportCredential' => "Pass one or more credentials to the unit. Takes a credential name for which we will | ||
| 779 | attempt to find a credential that the service manager itself received under the specified name \x{2014} | ||
| 780 | which may be used to propagate credentials from an invoking environment (e.g. a container manager | ||
| 781 | that invoked the service manager) into a service. If the credential name is a glob, all credentials | ||
| 782 | matching the glob are passed to the unit. Matching credentials are searched for in the system | ||
| 783 | credentials, the encrypted system credentials, and under C</etc/credstore/>, | ||
| 784 | C</run/credstore/>, C</usr/lib/credstore/>, | ||
| 785 | C</run/credstore.encrypted/>, C</etc/credstore.encrypted/>, and | ||
| 786 | C</usr/lib/credstore.encrypted/> in that order. When multiple credentials of the | ||
| 787 | same name are found, the first one found is used. | ||
| 788 | |||
| 789 | The globbing expression implements a restrictive subset of L<glob(7)>: only | ||
| 790 | a single trailing C<*> wildcard may be specified. Both C<?> and | ||
| 791 | C<[]> wildcards are not permitted, nor are C<*> wildcards anywhere | ||
| 792 | except at the end of the glob expression. | ||
| 793 | |||
| 794 | Optionally, the credential name or glob may be followed by a colon followed by a rename pattern. | ||
| 795 | If specified, all credentials matching the credential name or glob are renamed according to the given | ||
| 796 | pattern. For example, if C<ImportCredential=my.original.cred:my.renamed.cred> is | ||
| 797 | specified, the service manager will read the C<my.original.cred> credential and make | ||
| 798 | it available as the C<my.renamed.cred> credential to the service. Similarly, if | ||
| 799 | C<ImportCredential=my.original.*:my.renamed.> is specified, the service manager will | ||
| 800 | read all credentials starting with C<my.original.> and make them available as | ||
| 801 | C<my.renamed.xxx> to the service. | ||
| 802 | |||
| 803 | If C<ImportCredential> is specified multiple times and multiple credentials | ||
| 804 | end up with the same name after renaming, the first one is kept and later ones are dropped. | ||
| 805 | |||
| 806 | When multiple credentials of the same name are found, credentials found by | ||
| 807 | C<LoadCredential> and C<LoadCredentialEncrypted> take priority over | ||
| 808 | credentials found by C<ImportCredential>. | ||
| 809 | |||
| 810 | Note that if decryption or authentication of a credential picked up as result of | ||
| 811 | C<ImportCredential> fails it will be skipped gracefully (a warning is generated, but | ||
| 812 | the credential will not be made available to the invoked service). This is different for those | ||
| 813 | configured via | ||
| 814 | C<SetCredentialEncrypted>/C<LoadCredentialEncrypted>, where failed | ||
| 815 | decryption/authentication will result in service failure.", | ||
| 816 | 'InaccessiblePaths' => '*ExecPaths', | ||
| 817 | 'KeyringMode' => 'Controls how the kernel session keyring is set up for the service (see L<session-keyring(7)> for | ||
| 818 | details on the session keyring). Takes one of C<inherit>, C<private>, | ||
| 819 | C<shared>. If set to C<inherit> no special keyring setup is done, and the kernel\'s | ||
| 820 | default behaviour is applied. If C<private> is used a new session keyring is allocated when a | ||
| 821 | service process is invoked, and it is not linked up with any user keyring. This is the recommended setting for | ||
| 822 | system services, as this ensures that multiple services running under the same system user ID (in particular | ||
| 823 | the root user) do not share their key material among each other. If C<shared> is used a new | ||
| 824 | session keyring is allocated as for C<private>, but the user keyring of the user configured with | ||
| 825 | C<User> is linked into it, so that keys assigned to the user may be requested by the unit\'s | ||
| 826 | processes. In this mode multiple units running processes under the same user ID may share key material. Unless | ||
| 827 | C<inherit> is selected the unique invocation ID for the unit (see below) is added as a protected | ||
| 828 | key by the name C<invocation_id> to the newly created session keyring. Defaults to | ||
| 829 | C<private> for services of the system service manager and to C<inherit> for | ||
| 830 | non-service units and for services of the user service manager.', | ||
| 831 | 'LimitAS' => "Set soft and hard limits on various resources for executed processes. See | ||
| 832 | L<setrlimit(2)> for | ||
| 833 | details on the process resource limit concept. Process resource limits may be specified in two formats: | ||
| 834 | either as single value to set a specific soft and hard limit to the same value, or as colon-separated | ||
| 835 | pair C<soft:hard> to set both limits individually | ||
| 836 | (e.g. C<LimitAS=4G:16G>). Use the string C<infinity> to configure no | ||
| 837 | limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may | ||
| 838 | be used for resource limits measured in bytes (e.g. C<LimitAS=16G>). For the limits | ||
| 839 | referring to time values, the usual time units ms, s, min, h and so on may be used (see | ||
| 840 | L<systemd.time(7)> for | ||
| 841 | details). Note that if no time unit is specified for C<LimitCPU> the default unit of | ||
| 842 | seconds is implied, while for C<LimitRTTIME> the default unit of microseconds is | ||
| 843 | implied. Also, note that the effective granularity of the limits might influence their | ||
| 844 | enforcement. For example, time limits specified for C<LimitCPU> will be rounded up | ||
| 845 | implicitly to multiples of 1s. For C<LimitNICE> the value may be specified in two | ||
| 846 | syntaxes: if prefixed with C<+> or C<->, the value is understood as | ||
| 847 | regular Linux nice value in the range -20\x{2026}19. If not prefixed like this the value is understood as | ||
| 848 | raw resource limit parameter in the range 0\x{2026}40 (with 0 being equivalent to 1). | ||
| 849 | |||
| 850 | Note that most process resource limits configured with these options are per-process, and | ||
| 851 | processes may fork in order to acquire a new set of resources that are accounted independently of the | ||
| 852 | original process, and may thus escape limits set. Also note that C<LimitRSS> is not | ||
| 853 | implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource | ||
| 854 | controls listed in | ||
| 855 | L<systemd.resource-control(5)> | ||
| 856 | over these per-process limits, as they apply to services as a whole, may be altered dynamically at | ||
| 857 | runtime, and are generally more expressive. For example, C<MemoryMax> is a more | ||
| 858 | powerful (and working) replacement for C<LimitRSS>. | ||
| 859 | |||
| 860 | Note that C<LimitNPROC> will limit the number of processes from one (real) UID and | ||
| 861 | not the number of processes started (forked) by the service. Therefore the limit is cumulative for all | ||
| 862 | processes running under the same UID. Please also note that the C<LimitNPROC> will not be | ||
| 863 | enforced if the service is running as root (and not dropping privileges). Due to these limitations, | ||
| 864 | C<TasksMax> (see L<systemd.resource-control(5)>) is typically a better choice than C<LimitNPROC>. | ||
| 865 | |||
| 866 | Resource limits not configured explicitly for a unit default to the value configured in the various | ||
| 867 | C<DefaultLimitCPU>, C<DefaultLimitFSIZE>, \x{2026} options available in | ||
| 868 | L<systemd-system.conf(5)>, and \x{2013} | ||
| 869 | if not configured there \x{2013} the kernel or per-user defaults, as defined by the OS (the latter only for user | ||
| 870 | services, see below). | ||
| 871 | |||
| 872 | For system units these resource limits may be chosen freely. When these settings are configured | ||
| 873 | in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be | ||
| 874 | used to raise the limits above those set for the user manager itself when it was first invoked, as | ||
| 875 | the user's service manager generally lacks the privileges to do so. In user context these | ||
| 876 | configuration options are hence only useful to lower the limits passed in or to raise the soft limit | ||
| 877 | to the maximum of the hard limit as configured for the user. To raise the user's limits further, the | ||
| 878 | available configuration mechanisms differ between operating systems, but typically require | ||
| 879 | privileges. In most cases it is possible to configure higher per-user resource limits via PAM or by | ||
| 880 | setting limits on the system service encapsulating the user's service manager, i.e. the user's | ||
| 881 | instance of C<user\@.service>. After making such changes, make sure to restart the | ||
| 882 | user's service manager.", | ||
| 883 | 'LimitCORE' => '*LimitAS', | ||
| 884 | 'LimitCPU' => '*LimitAS', | ||
| 885 | 'LimitDATA' => '*LimitAS', | ||
| 886 | 'LimitFSIZE' => '*LimitAS', | ||
| 887 | 'LimitLOCKS' => '*LimitAS', | ||
| 888 | 'LimitMEMLOCK' => '*LimitAS', | ||
| 889 | 'LimitMSGQUEUE' => '*LimitAS', | ||
| 890 | 'LimitNICE' => '*LimitAS', | ||
| 891 | 'LimitNOFILE' => '*LimitAS', | ||
| 892 | 'LimitNPROC' => '*LimitAS', | ||
| 893 | 'LimitRSS' => '*LimitAS', | ||
| 894 | 'LimitRTPRIO' => '*LimitAS', | ||
| 895 | 'LimitRTTIME' => '*LimitAS', | ||
| 896 | 'LimitSIGPENDING' => '*LimitAS', | ||
| 897 | 'LimitSTACK' => '*LimitAS', | ||
| 898 | 'LoadCredential' => "Pass a credential to the unit. Credentials are limited-size binary or textual objects | ||
| 899 | that may be passed to unit processes. They are primarily intended for passing cryptographic keys | ||
| 900 | (both public and private) or certificates, user account information or identity information from host | ||
| 901 | to services, but can be freely used to pass any kind of limited-size information to a service. The | ||
| 902 | data is accessible from the unit's processes via the file system, at a read-only location that (if | ||
| 903 | possible and permitted) is backed by non-swappable memory. The data is only accessible to the user | ||
| 904 | associated with the unit, via the C<User>/C<DynamicUser> settings | ||
| 905 | (as well as the superuser). When available, the location of credentials is exported as the | ||
| 906 | C<\$CREDENTIALS_DIRECTORY> environment variable to the unit's processes. | ||
| 907 | |||
| 908 | The C<LoadCredential> setting takes a textual ID to use as name for a | ||
| 909 | credential plus a file system path, separated by a colon. The ID must be a short ASCII string | ||
| 910 | suitable as filename in the filesystem, and may be chosen freely by the user. If the specified path | ||
| 911 | is absolute it is opened as regular file and the credential data is read from it. If the absolute | ||
| 912 | path refers to an C<AF_UNIX> stream socket in the file system a connection is made | ||
| 913 | to it (once at process invocation) and the credential data read from the connection, providing an | ||
| 914 | easy IPC integration point for dynamically transferring credentials from other services. | ||
| 915 | |||
| 916 | If the specified path is not absolute and itself qualifies as valid credential identifier it is | ||
| 917 | attempted to find a credential that the service manager itself received under the specified name \x{2014} | ||
| 918 | which may be used to propagate credentials from an invoking environment (e.g. a container manager | ||
| 919 | that invoked the service manager) into a service. If no matching passed credential is found, the | ||
| 920 | system service manager will search the directories C</etc/credstore/>, | ||
| 921 | C</run/credstore/> and C</usr/lib/credstore/> for files under the | ||
| 922 | credential's name \x{2014} which hence are recommended locations for credential data on disk. If | ||
| 923 | C<LoadCredentialEncrypted> is used C</run/credstore.encrypted/>, | ||
| 924 | C</etc/credstore.encrypted/>, and | ||
| 925 | C</usr/lib/credstore.encrypted/> are searched as well. The per-user service manager | ||
| 926 | will search C<\$XDG_CONFIG_HOME/credstore/>, | ||
| 927 | C<\$XDG_RUNTIME_DIR/credstore/>, C<\$HOME/.local/lib/credstore/> | ||
| 928 | (and the counterparts ending with C<\x{2026}/credstore.encrypted/>) instead. The | ||
| 929 | L<systemd-path(1)> tool | ||
| 930 | may be used to query the precise credential store search path. | ||
| 931 | |||
| 932 | If the file system path is omitted it is chosen identical to the credential name, i.e. this is | ||
| 933 | a terse way to declare credentials to inherit from the service manager or credstore directories into | ||
| 934 | a service. This option may be used multiple times, each time defining an additional credential to | ||
| 935 | pass to the unit. | ||
| 936 | |||
| 937 | Note that if the path is not specified or a valid credential identifier is given, i.e. | ||
| 938 | in the above two cases, a missing credential is not considered fatal. | ||
| 939 | |||
| 940 | If an absolute path referring to a directory is specified, every file in that directory | ||
| 941 | (recursively) will be loaded as a separate credential. The ID for each credential will be the | ||
| 942 | provided ID suffixed with C<_\$FILENAME> (e.g., C<Key_file1>). When | ||
| 943 | loading from a directory, symlinks will be ignored. | ||
| 944 | |||
| 945 | The contents of the file/socket may be arbitrary binary or textual data, including newline | ||
| 946 | characters and C<NUL> bytes. | ||
| 947 | |||
| 948 | The C<LoadCredentialEncrypted> setting is identical to | ||
| 949 | C<LoadCredential>, except that the credential data is decrypted and authenticated | ||
| 950 | before being passed on to the executed processes. Specifically, the referenced path should refer to a | ||
| 951 | file or socket with an encrypted credential, as implemented by | ||
| 952 | L<systemd-creds(1)>. This | ||
| 953 | credential is loaded, decrypted, authenticated and then passed to the application in plaintext form, | ||
| 954 | in the same way a regular credential specified via C<LoadCredential> would be. A | ||
| 955 | credential configured this way may be symmetrically encrypted/authenticated with a secret key derived | ||
| 956 | from the system's TPM2 security chip, or with a secret key stored in | ||
| 957 | C</var/lib/systemd/credential.secret>, or with both. Using encrypted and | ||
| 958 | authenticated credentials improves security as credentials are not stored in plaintext and only | ||
| 959 | authenticated and decrypted into plaintext the moment a service requiring them is started. Moreover, | ||
| 960 | credentials may be bound to the local hardware and installations, so that they cannot easily be | ||
| 961 | analyzed offline, or be generated externally. See | ||
| 962 | L<systemd.resource-control(5)> | ||
| 963 | for the details about C<DevicePolicy> or C<DeviceAllow>. | ||
| 964 | |||
| 965 | Note that encrypted credentials targeted for services of the per-user service manager must be | ||
| 966 | encrypted with systemd-creds encrypt --user, and those for the system service | ||
| 967 | manager without the C<--user> switch. Encrypted credentials are always targeted to a | ||
| 968 | specific user or the system as a whole, and it is ensured that per-user service managers cannot | ||
| 969 | decrypt secrets intended for the system or for other users. | ||
| 970 | |||
| 971 | The credential files/IPC sockets must be accessible to the service manager, but do not have to | ||
| 972 | be directly accessible to the unit's processes: the credential data is read and copied into separate, | ||
| 973 | read-only copies for the unit that are accessible to appropriately privileged processes. This is | ||
| 974 | particularly useful in combination with C<DynamicUser> as this way privileged data | ||
| 975 | can be made available to processes running under a dynamic UID (i.e. not a previously known one) | ||
| 976 | without having to open up access to all users. | ||
| 977 | |||
| 978 | In order to reference the path a credential may be read from within a | ||
| 979 | C<ExecStart> command line use C<\${CREDENTIALS_DIRECTORY}/mycred>, | ||
| 980 | e.g. C<ExecStart=cat \${CREDENTIALS_DIRECTORY}/mycred>. In order to reference the path | ||
| 981 | a credential may be read from within a C<Environment> line use | ||
| 982 | C<%d/mycred>, e.g. C<Environment=MYCREDPATH=%d/mycred>. For system | ||
| 983 | services the path may also be referenced as | ||
| 984 | C</run/credentials/UNITNAME> in cases where no | ||
| 985 | interpolation is possible, e.g. configuration files of software that does not yet support credentials | ||
| 986 | natively. C<\$CREDENTIALS_DIRECTORY> is considered the primary interface to look for | ||
| 987 | credentials, though, since it also works for user services. | ||
| 988 | |||
| 989 | Currently, an accumulated credential size limit of 1 MB per unit is enforced. | ||
| 990 | |||
| 991 | The service manager itself may receive system credentials that can be propagated to services | ||
| 992 | from a hosting container manager or VM hypervisor. See the L<Container | ||
| 993 | Interface|https://systemd.io/CONTAINER_INTERFACE> documentation for details | ||
| 994 | about the former. For the latter, pass L<DMI/SMBIOS|https://www.dmtf.org/standards/smbios> OEM string table entries | ||
| 995 | (field type | ||
| 996 | 11) with a prefix of C<io.systemd.credential:> or | ||
| 997 | C<io.systemd.credential.binary:>. In both cases a key/value pair separated by | ||
| 998 | C<=> is expected. In the latter case, the right-hand side is Base64 decoded when | ||
| 999 | parsed (thus permitting binary data to be passed in). Example | ||
| 1000 | L<qemu|https://www.qemu.org/docs/master/system/index.html> switch: C<-smbios | ||
| 1001 | type=11,value=io.systemd.credential:xx=yy>, or C<-smbios | ||
| 1002 | type=11,value=io.systemd.credential.binary:rick=TmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXA=>. Alternatively, | ||
| 1003 | use the qemu C<fw_cfg> node | ||
| 1004 | C<opt/io.systemd.credentials/>. Example qemu switch: | ||
| 1005 | C<-fw_cfg name=opt/io.systemd.credentials/mycred,string=supersecret>. They may also | ||
| 1006 | be passed from the UEFI firmware environment via | ||
| 1007 | L<systemd-stub(7)>, | ||
| 1008 | from the initrd (see | ||
| 1009 | L<systemd(1)>), or be | ||
| 1010 | specified on the kernel command line using the C<systemd.set_credential=> and | ||
| 1011 | C<systemd.set_credential_binary=> switches (see | ||
| 1012 | L<systemd(1)> \x{2013} this is | ||
| 1013 | not recommended since unprivileged userspace can read the kernel command line). | ||
| 1014 | |||
| 1015 | If referencing an C<AF_UNIX> stream socket to connect to, the connection will | ||
| 1016 | originate from an abstract namespace socket, that includes information about the unit and the | ||
| 1017 | credential ID in its socket name. Use L<getpeername(2)> | ||
| 1018 | to query this information. The returned socket name is formatted as C<NUL>RANDOM C</unit/> UNITC</> ID, i.e. a C<NUL> | ||
| 1019 | byte (as required | ||
| 1020 | for abstract namespace socket names), followed by a random string (consisting of alphadecimal | ||
| 1021 | characters), followed by the literal string C</unit/>, followed by the requesting | ||
| 1022 | unit name, followed by the literal character C</>, followed by the textual credential | ||
| 1023 | ID requested. Example: C<\\0adf9d86b6eda275e/unit/foobar.service/credx> in case the | ||
| 1024 | credential C<credx> is requested for a unit C<foobar.service>. This | ||
| 1025 | functionality is useful for using a single listening socket to serve credentials to multiple | ||
| 1026 | consumers. | ||
| 1027 | |||
| 1028 | For further information see L<System and Service | ||
| 1029 | Credentials|https://systemd.io/CREDENTIALS> documentation.", | ||
| 1030 | 'LoadCredentialEncrypted' => '*LoadCredential', | ||
| 1031 | 'LockPersonality' => 'Takes a boolean argument. If set, locks down the L<personality(2)> system | ||
| 1032 | call so that the kernel execution domain may not be changed from the default or the personality selected with | ||
| 1033 | C<Personality> directive. This may be useful to improve security, because odd personality | ||
| 1034 | emulations may be poorly tested and source of vulnerabilities.', | ||
| 1035 | 'LogExtraFields' => 'Configures additional log metadata fields to include in all log records generated by | ||
| 1036 | processes associated with this unit, including systemd. This setting takes one or more journal field | ||
| 1037 | assignments in the format C<FIELD=VALUE> separated by whitespace. See | ||
| 1038 | L<systemd.journal-fields(7)> | ||
| 1039 | for details on the journal field concept. Even though the underlying journal implementation permits | ||
| 1040 | binary field values, this setting accepts only valid UTF-8 values. To include space characters in a | ||
| 1041 | journal field value, enclose the assignment in double quotes ("). | ||
| 1042 | The usual specifiers are expanded in all assignments (see below). Note that this setting is not only | ||
| 1043 | useful for attaching additional metadata to log records of a unit, but given that all fields and | ||
| 1044 | values are indexed may also be used to implement cross-unit log record matching. Assign an empty | ||
| 1045 | string to reset the list. | ||
| 1046 | |||
| 1047 | Note that this functionality is currently only available in system services, not in per-user | ||
| 1048 | services.', | ||
| 1049 | 'LogFilterPatterns' => 'Define an extended regular expression to filter log messages based on the | ||
| 1050 | C<MESSAGE> field of the structured message. If the first character of the pattern is | ||
| 1051 | C<~>, log entries matching the pattern should be discarded. This option takes a single | ||
| 1052 | pattern as an argument but can be used multiple times to create a list of allowed and denied patterns. | ||
| 1053 | If the empty string is assigned, the filter is reset, and all prior assignments will have no effect. | ||
| 1054 | |||
| 1055 | Because the C<~> character is used to define denied patterns, it must be replaced | ||
| 1056 | with C<\\x7e> to allow a message starting with C<~>. For example, | ||
| 1057 | C<~foobar> would add a pattern matching C<foobar> to the deny list, while | ||
| 1058 | C<\\x7efoobar> would add a pattern matching C<~foobar> to the allow list. | ||
| 1059 | |||
| 1060 | Log messages are tested against denied patterns (if any), then against allowed patterns | ||
| 1061 | (if any). If a log message matches any of the denied patterns, it is discarded immediately without considering | ||
| 1062 | allowed patterns. Remaining log messages are tested against allowed patterns. Messages matching | ||
| 1063 | against none of the allowed pattern are discarded. If no allowed patterns are defined, then all | ||
| 1064 | messages are processed directly after going through denied filters. | ||
| 1065 | |||
| 1066 | Filtering is based on the unit for which C<LogFilterPatterns> is defined, meaning log | ||
| 1067 | messages coming from | ||
| 1068 | L<systemd(1)> about the | ||
| 1069 | unit are not taken into account. Filtered log messages will not be forwarded to traditional syslog daemons, | ||
| 1070 | the kernel log buffer (kmsg), the systemd console, or sent as wall messages to all logged-in | ||
| 1071 | users. | ||
| 1072 | |||
| 1073 | Note that this functionality is currently only available in system services, not in per-user | ||
| 1074 | services.', | ||
| 1075 | 'LogLevelMax' => 'Sets the maximum log level for log messages generated by this unit. Takes a | ||
| 1076 | syslog log level, one of C<emerg> (lowest log level, only highest | ||
| 1077 | priority messages), C<alert>, C<crit>, C<err>, | ||
| 1078 | C<warning>, C<notice>, C<info>, C<debug> | ||
| 1079 | (highest log level, also lowest priority messages). See L<syslog(3)> for | ||
| 1080 | details. By default, the maximum log level is not overridden. | ||
| 1081 | |||
| 1082 | This option can be used to configure the logging system to drop log messages of a specific | ||
| 1083 | service above the specified level. For example, set | ||
| 1084 | C<LogLevelMax>=C<info> in order to turn off debug logging of a | ||
| 1085 | particularly chatty unit. Alternatively, this option can be used to enable extra logging about a | ||
| 1086 | specific unit by the system or user manager processes without changing the global log level for the | ||
| 1087 | system or user manager processes by setting C<LogLevelMax>=C<debug>. | ||
| 1088 | |||
| 1089 | Note that the configured level is applied to any log messages written by any of the processes | ||
| 1090 | belonging to this unit, as well as any log messages written by the system or user manager processes | ||
| 1091 | in reference to this unit, sent via any supported logging protocol. The override is applied early in | ||
| 1092 | the logging pipeline, before any kind of further processing is done. Moreover, messages which pass | ||
| 1093 | through this filter successfully might still be dropped by filters applied at a later stage in the | ||
| 1094 | logging subsystem. For example, C<MaxLevelStore> configured in | ||
| 1095 | L<journald.conf(5)> | ||
| 1096 | might prohibit messages of higher log levels to be stored on disk, even though the per-unit | ||
| 1097 | C<LogLevelMax> permitted it to be processed.', | ||
| 1098 | 'LogNamespace' => 'Run the unit\'s processes in the specified journal namespace. Expects a short | ||
| 1099 | user-defined string identifying the namespace. If not used the processes of the service are run in | ||
| 1100 | the default journal namespace, i.e. their log stream is collected and processed by | ||
| 1101 | C<systemd-journald.service>. If this option is used any log data generated by | ||
| 1102 | processes of this unit (regardless of whether via the syslog(), journal native logging | ||
| 1103 | or stdout/stderr logging) is collected and processed by an instance of the | ||
| 1104 | C<systemd-journald@.service> template unit, which manages the specified | ||
| 1105 | namespace. The log data is stored in a data store independent from the default log namespace\'s data | ||
| 1106 | store. See | ||
| 1107 | L<systemd-journald.service(8)> | ||
| 1108 | for details about journal namespaces. | ||
| 1109 | |||
| 1110 | Internally, journal namespaces are implemented through Linux mount namespacing and | ||
| 1111 | over-mounting the directory that contains the relevant C<AF_UNIX> sockets used for | ||
| 1112 | logging in the unit\'s mount namespace. Since mount namespaces are used this setting disconnects | ||
| 1113 | propagation of mounts from the unit\'s processes to the host, similarly to how | ||
| 1114 | C<ReadOnlyPaths> and similar settings describe above work. Journal namespaces may hence | ||
| 1115 | not be used for services that need to establish mount points on the host. | ||
| 1116 | |||
| 1117 | When this option is used the unit will automatically gain ordering and requirement dependencies | ||
| 1118 | on the two socket units associated with the C<systemd-journald@.service> instance | ||
| 1119 | so that they are automatically established prior to the unit starting up. Note that when this option | ||
| 1120 | is used log output of this service does not appear in the regular | ||
| 1121 | L<journalctl(1)> | ||
| 1122 | output, unless the C<--namespace=> option is used.', | ||
| 1123 | 'LogRateLimitBurst' => "Configures the rate limiting that is applied to log messages generated by this unit. | ||
| 1124 | If, in the time interval defined by C<LogRateLimitIntervalSec>, more messages than | ||
| 1125 | specified in C<LogRateLimitBurst> are logged by a service, all further messages | ||
| 1126 | within the interval are dropped until the interval is over. A message about the number of dropped | ||
| 1127 | messages is generated. The time specification for C<LogRateLimitIntervalSec> may be | ||
| 1128 | specified in the following units: \"s\", \"min\", \"h\", \"ms\", \"us\". See | ||
| 1129 | L<systemd.time(7)> for | ||
| 1130 | details. The default settings are set by C<RateLimitIntervalSec> and | ||
| 1131 | C<RateLimitBurst> configured in | ||
| 1132 | L<journald.conf(5)>. | ||
| 1133 | Note that this only applies to log messages that are processed by the logging subsystem, i.e. by | ||
| 1134 | L<systemd-journald.service(8)>. | ||
| 1135 | This means that if you connect a service's stderr directly to a file via | ||
| 1136 | C<StandardOutput=file:\x{2026}> or a similar setting, the rate limiting will not be applied | ||
| 1137 | to messages written that way (but it will be enforced for messages generated via | ||
| 1138 | L<syslog(3)> | ||
| 1139 | and similar functions).", | ||
| 1140 | 'LogRateLimitIntervalSec' => '*LogRateLimitBurst', | ||
| 1141 | 'LogsDirectory' => '*CacheDirectory', | ||
| 1142 | 'LogsDirectoryAccounting' => '*CacheDirectoryAccounting', | ||
| 1143 | 'LogsDirectoryMode' => '*CacheDirectoryMode', | ||
| 1144 | 'LogsDirectoryQuota' => '*CacheDirectoryQuota', | ||
| 1145 | 'MemoryDenyWriteExecute' => 'Takes a boolean argument. If set, attempts to create memory mappings that are writable and | ||
| 1146 | executable at the same time, or to change existing memory mappings to become executable, or mapping shared | ||
| 1147 | memory segments as executable, are prohibited. Specifically, a system call filter is added (or | ||
| 1148 | preferably, an equivalent kernel check is enabled with | ||
| 1149 | L<prctl(2)>) that | ||
| 1150 | rejects L<mmap(2)> | ||
| 1151 | system calls with both C<PROT_EXEC> and C<PROT_WRITE> set, | ||
| 1152 | L<mprotect(2)> or | ||
| 1153 | L<pkey_mprotect(2)> system calls | ||
| 1154 | with C<PROT_EXEC> set and | ||
| 1155 | L<shmat(2)> system calls with | ||
| 1156 | C<SHM_EXEC> set. Note that this option is incompatible with programs and libraries that | ||
| 1157 | generate program code dynamically at runtime, including JIT execution engines, executable stacks, and code | ||
| 1158 | "trampoline" feature of various C compilers. This option improves service security, as it makes harder for | ||
| 1159 | software exploits to change running code dynamically. However, the protection can be circumvented, if | ||
| 1160 | the service can write to a filesystem, which is not mounted with C<noexec> (such as | ||
| 1161 | C</dev/shm>), or it can use memfd_create(). This can be | ||
| 1162 | prevented by making such file systems inaccessible to the service | ||
| 1163 | (e.g. C<InaccessiblePaths=/dev/shm>) and installing further system call filters | ||
| 1164 | (C<SystemCallFilter=~memfd_create>). Note that this feature is fully available on | ||
| 1165 | x86-64, and partially on x86. Specifically, the shmat() protection is not | ||
| 1166 | available on x86. Note that on systems supporting multiple ABIs (such as x86/x86-64) it is | ||
| 1167 | recommended to turn off alternative ABIs for services, so that they cannot be used to circumvent the | ||
| 1168 | restrictions of this option. Specifically, it is recommended to combine this option with | ||
| 1169 | C<SystemCallArchitectures=native> or similar.', | ||
| 1170 | 'MemoryKSM' => 'Takes a boolean argument. When set, it enables KSM (kernel samepage merging) for | ||
| 1171 | the processes. KSM is a memory-saving de-duplication feature. Anonymous memory pages with identical | ||
| 1172 | content can be replaced by a single write-protected page. This feature should only be enabled for | ||
| 1173 | jobs that share the same security domain. For details, see | ||
| 1174 | L<Kernel Samepage Merging|https://docs.kernel.org/admin-guide/mm/ksm.html> in the | ||
| 1175 | kernel documentation. | ||
| 1176 | |||
| 1177 | Note that this functionality might not be available, for example if KSM is disabled in the | ||
| 1178 | kernel, or the kernel does not support controlling KSM at the process level through | ||
| 1179 | L<prctl(2)>.', | ||
| 1180 | 'MemoryTHP' => 'Transparent Hugepages (THPs) is a Linux kernel feature that manages memory | ||
| 1181 | using larger pages (2MB on x86, compared to the default 4KB). The main goal is to improve memory management | ||
| 1182 | efficiency and system performance, especially for memory-intensive applications. | ||
| 1183 | However, it can cause drawbacks in some scenarios, such as memory regression and latency spikes. | ||
| 1184 | THP policy is governed for the entire system via C</sys/kernel/mm/transparent_hugepage/enabled>. | ||
| 1185 | However, it can be overridden for individual workloads via | ||
| 1186 | L<prctl(2)>. | ||
| 1187 | C<MemoryTHP> may be used to disable THPs at process invocation time to stop providing | ||
| 1188 | THPs for workloads where the drawbacks outweigh the advantages. | ||
| 1189 | When C<MemoryTHP> is set to C<inherit> or not set at all, systemd | ||
| 1190 | inherits THP settings from the process that starts it and no | ||
| 1191 | L<prctl(2)>C<PR_SET_THP_DISABLE> call is made. | ||
| 1192 | When set to C<disable>, C<MemoryTHP> disables THPs completely for the process, | ||
| 1193 | irrespecitive of global THP controls. | ||
| 1194 | When set to C<madvise>, C<MemoryTHP> disables THPs for the process except when | ||
| 1195 | specifically requested via L<madvise(2)> | ||
| 1196 | by the process with C<MADV_HUGEPAGE> or C<MADV_COLLAPSE>. | ||
| 1197 | When set to C<system>, C<MemoryTHP> resets the THP policy to system wide policy. | ||
| 1198 | This can be used when the process that starts systemd has already disabled THPs via | ||
| 1199 | C<PR_SET_THP_DISABLE>, and we want to restore the system default THP setting at | ||
| 1200 | process invocation time. For details, see | ||
| 1201 | L<Transparent Hugepage Support|https://docs.kernel.org/admin-guide/mm/transhuge.html> | ||
| 1202 | in the kernel documentation. | ||
| 1203 | |||
| 1204 | Note that this functionality might not be available, for example if THP is disabled in the | ||
| 1205 | kernel, or the kernel does not support controlling THP at the process level through | ||
| 1206 | L<prctl(2)>.', | ||
| 1207 | 'MountAPIVFS' => 'Takes a boolean argument. If on, a private mount namespace for the unit\'s processes is created | ||
| 1208 | and the API file systems C</proc/>, C</sys/>, C</dev/> and | ||
| 1209 | C</run/> (as an empty C<tmpfs>) are mounted inside of it, unless they are | ||
| 1210 | already mounted. Note that this option has no effect unless used in conjunction with | ||
| 1211 | C<RootDirectory>/C<RootImage> as these four mounts are | ||
| 1212 | generally mounted in the host anyway, and unless the root directory is changed, the private mount namespace | ||
| 1213 | will be a 1:1 copy of the host\'s, and include these four mounts. Note that the C</dev/> file | ||
| 1214 | system of the host is bind mounted if this option is used without C<PrivateDevices>. To run | ||
| 1215 | the service with a private, minimal version of C</dev/>, combine this option with | ||
| 1216 | C<PrivateDevices>. | ||
| 1217 | |||
| 1218 | In order to allow propagating mounts at runtime in a safe manner, C</run/systemd/propagate/> | ||
| 1219 | on the host will be used to set up new mounts, and C</run/host/incoming/> in the private namespace | ||
| 1220 | will be used as an intermediate step to store them before being moved to the final mount point.', | ||
| 1221 | 'MountFlags' => "Takes a mount propagation setting: C<shared>, C<slave> or | ||
| 1222 | C<private>, which controls whether file system mount points in the file system namespaces set up | ||
| 1223 | for this unit's processes will receive or propagate mounts and unmounts from other file system namespaces. See | ||
| 1224 | L<mount(2)> | ||
| 1225 | for details on mount propagation, and the three propagation flags in particular. | ||
| 1226 | |||
| 1227 | This setting only controls the final propagation setting in effect on all mount | ||
| 1228 | points of the file system namespace created for each process of this unit. Other file system namespacing unit | ||
| 1229 | settings (see the discussion in C<PrivateMounts> above) will implicitly disable mount and | ||
| 1230 | unmount propagation from the unit's processes towards the host by changing the propagation setting of all mount | ||
| 1231 | points in the unit's file system namespace to C<slave> first. Setting this option to | ||
| 1232 | C<shared> does not reestablish propagation in that case. | ||
| 1233 | |||
| 1234 | If not set \x{2013} but file system namespaces are enabled through another file system namespace unit setting \x{2013} | ||
| 1235 | C<shared> mount propagation is used, but \x{2014} as mentioned \x{2014} as C<slave> is applied | ||
| 1236 | first, propagation from the unit's processes to the host is still turned off. | ||
| 1237 | |||
| 1238 | It is not recommended to use C<private> mount propagation for units, as this means | ||
| 1239 | temporary mounts (such as removable media) of the host will stay mounted and thus indefinitely busy in forked | ||
| 1240 | off processes, as unmount propagation events will not be received by the file system namespace of the unit. | ||
| 1241 | |||
| 1242 | Usually, it is best to leave this setting unmodified, and use higher level file system namespacing | ||
| 1243 | options instead, in particular C<PrivateMounts>, see above.", | ||
| 1244 | 'MountImagePolicy' => '*ExtensionImagePolicy', | ||
| 1245 | 'MountImages' => 'This setting is similar to C<RootImage> in that it mounts a file | ||
| 1246 | system hierarchy from a block device node or loopback file, but the destination directory can be | ||
| 1247 | specified as well as mount options. This option expects a whitespace separated list of mount | ||
| 1248 | definitions. Each definition consists of a colon-separated tuple of source path and destination | ||
| 1249 | definitions, optionally followed by another colon and a list of mount options. | ||
| 1250 | |||
| 1251 | Mount options may be defined as a single comma-separated list of options, in which case they | ||
| 1252 | will be implicitly applied to the root partition on the image, or a series of colon-separated tuples | ||
| 1253 | of partition name and mount options. Valid partition names and mount options are the same as for | ||
| 1254 | C<RootImageOptions> setting described above. | ||
| 1255 | |||
| 1256 | Each mount definition may be prefixed with C<->, in which case it will be | ||
| 1257 | ignored when its source path does not exist. The source argument is a path to a block device node or | ||
| 1258 | regular file. If source or destination contain a C<:>, it needs to be escaped as | ||
| 1259 | C<\\:>. The device node or file system image file needs to follow the same rules as | ||
| 1260 | specified for C<RootImage>. Any mounts created with this option are specific to the | ||
| 1261 | unit, and are not visible in the host\'s mount table. | ||
| 1262 | |||
| 1263 | These settings may be used more than once, each usage appends to the unit\'s list of mount | ||
| 1264 | paths. If the empty string is assigned, the entire list of mount paths defined prior to this is | ||
| 1265 | reset. | ||
| 1266 | |||
| 1267 | Note that the destination directory must exist or systemd must be able to create it. Thus, it | ||
| 1268 | is not possible to use those options for mount points nested underneath paths specified in | ||
| 1269 | C<InaccessiblePaths>, or under C</home/> and other protected | ||
| 1270 | directories if C<ProtectHome=yes> is specified. | ||
| 1271 | |||
| 1272 | When C<DevicePolicy> is set to C<closed> or | ||
| 1273 | C<strict>, or set to C<auto> and C<DeviceAllow> is | ||
| 1274 | set, then this setting adds C</dev/loop-control> with C<rw> mode, | ||
| 1275 | C<block-loop> and C<block-blkext> with C<rwm> mode | ||
| 1276 | to C<DeviceAllow>. See | ||
| 1277 | L<systemd.resource-control(5)> | ||
| 1278 | for the details about C<DevicePolicy> or C<DeviceAllow>. Also, see | ||
| 1279 | C<PrivateDevices> below, as it may change the setting of | ||
| 1280 | C<DevicePolicy>.', | ||
| 1281 | 'NUMAMask' => 'Controls the NUMA node list which will be applied alongside with selected NUMA policy. | ||
| 1282 | Takes a list of NUMA nodes and has the same syntax as a list of CPUs for C<CPUAffinity> | ||
| 1283 | option or special "all" value which will include all available NUMA nodes in the mask. Note that the list | ||
| 1284 | of NUMA nodes is not required for C<default> and C<local> | ||
| 1285 | policies and for C<preferred> policy we expect a single NUMA node.', | ||
| 1286 | 'NUMAPolicy' => 'Controls the NUMA memory policy of the executed processes. Takes a policy type, one of: | ||
| 1287 | C<default>, C<preferred>, C<bind>, C<interleave> and | ||
| 1288 | C<local>. A list of NUMA nodes that should be associated with the policy must be specified | ||
| 1289 | in C<NUMAMask>. For more details on each policy please see, | ||
| 1290 | L<set_mempolicy(2)>. For overall | ||
| 1291 | overview of NUMA support in Linux see, | ||
| 1292 | L<numa(7)>. | ||
| 1293 | ', | ||
| 1294 | 'NetworkNamespacePath' => 'Takes an absolute file system path referring to a Linux network namespace | ||
| 1295 | pseudo-file (i.e. a file like C</proc/$PID/ns/net> or a bind mount or symlink to | ||
| 1296 | one). When set the invoked processes are added to the network namespace referenced by that path. The | ||
| 1297 | path has to point to a valid namespace file at the moment the processes are forked off. If this | ||
| 1298 | option is used C<PrivateNetwork> has no effect. If this option is used together with | ||
| 1299 | C<JoinsNamespaceOf> then it only has an effect if this unit is started before any of | ||
| 1300 | the listed units that have C<PrivateNetwork> or | ||
| 1301 | C<NetworkNamespacePath> configured, as otherwise the network namespace of those | ||
| 1302 | units is reused. | ||
| 1303 | |||
| 1304 | When this option is enabled, C<PrivateMounts> is implied unless it is | ||
| 1305 | explicitly disabled, and C</sys> will be remounted to associate it with the new | ||
| 1306 | network namespace. | ||
| 1307 | |||
| 1308 | When this option is used on a socket unit any sockets bound on behalf of this unit will be | ||
| 1309 | bound within the specified network namespace.', | ||
| 1310 | 'Nice' => 'Sets the default nice level (scheduling priority) for executed processes. Takes an | ||
| 1311 | integer between -20 (highest priority) and 19 (lowest priority). In case of resource contention, | ||
| 1312 | smaller values mean more resources will be made available to the unit\'s processes, larger values mean | ||
| 1313 | less resources will be made available. See | ||
| 1314 | L<setpriority(2)> for | ||
| 1315 | details.', | ||
| 1316 | 'NoExecPaths' => '*ExecPaths', | ||
| 1317 | 'NoNewPrivileges' => 'Takes a boolean argument. If true, ensures that the service process and all its | ||
| 1318 | children can never gain new privileges through execve() (e.g. via setuid or | ||
| 1319 | setgid bits, or filesystem capabilities). This is the simplest and most effective way to ensure that | ||
| 1320 | a process and its children can never elevate privileges again. Defaults to false. In case the service | ||
| 1321 | will be run in a new mount namespace anyway and SELinux is disabled, all file systems are mounted with | ||
| 1322 | C<MS_NOSUID> flag. Also see L<No New Privileges Flag|https://docs.kernel.org/userspace-api/no_new_privs.html>. | ||
| 1323 | |||
| 1324 | Note that this setting only has an effect on the unit\'s processes themselves (or any processes | ||
| 1325 | directly or indirectly forked off them). It has no effect on processes potentially invoked on request | ||
| 1326 | of them through tools such as L<at(1)>, | ||
| 1327 | L<crontab(1)>, | ||
| 1328 | L<systemd-run(1)>, or | ||
| 1329 | arbitrary IPC services.', | ||
| 1330 | 'OOMScoreAdjust' => 'Sets the adjustment value for the Linux kernel\'s Out-Of-Memory (OOM) killer score for | ||
| 1331 | executed processes. Takes an integer between -1000 (to disable OOM killing of processes of this unit) | ||
| 1332 | and 1000 (to make killing of processes of this unit under memory pressure very likely). See L<The /proc | ||
| 1333 | Filesystem|https://docs.kernel.org/filesystems/proc.html> for | ||
| 1334 | details. If not specified, defaults to the OOM score adjustment level of the service manager itself, | ||
| 1335 | which is normally at 0. | ||
| 1336 | |||
| 1337 | Use the C<OOMPolicy> setting of service units to configure how the service | ||
| 1338 | manager shall react to the kernel OOM killer or systemd-oomd terminating a process of the service. See | ||
| 1339 | L<systemd.service(5)> | ||
| 1340 | for details.', | ||
| 1341 | 'PAMName' => 'Sets the PAM service name to set up a session as. If set, the executed process will be | ||
| 1342 | registered as a PAM session under the specified service name. This is only useful in conjunction with the | ||
| 1343 | C<User> setting, and is otherwise ignored. If not set, no PAM session will be opened for the | ||
| 1344 | executed processes. See L<pam(8)> for | ||
| 1345 | details. | ||
| 1346 | |||
| 1347 | Note that for each unit making use of this option a PAM session handler process will be maintained as | ||
| 1348 | part of the unit and stays around as long as the unit is active, to ensure that appropriate actions can be | ||
| 1349 | taken when the unit and hence the PAM session terminates. This process is named C<(sd-pam)> and | ||
| 1350 | is an immediate child process of the unit\'s main process. | ||
| 1351 | |||
| 1352 | Note that when this option is used for a unit it is very likely (depending on PAM configuration) that the | ||
| 1353 | main unit process will be migrated to its own session scope unit when it is activated. This process will hence | ||
| 1354 | be associated with two units: the unit it was originally started from (and for which | ||
| 1355 | C<PAMName> was configured), and the session scope unit. Any child processes of that process | ||
| 1356 | will however be associated with the session scope unit only. This has implications when used in combination | ||
| 1357 | with C<NotifyAccess>=C<all>, as these child processes will not be able to affect | ||
| 1358 | changes in the original unit through notification messages. These messages will be considered belonging to the | ||
| 1359 | session scope unit and not the original unit. It is hence not recommended to use C<PAMName> in | ||
| 1360 | combination with C<NotifyAccess>=C<all>. | ||
| 1361 | |||
| 1362 | If a PAM module interactively requests input (a password or suchlike) it will be attempted to | ||
| 1363 | be read from a service credential (as configured via C<SetCredential>, | ||
| 1364 | C<ImportCredential> and related calls) under the name | ||
| 1365 | C<pam.authtok.pamservice>, where | ||
| 1366 | pamservice is replaced by the PAM service name as configured with | ||
| 1367 | C<PAMName>. (Note that the credential remains accessible for the runtime of the | ||
| 1368 | service!) If no matching credential is set, the user is prompted for it interactively via the L<Password | ||
| 1369 | Agent|https://systemd.io/PASSWORD_AGENTS> logic.', | ||
| 1370 | 'PassEnvironment' => 'Pass environment variables set for the system service manager to executed processes. Takes a | ||
| 1371 | space-separated list of variable names. This option may be specified more than once, in which case all listed | ||
| 1372 | variables will be passed. If the empty string is assigned to this option, the list of environment variables to | ||
| 1373 | pass is reset, all prior assignments have no effect. Variables specified that are not set for the system | ||
| 1374 | manager will not be passed and will be silently ignored. Note that this option is only relevant for the system | ||
| 1375 | service manager, as system services by default do not automatically inherit any environment variables set for | ||
| 1376 | the service manager itself. However, in case of the user service manager all environment variables are passed | ||
| 1377 | to the executed processes anyway, hence this option is without effect for the user service manager. | ||
| 1378 | |||
| 1379 | Variables set for invoked processes due to this setting are subject to being overridden by those | ||
| 1380 | configured with C<Environment> or C<EnvironmentFile>. | ||
| 1381 | |||
| 1382 | Example: | ||
| 1383 | |||
| 1384 | PassEnvironment=VAR1 VAR2 VAR3 | ||
| 1385 | |||
| 1386 | passes three variables C<VAR1>, | ||
| 1387 | C<VAR2>, C<VAR3> | ||
| 1388 | with the values set for those variables in PID1. | ||
| 1389 | |||
| 1390 | See L<environ(7)> for details | ||
| 1391 | about environment variables.', | ||
| 1392 | 'Personality' => 'Controls which kernel architecture L<uname(2)> shall | ||
| 1393 | report, when invoked by unit processes. Takes one of the architecture identifiers | ||
| 1394 | C<arm64>, C<arm64-be>, C<arm>, | ||
| 1395 | C<arm-be>, C<x86>, C<x86-64>, | ||
| 1396 | C<ppc>, C<ppc-le>, C<ppc64>, | ||
| 1397 | C<ppc64-le>, C<s390> or C<s390x>. Which | ||
| 1398 | personality architectures are supported depends on the kernel\'s native architecture. Usually the | ||
| 1399 | 64-bit versions of the various system architectures support their immediate 32-bit personality | ||
| 1400 | architecture counterpart, but no others. For example, C<x86-64> systems support the | ||
| 1401 | C<x86-64> and C<x86> personalities but no others. The personality | ||
| 1402 | feature is useful when running 32-bit services on a 64-bit host system. If not specified, the | ||
| 1403 | personality is left unmodified and thus reflects the personality of the host system\'s kernel. This | ||
| 1404 | option is not useful on architectures for which only one native word width was ever available, such | ||
| 1405 | as C<m68k> (32-bit only) or C<alpha> (64-bit only).', | ||
| 1406 | 'PrivateBPF' => 'Takes a boolean argument. If set, mount a private instance of the BPF filesystem | ||
| 1407 | on C</sys/fs/bpf/>, effectively hiding the host bpffs which contains information | ||
| 1408 | about loaded programs and maps. Otherwise, if C<ProtectKernelTunables> is set, the | ||
| 1409 | instance from the host is inherited but mounted read-only. Defaults to false. | ||
| 1410 | |||
| 1411 | This can be used together with the bpffs delegate feature to choose what BPF functions are | ||
| 1412 | available to the unit\'s processes. When mounting the BPF filesystem with the fsopen() API, four mount | ||
| 1413 | options can be specified to set a list of BPF commands, maps, programs and attachment types that are | ||
| 1414 | allowed to be used. Processes needs to get a file descriptor for the bpffs mountpoint and use that to | ||
| 1415 | get a token which will enable for that user namespace the BPF functionalities chosen upon bpffs mount. | ||
| 1416 | A more detailed explanation of the feature can be found in this | ||
| 1417 | L<LWN post|https://lwn.net/Articles/947173/>.', | ||
| 1418 | 'PrivateDevices' => 'Takes a boolean argument. If true, sets up a new C</dev/> mount for | ||
| 1419 | the executed processes and only adds API pseudo devices such as C</dev/null>, | ||
| 1420 | C</dev/zero> or C</dev/random> (as well as the pseudo TTY | ||
| 1421 | subsystem) to it, but no physical devices such as C</dev/sda>, system memory | ||
| 1422 | C</dev/mem>, system ports C</dev/port> and others. This is useful | ||
| 1423 | to turn off physical device access by the executed process. Defaults to false. | ||
| 1424 | |||
| 1425 | Enabling this option will install a system call filter to block low-level I/O system calls that | ||
| 1426 | are grouped in the C<@raw-io> set, remove C<CAP_MKNOD> and | ||
| 1427 | C<CAP_SYS_RAWIO> from the capability bounding set for the unit, and set | ||
| 1428 | C<DevicePolicy=closed> (see | ||
| 1429 | L<systemd.resource-control(5)> | ||
| 1430 | for details). Note that using this setting will disconnect propagation of mounts from the service to | ||
| 1431 | the host (propagation in the opposite direction continues to work). This means that this setting may | ||
| 1432 | not be used for services which shall be able to install mount points in the main mount namespace. The | ||
| 1433 | new C</dev/> will be mounted read-only and \'noexec\'. The latter may break old | ||
| 1434 | programs which try to set up executable memory by using | ||
| 1435 | L<mmap(2)> of | ||
| 1436 | C</dev/zero> instead of using C<MAP_ANON>. For this setting the | ||
| 1437 | same restrictions regarding mount propagation and privileges apply as for | ||
| 1438 | C<ReadOnlyPaths> and related calls, see above. | ||
| 1439 | |||
| 1440 | Note that the implementation of this setting might be impossible (for example if mount | ||
| 1441 | namespaces are not available), and the unit should be written in a way that does not solely rely on | ||
| 1442 | this setting for security. | ||
| 1443 | |||
| 1444 | When access to some but not all devices must be possible, the C<DeviceAllow> | ||
| 1445 | setting might be used instead. See | ||
| 1446 | L<systemd.resource-control(5)>. | ||
| 1447 | ', | ||
| 1448 | 'PrivateIPC' => 'Takes a boolean argument. If true, sets up a new IPC namespace for the executed processes. | ||
| 1449 | Each IPC namespace has its own set of System V IPC identifiers and its own POSIX message queue file system. | ||
| 1450 | This is useful to avoid name clash of IPC identifiers. Defaults to false. It is possible to run two or | ||
| 1451 | more units within the same private IPC namespace by using the C<JoinsNamespaceOf> directive, | ||
| 1452 | see L<systemd.unit(5)> for | ||
| 1453 | details. | ||
| 1454 | |||
| 1455 | Note that IPC namespacing does not have an effect on | ||
| 1456 | C<AF_UNIX> sockets, which are the most common | ||
| 1457 | form of IPC used on Linux. Instead, C<AF_UNIX> | ||
| 1458 | sockets in the file system are subject to mount namespacing, and | ||
| 1459 | those in the abstract namespace are subject to network namespacing. | ||
| 1460 | IPC namespacing only has an effect on SysV IPC (which is mostly | ||
| 1461 | legacy) as well as POSIX message queues (for which | ||
| 1462 | C<AF_UNIX>/C<SOCK_SEQPACKET> | ||
| 1463 | sockets are typically a better replacement). IPC namespacing also | ||
| 1464 | has no effect on POSIX shared memory (which is subject to mount | ||
| 1465 | namespacing) either. See | ||
| 1466 | L<ipc_namespaces(7)> for | ||
| 1467 | the details. | ||
| 1468 | |||
| 1469 | Note that the implementation of this setting might be impossible (for example if IPC namespaces are | ||
| 1470 | not available), and the unit should be written in a way that does not solely rely on this setting for | ||
| 1471 | security.', | ||
| 1472 | 'PrivateMounts' => "Takes a boolean parameter. If set, the processes of this unit will be run in their own private | ||
| 1473 | file system (mount) namespace with all mount propagation from the processes towards the host's main file system | ||
| 1474 | namespace turned off. This means any file system mount points established or removed by the unit's processes | ||
| 1475 | will be private to them and not be visible to the host. However, file system mount points established or | ||
| 1476 | removed on the host will be propagated to the unit's processes. See L<mount_namespaces(7)> for | ||
| 1477 | details on file system namespaces. Defaults to off. | ||
| 1478 | |||
| 1479 | When turned on, this executes three operations for each invoked process: a new | ||
| 1480 | C<CLONE_NEWNS> namespace is created, after which all existing mounts are remounted to | ||
| 1481 | C<MS_SLAVE> to disable propagation from the unit's processes to the host (but leaving | ||
| 1482 | propagation in the opposite direction in effect). Finally, the mounts are remounted again to the propagation | ||
| 1483 | mode configured with C<MountFlags>, see below. | ||
| 1484 | |||
| 1485 | File system namespaces are set up individually for each process forked off by the service manager. Mounts | ||
| 1486 | established in the namespace of the process created by C<ExecStartPre> will hence be cleaned | ||
| 1487 | up automatically as soon as that process exits and will not be available to subsequent processes forked off for | ||
| 1488 | C<ExecStart> (and similar applies to the various other commands configured for | ||
| 1489 | units). Similarly, C<JoinsNamespaceOf> does not permit sharing kernel mount namespaces between | ||
| 1490 | units, it only enables sharing of the C</tmp/> and C</var/tmp/> | ||
| 1491 | directories. | ||
| 1492 | |||
| 1493 | Other file system namespace unit settings \x{2014} C<PrivateTmp>, | ||
| 1494 | C<PrivateDevices>, C<ProtectSystem>, | ||
| 1495 | C<ProtectHome>, C<ReadOnlyPaths>, | ||
| 1496 | C<InaccessiblePaths>, C<ReadWritePaths>, | ||
| 1497 | C<BindPaths>, C<BindReadOnlyPaths>, \x{2026} \x{2014} also enable file system | ||
| 1498 | namespacing in a fashion equivalent to this option. Hence it is primarily useful to explicitly | ||
| 1499 | request this behaviour if none of the other settings are used.", | ||
| 1500 | 'PrivateNetwork' => 'Takes a boolean argument. If true, sets up a new network namespace for the executed processes | ||
| 1501 | and configures only the loopback network device C<lo> inside it. No other network devices will | ||
| 1502 | be available to the executed process. This is useful to turn off network access by the executed process. | ||
| 1503 | Defaults to false. It is possible to run two or more units within the same private network namespace by using | ||
| 1504 | the C<JoinsNamespaceOf> directive, see | ||
| 1505 | L<systemd.unit(5)> for | ||
| 1506 | details. Note that this option will disconnect all socket families from the host, including | ||
| 1507 | C<AF_NETLINK> and C<AF_UNIX>. Effectively, for | ||
| 1508 | C<AF_NETLINK> this means that device configuration events received from | ||
| 1509 | L<systemd-udevd.service(8)> are | ||
| 1510 | not delivered to the unit\'s processes. And for C<AF_UNIX> this has the effect that | ||
| 1511 | C<AF_UNIX> sockets in the abstract socket namespace of the host will become unavailable to | ||
| 1512 | the unit\'s processes (however, those located in the file system will continue to be accessible). | ||
| 1513 | |||
| 1514 | Note that the implementation of this setting might be impossible (for example if network namespaces are | ||
| 1515 | not available), and the unit should be written in a way that does not solely rely on this setting for | ||
| 1516 | security. | ||
| 1517 | |||
| 1518 | When this option is enabled, C<PrivateMounts> is implied unless it is | ||
| 1519 | explicitly disabled, and C</sys> will be remounted to associate it with the new | ||
| 1520 | network namespace. | ||
| 1521 | |||
| 1522 | When this option is used on a socket unit any sockets bound on behalf of this unit will be | ||
| 1523 | bound within a private network namespace. This may be combined with | ||
| 1524 | C<JoinsNamespaceOf> to listen on sockets inside of network namespaces of other | ||
| 1525 | services.', | ||
| 1526 | 'PrivatePIDs' => 'Takes a boolean argument. Defaults to false. If enabled, sets up a new PID namespace | ||
| 1527 | for the executed processes. Each executed process is now PID 1 - the init process - in the new namespace. | ||
| 1528 | C</proc/> is mounted such that only processes in the PID namespace are visible. | ||
| 1529 | If C<PrivatePIDs> is set, C<MountAPIVFS=yes> is implied. | ||
| 1530 | |||
| 1531 | C<PrivatePIDs> is only supported for service units. This setting is not supported | ||
| 1532 | with C<Type=forking> since the kernel will kill all processes in the PID namespace if | ||
| 1533 | the init process terminates. | ||
| 1534 | |||
| 1535 | This setting will be ignored if the kernel does not support PID namespaces. | ||
| 1536 | |||
| 1537 | Note unprivileged user services (i.e. a service run by the per-user instance of the service manager) | ||
| 1538 | will fail with C<PrivatePIDs=yes> if C</proc/> is masked | ||
| 1539 | (i.e. C</proc/kmsg> is over-mounted with C<tmpfs> like | ||
| 1540 | L<systemd-nspawn(1)> does). | ||
| 1541 | This is due to a kernel restriction not allowing unprivileged user namespaces to mount a less restrictive | ||
| 1542 | instance of C</proc/>.', | ||
| 1543 | 'PrivateTmp' => 'Takes a boolean argument, or C<disconnected>. If enabled, a new | ||
| 1544 | file system namespace will be set up for the executed processes, and C</tmp/> | ||
| 1545 | and C</var/tmp/> directories inside it are not shared with processes outside of | ||
| 1546 | the namespace, plus all temporary files created by a service in these directories will be removed | ||
| 1547 | after the service is stopped. For this setting, the same restrictions regarding mount propagation | ||
| 1548 | and privileges apply as for C<ReadOnlyPaths> and related calls, see above. This | ||
| 1549 | setting is useful to secure access to temporary files of the process, but makes sharing between | ||
| 1550 | processes via C</tmp/> or C</var/tmp/> impossible. If | ||
| 1551 | C<DynamicUser> is enabled, C<disconnected> is implied. Otherwise, | ||
| 1552 | defaults to false. | ||
| 1553 | |||
| 1554 | If C<true>, the backing storage of the private temporary directories will | ||
| 1555 | remain on the host\'s C</tmp/> and C</var/tmp/> directories. It is | ||
| 1556 | possible to run two or more units within the same private C</tmp/> and | ||
| 1557 | C</var/tmp/> namespace by using the C<JoinsNamespaceOf> directive, | ||
| 1558 | see L<systemd.unit(5)> | ||
| 1559 | for details. This has the side effect of adding C<Wants> and | ||
| 1560 | C<After> dependencies on all mount units necessary to access | ||
| 1561 | C</tmp/> and C</var/tmp/> on the host. Moreover, an implicit | ||
| 1562 | C<After> ordering on | ||
| 1563 | L<systemd-tmpfiles-setup.service(8)> | ||
| 1564 | is added. | ||
| 1565 | |||
| 1566 | If C<disconnected>, the directories will be backed by a completely new tmpfs | ||
| 1567 | instance, meaning that the storage is fully disconnected from the host namespace. The tmpfs instance | ||
| 1568 | does not shared with other units even if the C<JoinsNamespaceOf> directive is used. | ||
| 1569 | If C<DefaultDependencies=no> is specified, | ||
| 1570 | C<RequiresMountsFor=/WantsMountsFor=> for C</var/> is not | ||
| 1571 | specified, and C<RootDirectory=/RootImage=> is not specified, then a new tmpfs is | ||
| 1572 | mounted only on C</tmp/>, hence the host\'s | ||
| 1573 | C</var/tmp> is still accessible from the unit. In that case, | ||
| 1574 | C<$TMPDIR> environment variable is set to C</tmp> to suggest the | ||
| 1575 | processes in the unit to use C</tmp/>. This automatically adds | ||
| 1576 | C<WantsMountsFor=/var/> dependency, unless C<DefaultDependencies=no> | ||
| 1577 | and/or C<RootDirectory=/RootImage=> are specified. | ||
| 1578 | |||
| 1579 | Note that the implementation of this setting might be impossible (for example if mount namespaces are not | ||
| 1580 | available), and the unit should be written in a way that does not solely rely on this setting for | ||
| 1581 | security.', | ||
| 1582 | 'PrivateUsers' => 'Takes a boolean argument or one of C<self>, | ||
| 1583 | C<identity>, C<full> or C<managed>. Defaults to | ||
| 1584 | false. If enabled, sets up a new user namespace for the executed processes and configures a user and | ||
| 1585 | group mapping. If set to a true value or C<self>, a minimal user and group mapping is | ||
| 1586 | configured that maps the C<root> user and group as well as the unit\'s own user and | ||
| 1587 | group to themselves and everything else to the C<nobody> user and group. This is | ||
| 1588 | useful to securely detach the user and group databases used by the unit from the rest of the system, | ||
| 1589 | and thus to create an effective sandbox environment. All files, directories, processes, IPC objects | ||
| 1590 | and other resources owned by users/groups not equaling C<root> or the unit\'s own will | ||
| 1591 | stay visible from within the unit but appear owned by the C<nobody> user and | ||
| 1592 | group. | ||
| 1593 | |||
| 1594 | If the parameter is C<identity>, user namespacing is set up with an identity | ||
| 1595 | mapping for the first 65536 UIDs/GIDs. Any UIDs/GIDs above 65536 will be mapped to the | ||
| 1596 | C<nobody> user and group, respectively. While this does not provide UID/GID isolation, | ||
| 1597 | since all UIDs/GIDs are chosen identically it does provide process capability isolation, and hence is | ||
| 1598 | often a good choice if proper user namespacing with distinct UID maps is not appropriate. | ||
| 1599 | |||
| 1600 | If the parameter is C<full>, user namespacing is set up with an identity | ||
| 1601 | mapping for all UIDs/GIDs. In addition, for system services, C<full> allows the unit | ||
| 1602 | to call setgroups() system calls (by setting | ||
| 1603 | C</proc/pid/setgroups> to C<allow>). | ||
| 1604 | Similar to C<identity>, this does not provide UID/GID isolation, but it does provide | ||
| 1605 | process capability isolation. If this mode is enabled, all unit processes are run without privileges | ||
| 1606 | in the host user namespace (regardless of whether the unit\'s own user/group is | ||
| 1607 | C<root> or not). Specifically this means that the process will have zero process | ||
| 1608 | capabilities on the host\'s user namespace, but full capabilities within the service\'s user | ||
| 1609 | namespace. Settings such as C<CapabilityBoundingSet> will affect only the latter, | ||
| 1610 | and there\'s no way to acquire additional capabilities in the host\'s user namespace. | ||
| 1611 | |||
| 1612 | If the parameter is C<managed> a transient, dynamically allocated range of | ||
| 1613 | 65536 UIDs/GIDs is allocated for the unit, and a UID/GID mapping is assigned to the unit\'s process | ||
| 1614 | so the UID/GID 0 from inside the unit maps to the first UID/GID of the allocated mapping. Note that | ||
| 1615 | in this mode the UID/GID the service process will run as is different depending if looking from the | ||
| 1616 | host side (where it will be a high, dynamically assigned UID) or from inside the unit (where it will | ||
| 1617 | be 0). Also note that this mode will enable file system UID mapping for the file systems this service | ||
| 1618 | accesses, mapping the "foreign" UID range on disk to the selected dynamic UID range at | ||
| 1619 | runtime. | ||
| 1620 | |||
| 1621 | When this setting is set up by a per-user instance of the service manager, the mapping of the | ||
| 1622 | C<root> user and group to itself is omitted (unless the user manager is root). | ||
| 1623 | Additionally, in the per-user instance manager case, the | ||
| 1624 | user namespace will be set up before most other namespaces. This means that combining | ||
| 1625 | C<PrivateUsers>=C<true> with other namespaces will enable use of features not | ||
| 1626 | normally supported by the per-user instances of the service manager. | ||
| 1627 | |||
| 1628 | This setting is particularly useful in conjunction with | ||
| 1629 | C<RootDirectory>/C<RootImage>, as the need to synchronize the user and group | ||
| 1630 | databases in the root directory and on the host is reduced, as the only users and groups who need to be matched | ||
| 1631 | are C<root>, C<nobody> and the unit\'s own user and group.', | ||
| 1632 | 'ProcSubset' => 'Takes one of C<all> (the default) and C<pid>. If | ||
| 1633 | C<pid>, all files and directories not directly associated with process management and | ||
| 1634 | introspection are made invisible in the C</proc/> file system configured for the | ||
| 1635 | unit\'s processes. This controls the C<subset=> mount option of the | ||
| 1636 | C<procfs> instance for the unit. For further details see L<The /proc | ||
| 1637 | Filesystem|https://docs.kernel.org/filesystems/proc.html#mount-options>. Note that Linux exposes various kernel APIs | ||
| 1638 | via C</proc/>, | ||
| 1639 | which are made unavailable with this setting. Since these APIs are used frequently this option is | ||
| 1640 | useful only in a few, specific cases, and is not suitable for most non-trivial programs. | ||
| 1641 | |||
| 1642 | Much like C<ProtectProc> above, this is implemented via file system mount | ||
| 1643 | namespacing, and hence the same restrictions apply: it is only available to system services, it | ||
| 1644 | disables mount propagation to the host mount table, and it implies | ||
| 1645 | C<MountAPIVFS>. Also, like C<ProtectProc> this setting is gracefully | ||
| 1646 | disabled if the used kernel does not support the C<subset=> mount option of | ||
| 1647 | C<procfs>.', | ||
| 1648 | 'ProtectClock' => 'Takes a boolean argument. If set, writes to the hardware clock or system clock will | ||
| 1649 | be denied. Defaults to off. Enabling this option removes C<CAP_SYS_TIME> and | ||
| 1650 | C<CAP_WAKE_ALARM> from the capability bounding set for this unit, installs a system | ||
| 1651 | call filter to block calls that can set the clock, and C<DeviceAllow=char-rtc r> is | ||
| 1652 | implied. Note that the system calls are blocked altogether, the filter does not take into account | ||
| 1653 | that some of the calls can be used to read the clock state with some parameter combinations. | ||
| 1654 | Effectively, C</dev/rtc0>, C</dev/rtc1>, etc. are made read-only | ||
| 1655 | to the service. See | ||
| 1656 | L<systemd.resource-control(5)> | ||
| 1657 | for the details about C<DeviceAllow>. | ||
| 1658 | |||
| 1659 | It is recommended to turn this on for most services that do not need modify the clock or check | ||
| 1660 | its state.', | ||
| 1661 | 'ProtectControlGroups' => 'Takes a boolean argument or the special values C<private> or | ||
| 1662 | C<strict>. If true, the Linux Control Groups (L<cgroups(7)>) hierarchies | ||
| 1663 | accessible through C</sys/fs/cgroup/> will be made read-only to all processes of the | ||
| 1664 | unit. If set to C<private>, the unit will run in a cgroup namespace with a private | ||
| 1665 | writable mount of C</sys/fs/cgroup/>. If set to C<strict>, the unit | ||
| 1666 | will run in a cgroup namespace with a private read-only mount of C</sys/fs/cgroup/>. | ||
| 1667 | Defaults to off. If C<ProtectControlGroups> is set, C<MountAPIVFS=yes> | ||
| 1668 | is implied. Note C<private> and C<strict> are downgraded to false and | ||
| 1669 | true respectively unless the system is using the unified control group hierarchy and the kernel supports | ||
| 1670 | cgroup namespaces. | ||
| 1671 | |||
| 1672 | Except for container managers no services should require write access to the control groups hierarchies; | ||
| 1673 | it is hence recommended to set C<ProtectControlGroups> to true or C<strict> | ||
| 1674 | for most services. For this setting the same restrictions regarding mount propagation and privileges apply | ||
| 1675 | as for C<ReadOnlyPaths> and related settings, see above.', | ||
| 1676 | 'ProtectHome' => 'Takes a boolean argument or the special values C<read-only> or | ||
| 1677 | C<tmpfs>. If true, the directories C</home/>, | ||
| 1678 | C</root>, and C</run/user> are made inaccessible and empty for | ||
| 1679 | processes invoked by this unit. If set to C<read-only>, the three directories are | ||
| 1680 | made read-only instead. If set to C<tmpfs>, temporary file systems are mounted on the | ||
| 1681 | three directories in read-only mode. The value C<tmpfs> is useful to hide home | ||
| 1682 | directories not relevant to the processes invoked by the unit, while still allowing necessary | ||
| 1683 | directories to be made visible when listed in C<BindPaths> or | ||
| 1684 | C<BindReadOnlyPaths>. | ||
| 1685 | |||
| 1686 | Setting this to C<yes> is mostly equivalent to setting the three directories in | ||
| 1687 | C<InaccessiblePaths>. Similarly, C<read-only> is mostly equivalent to | ||
| 1688 | C<ReadOnlyPaths>, and C<tmpfs> is mostly equivalent to | ||
| 1689 | C<TemporaryFileSystem> with C<:ro>. | ||
| 1690 | |||
| 1691 | It is recommended to enable this setting for all long-running services (in particular | ||
| 1692 | network-facing ones), to ensure they cannot get access to private user data, unless the services | ||
| 1693 | actually require access to the user\'s private data. This setting is implied if | ||
| 1694 | C<DynamicUser> is set. This setting cannot ensure protection in all cases. In | ||
| 1695 | general it has the same limitations as C<ReadOnlyPaths>, see below. | ||
| 1696 | |||
| 1697 | Note that this setting provides no protection if home directories are placed at a non-standard | ||
| 1698 | location, i.e. outside of the hierarchies listed above.', | ||
| 1699 | 'ProtectHostname' => 'Takes a boolean argument or C<private>. If enabled, sets up a new UTS | ||
| 1700 | namespace for the executed processes. If enabled, a hostname can be optionally specified following a | ||
| 1701 | colon (e.g. C<yes:foo> or C<private:host.example.com>), and the | ||
| 1702 | hostname is set in the new UTS namespace for the unit. If set to a true value, changing hostname or | ||
| 1703 | domainname via sethostname() and setdomainname() system | ||
| 1704 | calls is prevented. If set to C<private>, changing hostname or domainname is allowed | ||
| 1705 | but only affects the unit\'s UTS namespace. Defaults to off. | ||
| 1706 | |||
| 1707 | Note that the implementation of this setting might be impossible (for example if UTS namespaces | ||
| 1708 | are not available), and the unit should be written in a way that does not solely rely on this setting | ||
| 1709 | for security. | ||
| 1710 | |||
| 1711 | Note that when this option is enabled for a service hostname changes no longer propagate from | ||
| 1712 | the system into the service, it is hence not suitable for services that need to take notice of system | ||
| 1713 | hostname changes dynamically. | ||
| 1714 | |||
| 1715 | Note that this option does not prevent changing system hostname via hostnamectl. | ||
| 1716 | However, C<User> and C<Group> may be used to run as an unprivileged user | ||
| 1717 | to disallow changing system hostname. See SetHostname() in | ||
| 1718 | L<org.freedesktop.hostname1(5)> | ||
| 1719 | for more details.', | ||
| 1720 | 'ProtectKernelLogs' => 'Takes a boolean argument. If true, access to the kernel log ring buffer will be denied. It is | ||
| 1721 | recommended to turn this on for most services that do not need to read from or write to the kernel log ring | ||
| 1722 | buffer. Enabling this option removes C<CAP_SYSLOG> from the capability bounding set for this | ||
| 1723 | unit, and installs a system call filter to block the | ||
| 1724 | L<syslog(2)> | ||
| 1725 | system call (not to be confused with the libc API | ||
| 1726 | L<syslog(3)> | ||
| 1727 | for userspace logging). The kernel exposes its log buffer to userspace via C</dev/kmsg> and | ||
| 1728 | C</proc/kmsg>. If enabled, these are made inaccessible to all the processes in the unit. | ||
| 1729 | ', | ||
| 1730 | 'ProtectKernelModules' => 'Takes a boolean argument. If true, explicit module loading will be denied. This allows | ||
| 1731 | module load and unload operations to be turned off on modular kernels. It is recommended to turn this on for most | ||
| 1732 | services | ||
| 1733 | that do not need special file systems or extra kernel modules to work. Defaults to off. Enabling this option | ||
| 1734 | removes C<CAP_SYS_MODULE> from the capability bounding set for the unit, and installs a | ||
| 1735 | system call filter to block module system calls, also C</usr/lib/modules> is made | ||
| 1736 | inaccessible. For this setting the same restrictions regarding mount propagation and privileges apply as for | ||
| 1737 | C<ReadOnlyPaths> and related calls, see above. Note that limited automatic module loading due | ||
| 1738 | to user configuration or kernel mapping tables might still happen as side effect of requested user operations, | ||
| 1739 | both privileged and unprivileged. To disable module auto-load feature please see | ||
| 1740 | L<sysctl.d(5)>C<kernel.modules_disabled> mechanism and | ||
| 1741 | C</proc/sys/kernel/modules_disabled> documentation.', | ||
| 1742 | 'ProtectKernelTunables' => 'Takes a boolean argument. If true, kernel variables accessible through | ||
| 1743 | C</proc/sys/>, C</sys/>, C</proc/sysrq-trigger>, | ||
| 1744 | C</proc/latency_stats>, C</proc/acpi>, | ||
| 1745 | C</proc/timer_stats>, C</proc/fs> and C</proc/irq> will | ||
| 1746 | be made read-only and C</proc/kallsyms> as well as C</proc/kcore> will be | ||
| 1747 | inaccessible to all processes of the unit. | ||
| 1748 | Usually, tunable kernel variables should be initialized only at boot-time, for example with the | ||
| 1749 | L<sysctl.d(5)> mechanism. Few | ||
| 1750 | services need to write to these at runtime; it is hence recommended to turn this on for most services. For this | ||
| 1751 | setting the same restrictions regarding mount propagation and privileges apply as for | ||
| 1752 | C<ReadOnlyPaths> and related calls, see above. Defaults to off. | ||
| 1753 | Note that this option does not prevent indirect changes to kernel tunables affected by IPC calls to | ||
| 1754 | other processes. However, C<InaccessiblePaths> may be used to make relevant IPC file system | ||
| 1755 | objects inaccessible. If C<ProtectKernelTunables> is set, | ||
| 1756 | C<MountAPIVFS=yes> is implied.', | ||
| 1757 | 'ProtectProc' => 'Takes one of C<noaccess>, C<invisible>, | ||
| 1758 | C<ptraceable> or C<default> (which it defaults to). When set, this | ||
| 1759 | controls the C<hidepid=> mount option of the C<procfs> instance for | ||
| 1760 | the unit that controls which directories with process metainformation | ||
| 1761 | (C</proc/PID>) are visible and accessible: when set to | ||
| 1762 | C<noaccess> the ability to access most of other users\' process metadata in | ||
| 1763 | C</proc/> is taken away for processes of the service. When set to | ||
| 1764 | C<invisible> processes owned by other users are hidden from | ||
| 1765 | C</proc/>. If C<ptraceable> all processes that cannot be | ||
| 1766 | ptrace()\'ed by a process are hidden to it. If C<default> no | ||
| 1767 | restrictions on C</proc/> access or visibility are made. For further details see | ||
| 1768 | L<The /proc | ||
| 1769 | Filesystem|https://docs.kernel.org/filesystems/proc.html#mount-options>. It is generally recommended to run most system | ||
| 1770 | services with this option set to | ||
| 1771 | C<invisible>. This option is implemented via file system namespacing, and thus cannot | ||
| 1772 | be used with services that shall be able to install mount points in the host file system | ||
| 1773 | hierarchy. Note that the root user is unaffected by this option, so to be effective it has to be used | ||
| 1774 | together with C<User> or C<DynamicUser=yes>, and also without the | ||
| 1775 | C<CAP_SYS_PTRACE> capability, which also allows a process to bypass this feature. It | ||
| 1776 | cannot be used for services that need to access metainformation about other users\' processes. This | ||
| 1777 | option implies C<MountAPIVFS>. | ||
| 1778 | |||
| 1779 | If the kernel does not support per-mount point C<hidepid=> mount options this | ||
| 1780 | setting remains without effect, and the unit\'s processes will be able to access and see other process | ||
| 1781 | as if the option was not used.', | ||
| 1782 | 'ProtectSystem' => "Takes a boolean argument or the special values C<full> or | ||
| 1783 | C<strict>. If true, mounts the C</usr/> and the boot loader | ||
| 1784 | directories (C</boot> and C</efi>) read-only for processes | ||
| 1785 | invoked by this unit. If set to C<full>, the C</etc/> directory is | ||
| 1786 | mounted read-only, too. If set to C<strict> the entire file system hierarchy is | ||
| 1787 | mounted read-only, except for the API file system subtrees C</dev/>, | ||
| 1788 | C</proc/> and C</sys/> (protect these directories using | ||
| 1789 | C<PrivateDevices>, C<ProtectKernelTunables>, | ||
| 1790 | C<ProtectControlGroups>). This setting ensures that any modification of the | ||
| 1791 | vendor-supplied operating system (and optionally its configuration, and local mounts) is prohibited | ||
| 1792 | for the service. It is recommended to enable this setting for all long-running services, unless they | ||
| 1793 | are involved with system updates or need to modify the operating system in other ways. If this option | ||
| 1794 | is used, C<ReadWritePaths> may be used to exclude specific directories from being | ||
| 1795 | made read-only. Similar, C<StateDirectory>, C<LogsDirectory>, \x{2026} and | ||
| 1796 | related directory settings (see below) also exclude the specific directories from the effect of | ||
| 1797 | C<ProtectSystem>. This setting is implied if C<DynamicUser> is | ||
| 1798 | set. This setting cannot ensure protection in all cases. In general it has the same limitations as | ||
| 1799 | C<ReadOnlyPaths>, see below. Defaults to off. | ||
| 1800 | |||
| 1801 | Note that if C<ProtectSystem> is set to C<strict> and | ||
| 1802 | C<PrivateTmp> is enabled, then C</tmp/> and | ||
| 1803 | C</var/tmp/> will be writable.", | ||
| 1804 | 'ReadOnlyPaths' => '*ExecPaths', | ||
| 1805 | 'ReadWritePaths' => '*ExecPaths', | ||
| 1806 | 'RemoveIPC' => 'Takes a boolean parameter. If set, all System V and POSIX IPC objects owned by the user and | ||
| 1807 | group the processes of this unit are run as are removed when the unit is stopped. This setting only has an | ||
| 1808 | effect if at least one of C<User>, C<Group> and | ||
| 1809 | C<DynamicUser> are used. It has no effect on IPC objects owned by the root user. Specifically, | ||
| 1810 | this removes System V semaphores, as well as System V and POSIX shared memory segments and message queues. If | ||
| 1811 | multiple units use the same user or group the IPC objects are removed when the last of these units is | ||
| 1812 | stopped. This setting is implied if C<DynamicUser> is set.', | ||
| 1813 | 'RestrictAddressFamilies' => 'Restricts the set of socket address families accessible to the processes of this | ||
| 1814 | unit. Takes C<none>, or a space-separated list of address family names to | ||
| 1815 | allow-list, such as C<AF_UNIX>, C<AF_INET> or | ||
| 1816 | C<AF_INET6>, see | ||
| 1817 | L<address_families(7)> | ||
| 1818 | for all possible options. When C<none> is specified, then all address | ||
| 1819 | families will be denied. When prefixed with C<~> the listed address | ||
| 1820 | families will be applied as deny list, otherwise as allow list. | ||
| 1821 | |||
| 1822 | By default, no restrictions apply, all address families are accessible to processes. If | ||
| 1823 | assigned the empty string, any previous address family restriction changes are undone. This setting | ||
| 1824 | does not affect commands prefixed with C<+>. | ||
| 1825 | |||
| 1826 | Use this option to limit exposure of processes to remote access, in particular via exotic and | ||
| 1827 | sensitive network protocols, such as C<AF_PACKET>. Note that in most cases, the | ||
| 1828 | local C<AF_UNIX> address family should be included in the configured allow list as | ||
| 1829 | it is frequently used for local communication, including for | ||
| 1830 | L<syslog(2)> | ||
| 1831 | logging. | ||
| 1832 | |||
| 1833 | Note that this restricts access to the L<socket(2)> | ||
| 1834 | system call only. Sockets passed into the process by other means (for example, by using socket | ||
| 1835 | activation with socket units, see | ||
| 1836 | L<systemd.socket(5)>) | ||
| 1837 | are unaffected. Also, sockets created with socketpair() (which creates connected | ||
| 1838 | AF_UNIX sockets) or the | ||
| 1839 | L<io_uring(7)> | ||
| 1840 | functions, are not affected. Thus, it is recommended to combined this setting with | ||
| 1841 | C<SystemCallFilter=@service>, to only allow a limited subset of system calls. | ||
| 1842 | |||
| 1843 | Note that this option is limited to some ABIs, in particular x86-64, but currently has no | ||
| 1844 | effect on 32-bit x86, s390, s390x, mips, mips-le, ppc, ppc-le, ppc64, or ppc64-le, and is ignored. On | ||
| 1845 | systems supporting multiple ABIs (such as x86/x86-64) it is recommended to turn off alternative ABIs | ||
| 1846 | for services, so that they cannot be used to circumvent the restrictions of this option. | ||
| 1847 | Specifically, it is recommended to combine this option with | ||
| 1848 | C<SystemCallArchitectures=native> or similar.', | ||
| 1849 | 'RestrictFileSystems' => 'Restricts the set of filesystems processes of this unit can open files on. Takes a space-separated | ||
| 1850 | list of filesystem names. Any filesystem listed is made accessible to the unit\'s processes, access to filesystem | ||
| 1851 | types not listed is prohibited (allow-listing). If the first character of the list is C<~>, the | ||
| 1852 | effect is inverted: access to the filesystems listed is prohibited (deny-listing). If the empty string is assigned, | ||
| 1853 | access to filesystems is not restricted. | ||
| 1854 | |||
| 1855 | If you specify both types of this option (i.e. allow-listing and deny-listing), the first encountered will take | ||
| 1856 | precedence and will dictate the default action (allow access to the filesystem or deny it). Then the next occurrences | ||
| 1857 | of this option will add or delete the listed filesystems from the set of the restricted filesystems, depending on its | ||
| 1858 | type and the default action. | ||
| 1859 | |||
| 1860 | Example: if a unit has the following, | ||
| 1861 | |||
| 1862 | RestrictFileSystems=ext4 tmpfs | ||
| 1863 | RestrictFileSystems=ext2 ext4 | ||
| 1864 | |||
| 1865 | then access to C<ext4>, C<tmpfs>, and C<ext2> is allowed | ||
| 1866 | and access to other filesystems is denied. | ||
| 1867 | |||
| 1868 | Example: if a unit has the following, | ||
| 1869 | |||
| 1870 | RestrictFileSystems=ext4 tmpfs | ||
| 1871 | RestrictFileSystems=~ext4 | ||
| 1872 | |||
| 1873 | then only access C<tmpfs> is allowed. | ||
| 1874 | |||
| 1875 | Example: if a unit has the following, | ||
| 1876 | |||
| 1877 | RestrictFileSystems=~ext4 tmpfs | ||
| 1878 | RestrictFileSystems=ext4 | ||
| 1879 | |||
| 1880 | then only access to C<tmpfs> is denied. | ||
| 1881 | |||
| 1882 | As the number of possible filesystems is large, predefined sets of filesystems are provided. A set | ||
| 1883 | starts with C<@> character, followed by name of the set. | ||
| 1884 | |||
| 1885 | Use | ||
| 1886 | L<systemd-analyze(1)>\'s | ||
| 1887 | filesystems command to retrieve a list of filesystems defined on the local | ||
| 1888 | system. | ||
| 1889 | |||
| 1890 | Note that this setting might not be supported on some systems (for example if the LSM eBPF hook is | ||
| 1891 | not enabled in the underlying kernel or if not using the unified control group hierarchy). In that case this setting | ||
| 1892 | has no effect.', | ||
| 1893 | 'RestrictNamespaces' => "Restricts access to Linux namespace functionality for the processes of this unit. For details | ||
| 1894 | about Linux namespaces, see L<namespaces(7)>. Either | ||
| 1895 | takes a boolean argument, or a space-separated list of namespace type identifiers. If false (the default), no | ||
| 1896 | restrictions on namespace creation and switching are made. If true, access to any kind of namespacing is | ||
| 1897 | prohibited. Otherwise, a space-separated list of namespace type identifiers must be specified, consisting of | ||
| 1898 | any combination of: C<cgroup>, C<ipc>, C<net>, | ||
| 1899 | C<mnt>, C<pid>, C<user>, C<uts>, and | ||
| 1900 | C<time>. Any namespace type listed is made accessible to the unit's processes, access to | ||
| 1901 | namespace types not listed is prohibited (allow-listing). By prepending the list with a single tilde | ||
| 1902 | character (C<~>) the effect may be inverted: only the listed namespace types will be made | ||
| 1903 | inaccessible, all unlisted ones are permitted (deny-listing). If the empty string is assigned, the default | ||
| 1904 | namespace restrictions are applied, which is equivalent to false. This option may appear more than once, in | ||
| 1905 | which case the namespace types are merged by C<OR>, or by C<AND> if the | ||
| 1906 | lines are prefixed with C<~> (see examples below). Internally, this setting limits access to | ||
| 1907 | the L<unshare(2)>, | ||
| 1908 | L<clone(2)> and | ||
| 1909 | L<setns(2)> system calls, taking | ||
| 1910 | the specified flags parameters into account. Note that \x{2014} if this option is used \x{2014} in addition to restricting | ||
| 1911 | creation and switching of the specified types of namespaces (or all of them, if true) access to the | ||
| 1912 | setns() system call with a zero flags parameter is prohibited. This setting is only | ||
| 1913 | supported on x86, x86-64, mips, mips-le, mips64, mips64-le, mips64-n32, mips64-le-n32, ppc64, ppc64-le, s390 | ||
| 1914 | and s390x, and enforces no restrictions on other architectures. | ||
| 1915 | |||
| 1916 | Example: if a unit has the following, | ||
| 1917 | |||
| 1918 | RestrictNamespaces=cgroup ipc | ||
| 1919 | RestrictNamespaces=cgroup net | ||
| 1920 | |||
| 1921 | then C<cgroup>, C<ipc>, and C<net> are set. | ||
| 1922 | If the second line is prefixed with C<~>, e.g., | ||
| 1923 | |||
| 1924 | RestrictNamespaces=cgroup ipc | ||
| 1925 | RestrictNamespaces=~cgroup net | ||
| 1926 | |||
| 1927 | then, only C<ipc> is set.", | ||
| 1928 | 'RestrictRealtime' => 'Takes a boolean argument. If set, any attempts to enable realtime scheduling in a process of | ||
| 1929 | the unit are refused. This restricts access to realtime task scheduling policies such as | ||
| 1930 | C<SCHED_FIFO>, C<SCHED_RR> or C<SCHED_DEADLINE>. See | ||
| 1931 | L<sched(7)> | ||
| 1932 | for details about these scheduling policies. Realtime scheduling policies may be used to monopolize CPU | ||
| 1933 | time for longer periods of time, and may hence be used to lock up or otherwise trigger Denial-of-Service | ||
| 1934 | situations on the system. It is hence recommended to restrict access to realtime scheduling to the few programs | ||
| 1935 | that actually require them. Defaults to off.', | ||
| 1936 | 'RestrictSUIDSGID' => 'Takes a boolean argument. If set, any attempts to set the set-user-ID (SUID) or | ||
| 1937 | set-group-ID (SGID) bits on files or directories will be denied (for details on these bits see | ||
| 1938 | L<inode(7)>). | ||
| 1939 | As the SUID/SGID bits are mechanisms to elevate privileges, and allow users to acquire the | ||
| 1940 | identity of other users, it is recommended to restrict creation of SUID/SGID files to the few | ||
| 1941 | programs that actually require them. Note that this restricts marking of any type of file system | ||
| 1942 | object with these bits, including both regular files and directories (where the SGID is a different | ||
| 1943 | meaning than for files, see documentation). This option is implied if C<DynamicUser> | ||
| 1944 | is enabled. | ||
| 1945 | |||
| 1946 | In other cases, this setting defaults to the value set with C<DefaultRestrictSUIDSGID> in | ||
| 1947 | L<systemd-system.conf(5)>, which | ||
| 1948 | defaults to off.', | ||
| 1949 | 'RootDirectory' => 'Takes a directory path relative to the host\'s root directory (i.e. the root of the system | ||
| 1950 | running the service manager). Sets the root directory for executed processes, with the L<pivot_root(2)> | ||
| 1951 | or L<chroot(2)> | ||
| 1952 | system call. If this is used, it must be ensured that the process binary and all its auxiliary files | ||
| 1953 | are available in the new root. Note that setting this parameter might result in additional | ||
| 1954 | dependencies to be added to the unit (see above). | ||
| 1955 | |||
| 1956 | The C<MountAPIVFS> and C<PrivateUsers> settings are particularly useful | ||
| 1957 | in conjunction with C<RootDirectory>. For details, see below. | ||
| 1958 | |||
| 1959 | If C<RootDirectory>/C<RootImage> are used together with | ||
| 1960 | C<NotifyAccess> the notification socket is automatically mounted from the host into | ||
| 1961 | the root environment, to ensure the notification interface can work correctly. | ||
| 1962 | |||
| 1963 | Note that services using C<RootDirectory>/C<RootImage> will | ||
| 1964 | not be able to log via the syslog or journal protocols to the host logging infrastructure, unless the | ||
| 1965 | relevant sockets are mounted from the host, specifically: | ||
| 1966 | |||
| 1967 | The host\'s | ||
| 1968 | L<os-release(5)> | ||
| 1969 | file will be made available for the service (read-only) as | ||
| 1970 | C</run/host/os-release>. | ||
| 1971 | It will be updated automatically on soft reboot (see: | ||
| 1972 | L<systemd-soft-reboot.service(8)>), | ||
| 1973 | in case the service is configured to survive it.', | ||
| 1974 | 'RootEphemeral' => 'Takes a boolean argument. If enabled, executed processes will run in an ephemeral | ||
| 1975 | copy of the root directory or root image. The ephemeral copy is placed in | ||
| 1976 | C</var/lib/systemd/ephemeral-trees/> while the service is active and is cleaned up | ||
| 1977 | when the service is stopped or restarted. If C<RootDirectory> is used and the root | ||
| 1978 | directory is a subvolume, the ephemeral copy will be created by making a snapshot of the subvolume. | ||
| 1979 | |||
| 1980 | To make sure making ephemeral copies can be made efficiently, the root directory or root image | ||
| 1981 | should be located on the same filesystem as C</var/lib/systemd/ephemeral-trees/>. | ||
| 1982 | When using C<RootEphemeral> with root directories, | ||
| 1983 | L<btrfs(5)> | ||
| 1984 | should be used as the filesystem and the root directory should ideally be a subvolume which | ||
| 1985 | systemd can snapshot to make the ephemeral copy. For root images, a filesystem | ||
| 1986 | with support for reflinks should be used to ensure an efficient ephemeral copy.', | ||
| 1987 | 'RootHash' => 'Takes a data integrity (dm-verity) root hash specified in hexadecimal, or the path to a file | ||
| 1988 | containing a root hash in ASCII hexadecimal format. This option enables data integrity checks using dm-verity, | ||
| 1989 | if the used image contains the appropriate integrity data (see above) or if C<RootVerity> is used. | ||
| 1990 | The specified hash must match the root hash of integrity data, and is usually at least 256 bits (and hence 64 | ||
| 1991 | formatted hexadecimal characters) long (in case of SHA256 for example). If this option is not specified, but | ||
| 1992 | the image file carries the C<user.verity.roothash> extended file attribute (see L<xattr(7)>), then the root | ||
| 1993 | hash is read from it, also as formatted hexadecimal characters. If the extended file attribute is not found (or | ||
| 1994 | is not supported by the underlying file system), but a file with the C<.roothash> suffix is | ||
| 1995 | found next to the image file, bearing otherwise the same name (except if the image has the | ||
| 1996 | C<.raw> suffix, in which case the root hash file must not have it in its name), the root hash | ||
| 1997 | is read from it and automatically used, also as formatted hexadecimal characters. | ||
| 1998 | |||
| 1999 | If the disk image contains a separate C</usr/> partition it may also be | ||
| 2000 | Verity protected, in which case the root hash may configured via an extended attribute | ||
| 2001 | C<user.verity.usrhash> or a C<.usrhash> file adjacent to the disk | ||
| 2002 | image. There\'s currently no option to configure the root hash for the C</usr/> file | ||
| 2003 | system via the unit file directly.', | ||
| 2004 | 'RootHashSignature' => 'Takes a PKCS7 signature of the C<RootHash> option as a path to a | ||
| 2005 | DER-encoded signature file, or as an ASCII base64 string encoding of a DER-encoded signature prefixed | ||
| 2006 | by C<base64:>. The dm-verity volume will only be opened if the signature of the root | ||
| 2007 | hash is valid and signed by a public key present in the kernel keyring. If this option is not | ||
| 2008 | specified, but a file with the C<.roothash.p7s> suffix is found next to the image | ||
| 2009 | file, bearing otherwise the same name (except if the image has the C<.raw> suffix, | ||
| 2010 | in which case the signature file must not have it in its name), the signature is read from it and | ||
| 2011 | automatically used. | ||
| 2012 | |||
| 2013 | If the disk image contains a separate C</usr/> partition it may also be | ||
| 2014 | Verity protected, in which case the signature for the root hash may configured via a | ||
| 2015 | C<.usrhash.p7s> file adjacent to the disk image. There\'s currently no option to | ||
| 2016 | configure the root hash signature for the C</usr/> via the unit file | ||
| 2017 | directly.', | ||
| 2018 | 'RootImage' => 'Takes a path to a block device node or regular file as argument. This call is similar | ||
| 2019 | to C<RootDirectory> however mounts a file system hierarchy from a block device node | ||
| 2020 | or loopback file instead of a directory. The device node or file system image file needs to contain a | ||
| 2021 | file system without a partition table, or a file system within an MBR/MS-DOS or GPT partition table | ||
| 2022 | with only a single Linux-compatible partition, or a set of file systems within a GPT partition table | ||
| 2023 | that follows the L<UAPI.2 | ||
| 2024 | Discoverable Partitions | ||
| 2025 | Specification|https://uapi-group.org/specifications/specs/discoverable_partitions_specification>. | ||
| 2026 | |||
| 2027 | When C<DevicePolicy> is set to C<closed> or | ||
| 2028 | C<strict>, or set to C<auto> and C<DeviceAllow> is | ||
| 2029 | set, then this setting adds C</dev/loop-control> with C<rw> mode, | ||
| 2030 | C<block-loop> and C<block-blkext> with C<rwm> mode | ||
| 2031 | to C<DeviceAllow>. See | ||
| 2032 | L<systemd.resource-control(5)> | ||
| 2033 | for the details about C<DevicePolicy> or C<DeviceAllow>. Also, see | ||
| 2034 | C<PrivateDevices> below, as it may change the setting of | ||
| 2035 | C<DevicePolicy>. | ||
| 2036 | |||
| 2037 | Units making use of C<RootImage> automatically gain an | ||
| 2038 | C<After> dependency on C<systemd-udevd.service>. | ||
| 2039 | |||
| 2040 | The host\'s | ||
| 2041 | L<os-release(5)> | ||
| 2042 | file will be made available for the service (read-only) as | ||
| 2043 | C</run/host/os-release>. | ||
| 2044 | It will be updated automatically on soft reboot (see: | ||
| 2045 | L<systemd-soft-reboot.service(8)>), | ||
| 2046 | in case the service is configured to survive it.', | ||
| 2047 | 'RootImageOptions' => 'Takes a comma-separated list of mount options that will be used on disk images specified by | ||
| 2048 | C<RootImage>. Optionally a partition name can be prefixed, followed by colon, in | ||
| 2049 | case the image has multiple partitions, otherwise partition name C<root> is implied. | ||
| 2050 | Options for multiple partitions can be specified in a single line with space separators. Assigning an empty | ||
| 2051 | string removes previous assignments. For a list of valid mount options, please refer to | ||
| 2052 | L<mount(8)>. | ||
| 2053 | |||
| 2054 | Valid partition names follow the | ||
| 2055 | L<Discoverable Partitions | ||
| 2056 | Specification|https://uapi-group.org/specifications/specs/discoverable_partitions_specification>: | ||
| 2057 | C<root>, C<usr>, C<home>, C<srv>, | ||
| 2058 | C<esp>, C<xbootldr>, C<tmp>, | ||
| 2059 | C<var>.', | ||
| 2060 | 'RootImagePolicy' => '*ExtensionImagePolicy', | ||
| 2061 | 'RootMStack' => 'Takes a path to a | ||
| 2062 | L<systemd.mstack(7)> | ||
| 2063 | directory encapsulating a mount stack consisting of layers and bind mounts. Similar to | ||
| 2064 | C<RootDirectory> and C<RootImage> this runs the service off a | ||
| 2065 | distinct root file system, in this case set up via C<overlayfs>. | ||
| 2066 | |||
| 2067 | Since C<.mstack/> directories may reference disk images (DDIs) similar device | ||
| 2068 | policy extensions and dependencies are in effect when C<RootMStack> is used as are | ||
| 2069 | if C<RootImage> is used.', | ||
| 2070 | 'RootVerity' => 'Takes the path to a data integrity (dm-verity) file. This option enables data integrity checks | ||
| 2071 | using dm-verity, if C<RootImage> is used and a root-hash is passed and if the used image itself | ||
| 2072 | does not contain the integrity data. The integrity data must be matched by the root hash. If this option is not | ||
| 2073 | specified, but a file with the C<.verity> suffix is found next to the image file, bearing otherwise | ||
| 2074 | the same name (except if the image has the C<.raw> suffix, in which case the verity data file must | ||
| 2075 | not have it in its name), the verity data is read from it and automatically used. | ||
| 2076 | |||
| 2077 | This option is supported only for disk images that contain a single file system, without an | ||
| 2078 | enveloping partition table. Images that contain a GPT partition table should instead include both | ||
| 2079 | root file system and matching Verity data in the same image, implementing the | ||
| 2080 | L<Discoverable Partitions | ||
| 2081 | Specification|https://uapi-group.org/specifications/specs/discoverable_partitions_specification>.', | ||
| 2082 | 'RuntimeDirectory' => '*CacheDirectory', | ||
| 2083 | 'RuntimeDirectoryMode' => '*CacheDirectoryMode', | ||
| 2084 | 'RuntimeDirectoryPreserve' => 'Takes a boolean argument or C<restart>. If set to C<no> (the | ||
| 2085 | default), the directories specified in C<RuntimeDirectory> are always removed when the service | ||
| 2086 | stops. If set to C<restart> the directories are preserved when the service is both automatically | ||
| 2087 | and manually restarted. Here, the automatic restart means the operation specified in | ||
| 2088 | C<Restart>, and manual restart means the one triggered by systemctl restart | ||
| 2089 | foo.service. If set to C<yes>, then the directories are not removed when the service is | ||
| 2090 | stopped. Note that since the runtime directory C</run/> is a mount point of | ||
| 2091 | C<tmpfs>, then for system services the directories specified in | ||
| 2092 | C<RuntimeDirectory> are removed when the system is rebooted. | ||
| 2093 | |||
| 2094 | If C<DynamicUser> is used together with | ||
| 2095 | C<RuntimeDirectoryPreserve> set to values other than C<no>, the logic | ||
| 2096 | is slightly altered: the C<RuntimeDirectory> directories are created below | ||
| 2097 | C</run/private/>, which is a host directory made inaccessible to unprivileged | ||
| 2098 | users, which ensures that access to these directories cannot be gained through dynamic user ID | ||
| 2099 | recycling. Symbolic links are created to hide this difference in behaviour. Both from the | ||
| 2100 | perspective of the host and from inside the unit, the relevant directories hence always appear | ||
| 2101 | directly below C</run/>.', | ||
| 2102 | 'SELinuxContext' => 'Set the SELinux security context of the executed process. If set, this will override the | ||
| 2103 | automated domain transition. However, the policy still needs to authorize the transition. This directive is | ||
| 2104 | ignored if SELinux is disabled. If prefixed by C<->, failing to set the SELinux | ||
| 2105 | security context will be ignored, but it is still possible that the subsequent | ||
| 2106 | execve() may fail if the policy does not allow the transition for the | ||
| 2107 | non-overridden context. This does not affect commands prefixed with C<+>. See | ||
| 2108 | L<setexeccon(3)> | ||
| 2109 | for details.', | ||
| 2110 | 'SecureBits' => 'Controls the secure bits set for the executed process. Takes a space-separated combination of | ||
| 2111 | options from the following list: C<keep-caps>, C<keep-caps-locked>, | ||
| 2112 | C<no-setuid-fixup>, C<no-setuid-fixup-locked>, C<noroot>, and | ||
| 2113 | C<noroot-locked>. This option may appear more than once, in which case the secure bits are | ||
| 2114 | ORed. If the empty string is assigned to this option, the bits are reset to 0. This does not affect commands | ||
| 2115 | prefixed with C<+>. See L<capabilities(7)> for | ||
| 2116 | details.', | ||
| 2117 | 'SetCredential' => 'The C<SetCredential> setting is similar to | ||
| 2118 | C<LoadCredential> but accepts a literal value to use as data for the credential, | ||
| 2119 | instead of a file system path to read the data from. Do not use this option for data that is supposed | ||
| 2120 | to be secret, as it is accessible to unprivileged processes via IPC. It\'s only safe to use this for | ||
| 2121 | user IDs, public key material and similar non-sensitive data. For everything else use | ||
| 2122 | C<LoadCredential>. In order to embed binary data into the credential data use | ||
| 2123 | C-style escaping (i.e. C<\\n> to embed a newline, or C<\\x00> to embed | ||
| 2124 | a C<NUL> byte). | ||
| 2125 | |||
| 2126 | The C<SetCredentialEncrypted> setting is identical to | ||
| 2127 | C<SetCredential> but expects an encrypted credential in literal form as value. This | ||
| 2128 | allows embedding confidential credentials securely directly in unit files. Use | ||
| 2129 | L<systemd-creds(1)>\' | ||
| 2130 | C<-p> switch to generate suitable C<SetCredentialEncrypted> lines | ||
| 2131 | directly from plaintext credentials. For further details see | ||
| 2132 | C<LoadCredentialEncrypted> above. | ||
| 2133 | |||
| 2134 | When multiple credentials of the same name are found, credentials found by | ||
| 2135 | C<LoadCredential>, C<LoadCredentialEncrypted> and | ||
| 2136 | C<ImportCredential> take priority over credentials found by | ||
| 2137 | C<SetCredential>. As such, C<SetCredential> will act as default if | ||
| 2138 | no credentials are found by any of the former. In this case, not being able to retrieve the credential | ||
| 2139 | from the path specified in C<LoadCredential> or | ||
| 2140 | C<LoadCredentialEncrypted> is not considered fatal.', | ||
| 2141 | 'SetCredentialEncrypted' => '*SetCredential', | ||
| 2142 | 'SetLoginEnvironment' => 'Takes a boolean parameter that controls whether to set the C<$HOME>, | ||
| 2143 | C<$LOGNAME>, and C<$SHELL> environment variables. If not set, this | ||
| 2144 | defaults to true if C<User>, C<DynamicUser> or | ||
| 2145 | C<PAMName> are set, false otherwise. If set to true, the variables will always be | ||
| 2146 | set for system services, i.e. even when the default user C<root> is used. If set to | ||
| 2147 | false, the mentioned variables are not set by the service manager, no matter whether | ||
| 2148 | C<User>, C<DynamicUser>, or C<PAMName> are used or | ||
| 2149 | not. This option normally has no effect on services of the per-user service manager, since in that | ||
| 2150 | case these variables are typically inherited from user manager\'s own environment anyway.', | ||
| 2151 | 'SmackProcessLabel' => 'Takes a C<SMACK64> security label as argument. The process executed by the unit | ||
| 2152 | will be started under this label and SMACK will decide whether the process is allowed to run or not, based on | ||
| 2153 | it. The process will continue to run under the label specified here unless the executable has its own | ||
| 2154 | C<SMACK64EXEC> label, in which case the process will transition to run under that label. When not | ||
| 2155 | specified, the label that systemd is running under is used. This directive is ignored if SMACK is | ||
| 2156 | disabled. | ||
| 2157 | |||
| 2158 | The value may be prefixed by C<->, in which case all errors will be ignored. An empty | ||
| 2159 | value may be specified to unset previous assignments. This does not affect commands prefixed with | ||
| 2160 | C<+>.', | ||
| 2161 | 'StandardError' => 'Controls where file descriptor 2 (stderr) of the executed processes is connected to. The | ||
| 2162 | available options are identical to those of C<StandardOutput>, with some exceptions: if set to | ||
| 2163 | C<inherit> the file descriptor used for standard output is duplicated for standard error, while | ||
| 2164 | C<fd:name> will use a default file descriptor name of | ||
| 2165 | C<stderr>. | ||
| 2166 | |||
| 2167 | This setting defaults to the value set with C<DefaultStandardError> in | ||
| 2168 | L<systemd-system.conf(5)>, which | ||
| 2169 | defaults to C<inherit>. Note that setting this parameter might result in additional dependencies | ||
| 2170 | to be added to the unit (see above).', | ||
| 2171 | 'StandardInput' => "Controls where file descriptor 0 (STDIN) of the executed processes is connected to. Takes one | ||
| 2172 | of C<null>, C<tty>, C<tty-force>, C<tty-fail>, | ||
| 2173 | C<data>, C<file:path>, C<socket> or | ||
| 2174 | C<fd:name>. | ||
| 2175 | |||
| 2176 | If C<null> is selected, standard input will be connected to C</dev/null>, | ||
| 2177 | i.e. all read attempts by the process will result in immediate EOF. | ||
| 2178 | |||
| 2179 | If C<tty> is selected, standard input is connected to a TTY (as configured by | ||
| 2180 | C<TTYPath>, see below) and the executed process becomes the controlling process of the | ||
| 2181 | terminal. If the terminal is already being controlled by another process, the executed process waits until the | ||
| 2182 | current controlling process releases the terminal. | ||
| 2183 | |||
| 2184 | C<tty-force> is similar to C<tty>, but the executed process is forcefully and | ||
| 2185 | immediately made the controlling process of the terminal, potentially removing previous controlling processes | ||
| 2186 | from the terminal. | ||
| 2187 | |||
| 2188 | C<tty-fail> is similar to C<tty>, but if the terminal already has a | ||
| 2189 | controlling process start-up of the executed process fails. | ||
| 2190 | |||
| 2191 | The C<data> option may be used to configure arbitrary textual or binary data to pass via | ||
| 2192 | standard input to the executed process. The data to pass is configured via | ||
| 2193 | C<StandardInputText>/C<StandardInputData> (see below). Note that the actual | ||
| 2194 | file descriptor type passed (memory file, regular file, UNIX pipe, \x{2026}) might depend on the kernel and available | ||
| 2195 | privileges. In any case, the file descriptor is read-only, and when read returns the specified data followed by | ||
| 2196 | EOF. | ||
| 2197 | |||
| 2198 | The C<file:path> option may be used to connect a specific file | ||
| 2199 | system object to standard input. An absolute path following the C<:> character is expected, | ||
| 2200 | which may refer to a regular file, a FIFO or special file. If an C<AF_UNIX> socket in the | ||
| 2201 | file system is specified, a stream socket is connected to it. The latter is useful for connecting standard | ||
| 2202 | input of processes to arbitrary system services. | ||
| 2203 | |||
| 2204 | The C<socket> option is valid in socket-activated services only, and requires the relevant | ||
| 2205 | socket unit file (see | ||
| 2206 | L<systemd.socket(5)> for details) | ||
| 2207 | to have C<Accept=yes> set, or to specify a single socket only. If this option is set, standard | ||
| 2208 | input will be connected to the socket the service was activated from, which is primarily useful for | ||
| 2209 | compatibility with daemons designed for use with the traditional L<inetd(8)> socket activation | ||
| 2210 | daemon (C<\$LISTEN_FDS> (and related) environment variables are not passed when | ||
| 2211 | C<socket> value is configured). | ||
| 2212 | |||
| 2213 | The C<fd:name> option connects standard input to a specific, | ||
| 2214 | named file descriptor provided by a socket unit. The name may be specified as part of this option, following a | ||
| 2215 | C<:> character (e.g. C<fd:foobar>). If no name is specified, the name | ||
| 2216 | C<stdin> is implied (i.e. C<fd> is equivalent to C<fd:stdin>). | ||
| 2217 | At least one socket unit defining the specified name must be provided via the C<Sockets> | ||
| 2218 | option, and the file descriptor name may differ from the name of its containing socket unit. If multiple | ||
| 2219 | matches are found, the first one will be used. See C<FileDescriptorName> in | ||
| 2220 | L<systemd.socket(5)> for more | ||
| 2221 | details about named file descriptors and their ordering. | ||
| 2222 | |||
| 2223 | This setting defaults to C<null>, unless | ||
| 2224 | C<StandardInputText>/C<StandardInputData> are set, in which case it | ||
| 2225 | defaults to C<data>.", | ||
| 2226 | 'StandardInputData' => "Configures arbitrary textual or binary data to pass via file descriptor 0 (STDIN) to | ||
| 2227 | the executed processes. These settings have no effect unless C<StandardInput> is set | ||
| 2228 | to C<data> (which is the default if C<StandardInput> is not set | ||
| 2229 | otherwise, but C<StandardInputText>/C<StandardInputData> is). Use | ||
| 2230 | this option to embed process input data directly in the unit file. | ||
| 2231 | |||
| 2232 | C<StandardInputText> accepts arbitrary textual data. C-style escapes for special | ||
| 2233 | characters as well as the usual C<%>-specifiers are resolved. Each time this setting is used | ||
| 2234 | the specified text is appended to the per-unit data buffer, followed by a newline character (thus every use | ||
| 2235 | appends a new line to the end of the buffer). Note that leading and trailing whitespace of lines configured | ||
| 2236 | with this option is removed. If an empty line is specified the buffer is cleared (hence, in order to insert an | ||
| 2237 | empty line, add an additional C<\\n> to the end or beginning of a line). | ||
| 2238 | |||
| 2239 | C<StandardInputData> accepts arbitrary binary data, encoded in | ||
| 2240 | L<Base64|https://tools.ietf.org/html/rfc2045#section-6.8>. No escape sequences or specifiers are | ||
| 2241 | resolved. Any whitespace in the encoded version is ignored during decoding. | ||
| 2242 | |||
| 2243 | Note that C<StandardInputText> and C<StandardInputData> operate on the | ||
| 2244 | same data buffer, and may be mixed in order to configure both binary and textual data for the same input | ||
| 2245 | stream. The textual or binary data is joined strictly in the order the settings appear in the unit | ||
| 2246 | file. Assigning an empty string to either will reset the data buffer. | ||
| 2247 | |||
| 2248 | Please keep in mind that in order to maintain readability long unit file settings may be split into | ||
| 2249 | multiple lines, by suffixing each line (except for the last) with a C<\\> character (see | ||
| 2250 | L<systemd.unit(5)> for | ||
| 2251 | details). This is particularly useful for large data configured with these two options. Example: | ||
| 2252 | |||
| 2253 | \x{2026} | ||
| 2254 | StandardInput=data | ||
| 2255 | StandardInputData=V2XigLJyZSBubyBzdHJhbmdlcnMgdG8gbG92ZQpZb3Uga25vdyB0aGUgcnVsZXMgYW5kIHNvIGRv \\ | ||
| 2256 | IEkKQSBmdWxsIGNvbW1pdG1lbnQncyB3aGF0IEnigLJtIHRoaW5raW5nIG9mCllvdSB3b3VsZG4n \\ | ||
| 2257 | dCBnZXQgdGhpcyBmcm9tIGFueSBvdGhlciBndXkKSSBqdXN0IHdhbm5hIHRlbGwgeW91IGhvdyBJ \\ | ||
| 2258 | J20gZmVlbGluZwpHb3R0YSBtYWtlIHlvdSB1bmRlcnN0YW5kCgpOZXZlciBnb25uYSBnaXZlIHlv \\ | ||
| 2259 | dSB1cApOZXZlciBnb25uYSBsZXQgeW91IGRvd24KTmV2ZXIgZ29ubmEgcnVuIGFyb3VuZCBhbmQg \\ | ||
| 2260 | ZGVzZXJ0IHlvdQpOZXZlciBnb25uYSBtYWtlIHlvdSBjcnkKTmV2ZXIgZ29ubmEgc2F5IGdvb2Ri \\ | ||
| 2261 | eWUKTmV2ZXIgZ29ubmEgdGVsbCBhIGxpZSBhbmQgaHVydCB5b3UK | ||
| 2262 | \x{2026} | ||
| 2263 | ", | ||
| 2264 | 'StandardInputText' => '*StandardInputData', | ||
| 2265 | 'StandardOutput' => "Controls where file descriptor 1 (stdout) of the executed processes is connected | ||
| 2266 | to. Takes one of C<inherit>, C<null>, C<tty>, | ||
| 2267 | C<journal>, C<kmsg>, C<journal+console>, | ||
| 2268 | C<kmsg+console>, C<file:path>, | ||
| 2269 | C<append:path>, C<truncate:path>, | ||
| 2270 | C<socket> or C<fd:name>. | ||
| 2271 | |||
| 2272 | C<inherit> duplicates the file descriptor of standard input for standard output. | ||
| 2273 | |||
| 2274 | C<null> connects standard output to C</dev/null>, i.e. everything written | ||
| 2275 | to it will be lost. | ||
| 2276 | |||
| 2277 | C<tty> connects standard output to a tty (as configured via C<TTYPath>, | ||
| 2278 | see below). If the TTY is used for output only, the executed process will not become the controlling process of | ||
| 2279 | the terminal, and will not fail or wait for other processes to release the terminal. Note: if a unit | ||
| 2280 | tries to print multiple lines to a TTY during bootup or shutdown, then there's a chance that those | ||
| 2281 | lines will be broken up by status messages. SetShowStatus() can be used to | ||
| 2282 | prevent this problem. See | ||
| 2283 | L<org.freedesktop.systemd1(5)> | ||
| 2284 | for details. | ||
| 2285 | |||
| 2286 | C<journal> connects standard output with the journal, which is accessible via | ||
| 2287 | L<journalctl(1)>. Note | ||
| 2288 | that everything that is written to kmsg (see below) is implicitly stored in the journal as well, the | ||
| 2289 | specific option listed below is hence a superset of this one. (Also note that any external, | ||
| 2290 | additional syslog daemons receive their log data from the journal, too, hence this is the option to | ||
| 2291 | use when logging shall be processed with such a daemon.) | ||
| 2292 | |||
| 2293 | C<kmsg> connects standard output with the kernel log buffer which is accessible via | ||
| 2294 | L<dmesg(1)>, | ||
| 2295 | in addition to the journal. The journal daemon might be configured to send all logs to kmsg anyway, in which | ||
| 2296 | case this option is no different from C<journal>. | ||
| 2297 | |||
| 2298 | C<journal+console> and C<kmsg+console> work in a similar way as the | ||
| 2299 | two options above but copy the output to the system console as well. | ||
| 2300 | |||
| 2301 | The C<file:path> option may be used to connect a specific file | ||
| 2302 | system object to standard output. The semantics are similar to the same option of | ||
| 2303 | C<StandardInput>, see above. If path refers to a regular file | ||
| 2304 | on the filesystem, it is opened (created if it does not exist yet using privileges of the user executing the | ||
| 2305 | systemd process) for writing at the beginning of the file, but without truncating it. | ||
| 2306 | If standard input and output are directed to the same file path, it is opened only once \x{2014} for reading as well | ||
| 2307 | as writing \x{2014} and duplicated. This is particularly useful when the specified path refers to an | ||
| 2308 | C<AF_UNIX> socket in the file system, as in that case only a | ||
| 2309 | single stream connection is created for both input and output. | ||
| 2310 | |||
| 2311 | C<append:path> is similar to | ||
| 2312 | C<file:path> above, but it opens the file in append mode. | ||
| 2313 | |||
| 2314 | C<truncate:path> is similar to | ||
| 2315 | C<file:path> above, but it truncates the file when opening | ||
| 2316 | it. For units with multiple command lines, e.g. C<Type=oneshot> services with | ||
| 2317 | multiple C<ExecStart>, or services with C<ExecCondition>, | ||
| 2318 | C<ExecStartPre> or C<ExecStartPost>, the output file is reopened | ||
| 2319 | and therefore re-truncated for each command line. If the output file is truncated while another | ||
| 2320 | process still has the file open, e.g. by an C<ExecReload> running concurrently with | ||
| 2321 | an C<ExecStart>, and the other process continues writing to the file without | ||
| 2322 | adjusting its offset, then the space between the file pointers of the two processes may be filled | ||
| 2323 | with C<NUL> bytes, producing a sparse file. Thus, | ||
| 2324 | C<truncate:path> is typically only useful for units where | ||
| 2325 | only one process runs at a time, such as services with a single C<ExecStart> and no | ||
| 2326 | C<ExecStartPost>, C<ExecReload>, C<ExecStop> or | ||
| 2327 | similar. | ||
| 2328 | |||
| 2329 | C<socket> connects standard output to a socket acquired via socket activation. The | ||
| 2330 | semantics are similar to the same option of C<StandardInput>, see above. | ||
| 2331 | |||
| 2332 | The C<fd:name> option connects standard output to a | ||
| 2333 | specific, named file descriptor provided by a socket unit. A name may be specified as part of this | ||
| 2334 | option, following a C<:> character | ||
| 2335 | (e.g. C<fd:foobar>). If no name is specified, the name | ||
| 2336 | C<stdout> is implied (i.e. C<fd> is equivalent to | ||
| 2337 | C<fd:stdout>). At least one socket unit defining the specified name must be provided | ||
| 2338 | via the C<Sockets> option, and the file descriptor name may differ from the name of | ||
| 2339 | its containing socket unit. If multiple matches are found, the first one will be used. See | ||
| 2340 | C<FileDescriptorName> in | ||
| 2341 | L<systemd.socket(5)> | ||
| 2342 | for more details about named descriptors and their ordering. | ||
| 2343 | |||
| 2344 | If the standard output (or error output, see below) of a unit is connected to the journal or | ||
| 2345 | the kernel log buffer, the unit will implicitly gain a dependency of type C<After> | ||
| 2346 | on C<systemd-journald.socket> (also see the \"Implicit Dependencies\" section | ||
| 2347 | above). Also note that, in this case, stdout (or stderr, see below) will be an | ||
| 2348 | C<AF_UNIX> stream socket, and not a pipe or FIFO that can be reopened. This means | ||
| 2349 | when executing shell scripts the construct echo \"hello\" > /dev/stderr for | ||
| 2350 | writing text to stderr will not work. To mitigate this use the construct echo \"hello\" | ||
| 2351 | >&2 instead, which is mostly equivalent and avoids this pitfall. | ||
| 2352 | |||
| 2353 | If C<StandardInput> is set to one of C<tty>, C<tty-force>, | ||
| 2354 | C<tty-fail>, C<socket>, or C<fd:name>, this | ||
| 2355 | setting defaults to C<inherit>. | ||
| 2356 | |||
| 2357 | In other cases, this setting defaults to the value set with C<DefaultStandardOutput> in | ||
| 2358 | L<systemd-system.conf(5)>, which | ||
| 2359 | defaults to C<journal>. Note that setting this parameter might result in additional dependencies | ||
| 2360 | to be added to the unit (see above).", | ||
| 2361 | 'StateDirectory' => '*CacheDirectory', | ||
| 2362 | 'StateDirectoryAccounting' => '*CacheDirectoryAccounting', | ||
| 2363 | 'StateDirectoryMode' => '*CacheDirectoryMode', | ||
| 2364 | 'StateDirectoryQuota' => '*CacheDirectoryQuota', | ||
| 2365 | 'SupplementaryGroups' => 'Sets the supplementary Unix groups the processes are executed as. This takes a space-separated | ||
| 2366 | list of group names or IDs. This option may be specified more than once, in which case all listed groups are | ||
| 2367 | set as supplementary groups. When the empty string is assigned, the list of supplementary groups is reset, and | ||
| 2368 | all assignments prior to this one will have no effect. In any way, this option does not override, but extends | ||
| 2369 | the list of supplementary groups configured in the system group database for the user. This does not affect | ||
| 2370 | commands prefixed with C<+>.', | ||
| 2371 | 'SyslogFacility' => 'Sets the syslog facility identifier to use when logging. One of | ||
| 2372 | C<kern>, C<user>, C<mail>, C<daemon>, | ||
| 2373 | C<auth>, C<syslog>, C<lpr>, C<news>, | ||
| 2374 | C<uucp>, C<cron>, C<authpriv>, C<ftp>, | ||
| 2375 | C<local0>, C<local1>, C<local2>, C<local3>, | ||
| 2376 | C<local4>, C<local5>, C<local6> or | ||
| 2377 | C<local7>. See L<syslog(3)> for | ||
| 2378 | details. This option is only useful when C<StandardOutput> or | ||
| 2379 | C<StandardError> are set to C<journal> or C<kmsg> (or to | ||
| 2380 | the same settings in combination with C<+console>), and only applies to log messages | ||
| 2381 | written to stdout or stderr. Defaults to C<daemon>.', | ||
| 2382 | 'SyslogIdentifier' => 'Sets the process name ("syslog tag") to prefix log lines sent to | ||
| 2383 | the logging system or the kernel log buffer with. If not set, defaults to the process name of the | ||
| 2384 | executed process. This option is only useful when C<StandardOutput> or | ||
| 2385 | C<StandardError> are set to C<journal> or C<kmsg> (or to | ||
| 2386 | the same settings in combination with C<+console>) and only applies to log messages | ||
| 2387 | written to stdout or stderr.', | ||
| 2388 | 'SyslogLevel' => 'The default syslog log level to use when logging to the logging system or | ||
| 2389 | the kernel log buffer. One of C<emerg>, C<alert>, C<crit>, | ||
| 2390 | C<err>, C<warning>, C<notice>, C<info>, | ||
| 2391 | C<debug>. See L<syslog(3)> for | ||
| 2392 | details. This option is only useful when C<StandardOutput> or | ||
| 2393 | C<StandardError> are set to C<journal> or | ||
| 2394 | C<kmsg> (or to the same settings in combination with C<+console>), and only applies | ||
| 2395 | to log messages written to stdout or stderr. Note that individual lines output by executed processes may be | ||
| 2396 | prefixed with a different log level which can be used to override the default log level specified here. The | ||
| 2397 | interpretation of these prefixes may be disabled with C<SyslogLevelPrefix>, see below. For | ||
| 2398 | details, see L<sd-daemon(3)>. | ||
| 2399 | Defaults to C<info>.', | ||
| 2400 | 'SyslogLevelPrefix' => 'Takes a boolean argument. If true and C<StandardOutput> or | ||
| 2401 | C<StandardError> are set to C<journal> or C<kmsg> (or to | ||
| 2402 | the same settings in combination with C<+console>), log lines written by the executed | ||
| 2403 | process that are prefixed with a log level will be processed with this log level set but the prefix | ||
| 2404 | removed. If set to false, the interpretation of these prefixes is disabled and the logged lines are | ||
| 2405 | passed on as-is. This only applies to log messages written to stdout or stderr. For details about | ||
| 2406 | this prefixing see | ||
| 2407 | L<sd-daemon(3)>. | ||
| 2408 | Defaults to true.', | ||
| 2409 | 'SystemCallArchitectures' => "Takes a space-separated list of architecture identifiers to include in the system call | ||
| 2410 | filter. The known architecture identifiers are the same as for C<ConditionArchitecture> | ||
| 2411 | described in L<systemd.unit(5)>, | ||
| 2412 | as well as C<x32>, C<mips64-n32>, C<mips64-le-n32>, and | ||
| 2413 | the special identifier C<native>. The special identifier C<native> | ||
| 2414 | implicitly maps to the native architecture of the system (or more precisely: to the architecture the system | ||
| 2415 | manager is compiled for). By default, this option is set to the empty list, i.e. no filtering is applied. | ||
| 2416 | |||
| 2417 | If this setting is used, processes of this unit will only be permitted to call native system calls, and | ||
| 2418 | system calls of the specified architectures. For the purposes of this option, the x32 architecture is treated | ||
| 2419 | as including x86-64 system calls. However, this setting still fulfills its purpose, as explained below, on | ||
| 2420 | x32. | ||
| 2421 | |||
| 2422 | System call filtering is not equally effective on all architectures. For example, on x86 | ||
| 2423 | filtering of network socket-related calls is not possible, due to ABI limitations \x{2014} a limitation that x86-64 | ||
| 2424 | does not have, however. On systems supporting multiple ABIs at the same time \x{2014} such as x86/x86-64 \x{2014} it is hence | ||
| 2425 | recommended to limit the set of permitted system call architectures so that secondary ABIs may not be used to | ||
| 2426 | circumvent the restrictions applied to the native ABI of the system. In particular, setting | ||
| 2427 | C<SystemCallArchitectures=native> is a good choice for disabling non-native ABIs. | ||
| 2428 | |||
| 2429 | System call architectures may also be restricted system-wide via the | ||
| 2430 | C<SystemCallArchitectures> option in the global configuration. See | ||
| 2431 | L<systemd-system.conf(5)> for | ||
| 2432 | details.", | ||
| 2433 | 'SystemCallErrorNumber' => 'Takes an C<errno> error number (between 1 and 4095) or errno name | ||
| 2434 | such as C<EPERM>, C<EACCES> or C<EUCLEAN>, to | ||
| 2435 | return when the system call filter configured with C<SystemCallFilter> is triggered, | ||
| 2436 | instead of terminating the process immediately. See L<errno(3)> for a | ||
| 2437 | full list of error codes. When this setting is not used, or when the empty string or the special | ||
| 2438 | setting C<kill> is assigned, the process will be terminated immediately when the | ||
| 2439 | filter is triggered.', | ||
| 2440 | 'SystemCallFilter' => "Takes a space-separated list of system call names or system call groups. If this | ||
| 2441 | setting is used, system calls executed by the unit processes except for the listed ones will result | ||
| 2442 | in the system call being denied (allow-listing). If the first character of the list is | ||
| 2443 | C<~>, the effect is inverted: only the listed system calls will be denied | ||
| 2444 | (deny-listing). This option may be specified more than once, in which case the filter masks are | ||
| 2445 | merged. If the empty string is assigned, the filter is reset, all prior assignments will have no | ||
| 2446 | effect. | ||
| 2447 | |||
| 2448 | Commands prefixed with C<+> are not subject to filtering. The | ||
| 2449 | execve(), exit(), exit_group(), | ||
| 2450 | getrlimit(), rt_sigreturn(), | ||
| 2451 | sigreturn() system calls and the system calls for querying time and sleeping are | ||
| 2452 | implicitly allow-listed and do not need to be listed explicitly. | ||
| 2453 | |||
| 2454 | The default action when a system call is denied is to terminate the processes with a | ||
| 2455 | C<SIGSYS> signal. This can changed using C<SystemCallErrorNumber>, | ||
| 2456 | see below. In addition, deny-listed system calls and system call groups may optionally be suffixed | ||
| 2457 | with a colon (C<:>) and an argument in the same format as | ||
| 2458 | C<SystemCallErrorNumber>, to take this action when the matching system call is made. | ||
| 2459 | This takes precedence over the action specified in C<SystemCallErrorNumber>. | ||
| 2460 | |||
| 2461 | This feature makes use of the Secure Computing Mode 2 interfaces of the kernel ('seccomp | ||
| 2462 | filtering') and is useful for enforcing a minimal sandboxing environment. | ||
| 2463 | |||
| 2464 | Note that on systems supporting multiple ABIs (such as x86/x86-64) it is recommended to turn | ||
| 2465 | off alternative ABIs for services, so that they cannot be used to circumvent the restrictions of this | ||
| 2466 | option. Specifically, it is recommended to combine this option with | ||
| 2467 | C<SystemCallArchitectures=native> or similar. | ||
| 2468 | |||
| 2469 | Note that strict system call filters may impact execution and error handling code paths of the | ||
| 2470 | service invocation. Specifically, access to the execve() system call is required | ||
| 2471 | for the execution of the service binary \x{2014} if it is blocked service invocation will necessarily fail. | ||
| 2472 | Also, if execution of the service binary fails for some reason (for example: missing service | ||
| 2473 | executable), the error handling logic might require access to an additional set of system calls in | ||
| 2474 | order to process and log this failure correctly. It might be necessary to temporarily disable system | ||
| 2475 | call filters in order to allow debugging of such failures. | ||
| 2476 | |||
| 2477 | If you specify both types of this option (i.e. allow-listing and deny-listing), the first | ||
| 2478 | encountered will take precedence and will dictate the default action (termination or approval of a | ||
| 2479 | system call). Then the next occurrences of this option will add or delete the listed system calls | ||
| 2480 | from the set of the filtered system calls, depending of its type and the default action. (For | ||
| 2481 | example, if you have started with an allow list rule for read() and | ||
| 2482 | write(), and right after it add a deny list rule for write(), | ||
| 2483 | then write() will be removed from the set.) | ||
| 2484 | |||
| 2485 | As the number of possible system calls is large, predefined groups of system calls are | ||
| 2486 | provided. A group starts with C<\@> character, followed by name of the set. | ||
| 2487 | Currently predefined system call setsSetDescription\@aioAsynchronous I/O (L<io_setup(2)>, L<io_submit(2)>, and related | ||
| 2488 | calls)\@basic-ioSystem calls for basic I/O: reading, writing, seeking, file descriptor duplication and closing | ||
| 2489 | (L<read(2)>, L<write(2)>, and related calls)\@chownChanging file ownership (L<chown(2)>, L<fchownat(2)>, and related | ||
| 2490 | calls)\@clockSystem calls for changing the system clock (L<adjtimex(2)>, L<settimeofday(2)>, and related | ||
| 2491 | calls)\@cpu-emulationSystem calls for CPU emulation functionality (L<vm86(2)> and related calls)\@debugDebugging, | ||
| 2492 | performance monitoring and tracing functionality (L<ptrace(2)>, L<perf_event_open(2)> and related | ||
| 2493 | calls)\@file-systemFile system operations: opening, creating files and directories for read and write, renaming and | ||
| 2494 | removing them, reading file properties, or creating hard and symbolic links\@io-eventEvent loop system calls | ||
| 2495 | (L<poll(2)>, L<select(2)>, L<epoll(7)>, L<eventfd(2)> and related calls)\@ipcPipes, SysV IPC, POSIX Message Queues and | ||
| 2496 | other IPC (L<mq_overview(7)>, L<svipc(7)>)\@keyringKernel keyring access (L<keyctl(2)> and related calls)\@memlockLocking | ||
| 2497 | of memory in RAM (L<mlock(2)>, L<mlockall(2)> and related calls)\@moduleLoading and unloading of kernel modules | ||
| 2498 | (L<init_module(2)>, L<delete_module(2)> and related calls)\@mountMounting and unmounting of file systems (L<mount(2)>, | ||
| 2499 | L<chroot(2)>, and related calls)\@network-ioSocket I/O (including local AF_UNIX): L<socket(7)>, | ||
| 2500 | L<unix(7)>\@obsoleteUnusual, obsolete or unimplemented (L<create_module(2)>, L<gtty(2)>, \x{2026})\@pkeySystem calls that deal | ||
| 2501 | with memory protection keys (L<pkeys(7)>)\@privilegedAll system calls which need super-user capabilities | ||
| 2502 | (L<capabilities(7)>)\@processProcess control, execution, namespacing operations (L<clone(2)>, L<kill(2)>, | ||
| 2503 | L<namespaces(7)>, \x{2026})\@raw-ioRaw I/O port access (L<ioperm(2)>, L<iopl(2)>, pciconfig_read(), \x{2026})\@rebootSystem calls for | ||
| 2504 | rebooting and reboot preparation (L<reboot(2)>, kexec(), \x{2026})\@resourcesSystem calls for changing resource limits, memory | ||
| 2505 | and scheduling parameters (L<setrlimit(2)>, L<setpriority(2)>, \x{2026})\@sandboxSystem calls for sandboxing programs | ||
| 2506 | (L<seccomp(2)>, Landlock system calls, \x{2026})\@setuidSystem calls for changing user ID and group ID credentials, | ||
| 2507 | (L<setuid(2)>, L<setgid(2)>, L<setresuid(2)>, \x{2026})\@signalSystem calls for manipulating and handling process signals | ||
| 2508 | (L<signal(2)>, L<sigprocmask(2)>, \x{2026})\@swapSystem calls for enabling/disabling swap devices (L<swapon(2)>, | ||
| 2509 | L<swapoff(2)>)\@syncSynchronizing files and memory to disk (L<fsync(2)>, L<msync(2)>, and related calls)\@system-serviceA | ||
| 2510 | reasonable set of system calls used by common system services, excluding any special purpose calls. This is the | ||
| 2511 | recommended starting point for allow-listing system calls for system services, as it contains what is typically needed | ||
| 2512 | by system services, but excludes overly specific interfaces. For example, the following APIs are excluded: C<\@clock>, | ||
| 2513 | C<\@mount>, C<\@swap>, C<\@reboot>.\@timerSystem calls for scheduling operations by time (L<alarm(2)>, L<timer_create(2)>, | ||
| 2514 | \x{2026})\@knownAll system calls defined by the kernel. This list is defined statically in systemd based on a kernel version | ||
| 2515 | that was available when this systemd version was released. It will become progressively more out-of-date as the kernel | ||
| 2516 | is updated. | ||
| 2517 | Note, that as new system calls are added to the kernel, additional system calls might be added to the groups | ||
| 2518 | above. Contents of the sets may also change between systemd versions. In addition, the list of system calls | ||
| 2519 | depends on the kernel version and architecture for which systemd was compiled. Use | ||
| 2520 | systemd-analyze\x{a0}syscall-filter to list the actual list of system calls in each | ||
| 2521 | filter. | ||
| 2522 | |||
| 2523 | Generally, allow-listing system calls (rather than deny-listing) is the safer mode of | ||
| 2524 | operation. It is recommended to enforce system call allow lists for all long-running system | ||
| 2525 | services. Specifically, the following lines are a relatively safe basic choice for the majority of | ||
| 2526 | system services: | ||
| 2527 | |||
| 2528 | [Service] | ||
| 2529 | SystemCallFilter=\@system-service | ||
| 2530 | SystemCallErrorNumber=EPERM | ||
| 2531 | |||
| 2532 | Note that various kernel system calls are defined redundantly: there are multiple system calls | ||
| 2533 | for executing the same operation. For example, the pidfd_send_signal() system | ||
| 2534 | call may be used to execute operations similar to what can be done with the older | ||
| 2535 | kill() system call, hence blocking the latter without the former only provides | ||
| 2536 | weak protection. Since new system calls are added regularly to the kernel as development progresses, | ||
| 2537 | keeping system call deny lists comprehensive requires constant work. It is thus recommended to use | ||
| 2538 | allow-listing instead, which offers the benefit that new system calls are by default implicitly | ||
| 2539 | blocked until the allow list is updated. | ||
| 2540 | |||
| 2541 | Also note that a number of system calls are required to be accessible for the dynamic linker to | ||
| 2542 | work. The dynamic linker is required for running most regular programs (specifically: all dynamic ELF | ||
| 2543 | binaries, which is how most distributions build packaged programs). This means that blocking these | ||
| 2544 | system calls (which include open(), openat() or | ||
| 2545 | mmap()) will make most programs typically shipped with generic distributions | ||
| 2546 | unusable. | ||
| 2547 | |||
| 2548 | It is recommended to combine the file system namespacing related options with | ||
| 2549 | C<SystemCallFilter=~\@mount>, in order to prohibit the unit's processes to undo the | ||
| 2550 | mappings. Specifically these are the options C<PrivateTmp>, | ||
| 2551 | C<PrivateDevices>, C<ProtectSystem>, C<ProtectHome>, | ||
| 2552 | C<ProtectKernelTunables>, C<ProtectControlGroups>, | ||
| 2553 | C<ProtectKernelLogs>, C<ProtectClock>, C<ReadOnlyPaths>, | ||
| 2554 | C<InaccessiblePaths> and C<ReadWritePaths>.", | ||
| 2555 | 'SystemCallLog' => 'Takes a space-separated list of system call names. If this setting is used, all | ||
| 2556 | system calls executed by the unit processes for the listed ones will be logged. If the first | ||
| 2557 | character of the list is C<~>, the effect is inverted: all system calls except the | ||
| 2558 | listed system calls will be logged. This feature makes use of the Secure Computing Mode 2 interfaces | ||
| 2559 | of the kernel (\'seccomp filtering\') and is useful for auditing or setting up a minimal sandboxing | ||
| 2560 | environment. This option may be specified more than once, in which case the filter masks are merged. | ||
| 2561 | If the empty string is assigned, the filter is reset, all prior assignments will have no effect. | ||
| 2562 | This does not affect commands prefixed with C<+>.', | ||
| 2563 | 'TTYColumns' => 'Configure the size of the TTY specified with C<TTYPath>. If unset or | ||
| 2564 | set to the empty string, it is attempted to retrieve the dimensions of the terminal screen via ANSI | ||
| 2565 | sequences, and if that fails the kernel defaults (typically 80x24) are used.', | ||
| 2566 | 'TTYPath' => 'Sets the terminal device node to use if standard input, output, or error are connected to a TTY | ||
| 2567 | (see above). Defaults to C</dev/console>.', | ||
| 2568 | 'TTYReset' => 'Reset the terminal device specified with C<TTYPath> before and after | ||
| 2569 | execution. This does not erase the screen (see C<TTYVTDisallocate> below for | ||
| 2570 | that). Defaults to C<no>.', | ||
| 2571 | 'TTYRows' => '*TTYColumns', | ||
| 2572 | 'TTYVHangup' => 'Disconnect all clients which have opened the terminal device specified with | ||
| 2573 | C<TTYPath> before and after execution. Defaults to C<no>.', | ||
| 2574 | 'TTYVTDisallocate' => 'If the terminal device specified with C<TTYPath> is a virtual | ||
| 2575 | console terminal, try to deallocate the TTY before and after execution. This ensures that the screen | ||
| 2576 | and scrollback buffer is cleared. If the terminal device is of any other type of TTY an attempt is | ||
| 2577 | made to clear the screen via ANSI sequences. Defaults to C<no>.', | ||
| 2578 | 'TemporaryFileSystem' => 'Takes a space-separated list of mount points for temporary file systems (tmpfs). If set, a new file | ||
| 2579 | system namespace is set up for executed processes, and a temporary file system is mounted on each mount point. | ||
| 2580 | This option may be specified more than once, in which case temporary file systems are mounted on all listed mount | ||
| 2581 | points. If the empty string is assigned to this option, the list is reset, and all prior assignments have no effect. | ||
| 2582 | Each mount point may optionally be suffixed with a colon (C<:>) and mount options such as | ||
| 2583 | C<size=10%> or C<ro>. By default, each temporary file system is mounted | ||
| 2584 | with C<nodev,strictatime,mode=0755>. These can be disabled by explicitly specifying the corresponding | ||
| 2585 | mount options, e.g., C<dev> or C<nostrictatime>. | ||
| 2586 | |||
| 2587 | This is useful to hide files or directories not relevant to the processes invoked by the unit, while necessary | ||
| 2588 | files or directories can be still accessed by combining with C<BindPaths> or | ||
| 2589 | C<BindReadOnlyPaths>: | ||
| 2590 | |||
| 2591 | Example: if a unit has the following, | ||
| 2592 | |||
| 2593 | TemporaryFileSystem=/var:ro | ||
| 2594 | BindReadOnlyPaths=/var/lib/systemd | ||
| 2595 | |||
| 2596 | then the invoked processes by the unit cannot see any files or directories under C</var/> except for | ||
| 2597 | C</var/lib/systemd> or its contents.', | ||
| 2598 | 'TimeoutCleanSec' => "Configures a timeout on the clean-up operation requested through systemctl | ||
| 2599 | clean \x{2026}, see | ||
| 2600 | L<systemctl(1)> for | ||
| 2601 | details. Takes the usual time values and defaults to C<infinity>, i.e. by default | ||
| 2602 | no timeout is applied. If a timeout is configured the clean operation will be aborted forcibly when | ||
| 2603 | the timeout is reached, potentially leaving resources on disk.", | ||
| 2604 | 'TimerSlackNSec' => 'Sets the timer slack in nanoseconds for the executed processes. The timer slack controls the | ||
| 2605 | accuracy of wake-ups triggered by timers. See | ||
| 2606 | L<prctl(2)> for more | ||
| 2607 | information. Note that in contrast to most other time span definitions this parameter takes an integer value in | ||
| 2608 | nano-seconds if no unit is specified. The usual time units are understood too.', | ||
| 2609 | 'UMask' => "Controls the file mode creation mask. Takes an access mode in octal notation. See | ||
| 2610 | L<umask(2)> for | ||
| 2611 | details. Defaults to 0022 for system units. For user units the default value is inherited from the | ||
| 2612 | per-user service manager (whose default is in turn inherited from the system service manager, and | ||
| 2613 | thus typically also is 0022 \x{2014} unless overridden by a PAM module). In order to change the per-user mask | ||
| 2614 | for all user services, consider setting the C<UMask> setting of the user's | ||
| 2615 | C<user\@.service> system service instance. The per-user umask may also be set via | ||
| 2616 | the C<umask> field of a user's L<JSON User | ||
| 2617 | Record|https://systemd.io/USER_RECORD> (for users managed by | ||
| 2618 | L<systemd-homed.service(8)> | ||
| 2619 | this field may be controlled via homectl --umask=). It may also be set via a PAM | ||
| 2620 | module, such as L<pam_umask(8)>.", | ||
| 2621 | 'UnsetEnvironment' => 'Explicitly unset environment variable assignments that would normally be passed from the | ||
| 2622 | service manager to invoked processes of this unit. Takes a space-separated list of variable names or variable | ||
| 2623 | assignments. This option may be specified more than once, in which case all listed variables/assignments will | ||
| 2624 | be unset. If the empty string is assigned to this option, the list of environment variables/assignments to | ||
| 2625 | unset is reset. If a variable assignment is specified (that is: a variable name, followed by | ||
| 2626 | C<=>, followed by its value), then any environment variable matching this precise assignment is | ||
| 2627 | removed. If a variable name is specified (that is a variable name without any following C<=> or | ||
| 2628 | value), then any assignment matching the variable name, regardless of its value is removed. Note that the | ||
| 2629 | effect of C<UnsetEnvironment> is applied as final step when the environment list passed to | ||
| 2630 | executed processes is compiled. That means it may undo assignments from any configuration source, including | ||
| 2631 | assignments made through C<Environment> or C<EnvironmentFile>, inherited from | ||
| 2632 | the system manager\'s global set of environment variables, inherited via C<PassEnvironment>, | ||
| 2633 | set by the service manager itself (such as C<$NOTIFY_SOCKET> and such), or set by a PAM module | ||
| 2634 | (in case C<PAMName> is used). | ||
| 2635 | |||
| 2636 | See "Environment Variables in Spawned Processes" below for a description of how those | ||
| 2637 | settings combine to form the inherited environment. See L<environ(7)> for general | ||
| 2638 | information about environment variables.', | ||
| 2639 | 'User' => '*Group', | ||
| 2640 | 'UserNamespacePath' => 'Takes an absolute file system path referring to a Linux user namespace | ||
| 2641 | pseudo-file (i.e. a file like C</proc/$PID/ns/user> or a bind mount or symlink to | ||
| 2642 | one). When set the invoked processes are added to the user namespace referenced by that path. The | ||
| 2643 | path has to point to a valid namespace file at the moment the processes are forked off. If this | ||
| 2644 | option is used C<PrivateUsers> has no effect. | ||
| 2645 | |||
| 2646 | This option is only available for system services.', | ||
| 2647 | 'UtmpIdentifier' => 'Takes a four character identifier string for an L<utmp(5)> and wtmp entry | ||
| 2648 | for this service. This should only be set for services such as getty implementations (such | ||
| 2649 | as L<agetty(8)>) where utmp/wtmp | ||
| 2650 | entries must be created and cleared before and after execution, or for services that shall be executed as if | ||
| 2651 | they were run by a getty process (see below). If the configured string is longer than four | ||
| 2652 | characters, it is truncated and the terminal four characters are used. This setting interprets %I style string | ||
| 2653 | replacements. This setting is unset by default, i.e. no utmp/wtmp entries are created or cleaned up for this | ||
| 2654 | service.', | ||
| 2655 | 'UtmpMode' => 'Takes one of C<init>, C<login> or C<user>. If | ||
| 2656 | C<UtmpIdentifier> is set, controls which type of L<utmp(5)>/wtmp entries | ||
| 2657 | for this service are generated. This setting has no effect unless C<UtmpIdentifier> is set | ||
| 2658 | too. If C<init> is set, only an C<INIT_PROCESS> entry is generated and the | ||
| 2659 | invoked process must implement a getty-compatible utmp/wtmp logic. If | ||
| 2660 | C<login> is set, first an C<INIT_PROCESS> entry, followed by a | ||
| 2661 | C<LOGIN_PROCESS> entry is generated. In this case, the invoked process must implement a | ||
| 2662 | L<login(1)>-compatible | ||
| 2663 | utmp/wtmp logic. If C<user> is set, first an C<INIT_PROCESS> entry, then a | ||
| 2664 | C<LOGIN_PROCESS> entry and finally a C<USER_PROCESS> entry is | ||
| 2665 | generated. In this case, the invoked process may be any process that is suitable to be run as session | ||
| 2666 | leader. Defaults to C<init>.', | ||
| 2667 | 'WorkingDirectory' => 'Takes a directory path relative to the service\'s root directory specified by | ||
| 2668 | C<RootDirectory>, or the special value C<~>. Sets the working directory for | ||
| 2669 | executed processes. If set to C<~>, the home directory of the user specified in | ||
| 2670 | C<User> is used. If not set, defaults to the root directory when systemd is running as a | ||
| 2671 | system instance and the respective user\'s home directory if run as user. If the setting is prefixed with the | ||
| 2672 | C<-> character, a missing working directory is not considered fatal. If | ||
| 2673 | C<RootDirectory>/C<RootImage> is not set, then | ||
| 2674 | C<WorkingDirectory> is relative to the root of the system running the service manager. Note | ||
| 2675 | that setting this parameter might result in additional dependencies to be added to the unit (see | ||
| 2676 | above).' | ||
| 2677 | }, | ||
| 2678 | 'element' => [ | ||
| 2679 | 'ExecSearchPath', | ||
| 2680 | { | ||
| 2681 | 'cargo' => { | ||
| 2682 | 'type' => 'leaf', | ||
| 2683 | 'value_type' => 'uniline' | ||
| 2684 | }, | ||
| 2685 | 'type' => 'list' | ||
| 2686 | }, | ||
| 2687 | 'WorkingDirectory', | ||
| 2688 | { | ||
| 2689 | 'type' => 'leaf', | ||
| 2690 | 'value_type' => 'uniline' | ||
| 2691 | }, | ||
| 2692 | 'RootDirectory', | ||
| 2693 | '*WorkingDirectory', | ||
| 2694 | 'RootImage', | ||
| 2695 | '*WorkingDirectory', | ||
| 2696 | 'RootImageOptions', | ||
| 2697 | '*WorkingDirectory', | ||
| 2698 | 'RootEphemeral', | ||
| 2699 | { | ||
| 2700 | 'type' => 'leaf', | ||
| 2701 | 'value_type' => 'boolean', | ||
| 2702 | 'write_as' => [ | ||
| 2703 | 'no', | ||
| 2704 | 'yes' | ||
| 2705 | ] | ||
| 2706 | }, | ||
| 2707 | 'RootHash', | ||
| 2708 | { | ||
| 2709 | 'type' => 'leaf', | ||
| 2710 | 'value_type' => 'uniline' | ||
| 2711 | }, | ||
| 2712 | 'RootHashSignature', | ||
| 2713 | '*RootHash', | ||
| 2714 | 'RootVerity', | ||
| 2715 | '*RootHash', | ||
| 2716 | 'RootImagePolicy', | ||
| 2717 | '*RootHash', | ||
| 2718 | 'MountImagePolicy', | ||
| 2719 | '*RootHash', | ||
| 2720 | 'ExtensionImagePolicy', | ||
| 2721 | '*RootHash', | ||
| 2722 | 'RootMStack', | ||
| 2723 | '*RootHash', | ||
| 2724 | 'MountAPIVFS', | ||
| 2725 | { | ||
| 2726 | 'type' => 'leaf', | ||
| 2727 | 'value_type' => 'boolean', | ||
| 2728 | 'write_as' => [ | ||
| 2729 | 'no', | ||
| 2730 | 'yes' | ||
| 2731 | ] | ||
| 2732 | }, | ||
| 2733 | 'BindLogSockets', | ||
| 2734 | '*MountAPIVFS', | ||
| 2735 | 'ProtectProc', | ||
| 2736 | { | ||
| 2737 | 'choice' => [ | ||
| 2738 | 'default', | ||
| 2739 | 'invisible', | ||
| 2740 | 'noaccess', | ||
| 2741 | 'ptraceable' | ||
| 2742 | ], | ||
| 2743 | 'type' => 'leaf', | ||
| 2744 | 'value_type' => 'enum' | ||
| 2745 | }, | ||
| 2746 | 'ProcSubset', | ||
| 2747 | { | ||
| 2748 | 'choice' => [ | ||
| 2749 | 'all', | ||
| 2750 | 'pid' | ||
| 2751 | ], | ||
| 2752 | 'type' => 'leaf', | ||
| 2753 | 'value_type' => 'enum' | ||
| 2754 | }, | ||
| 2755 | 'BindPaths', | ||
| 2756 | { | ||
| 2757 | 'cargo' => { | ||
| 2758 | 'type' => 'leaf', | ||
| 2759 | 'value_type' => 'uniline' | ||
| 2760 | }, | ||
| 2761 | 'type' => 'list' | ||
| 2762 | }, | ||
| 2763 | 'BindReadOnlyPaths', | ||
| 2764 | '*BindPaths', | ||
| 2765 | 'MountImages', | ||
| 2766 | '*BindPaths', | ||
| 2767 | 'ExtensionImages', | ||
| 2768 | '*BindPaths', | ||
| 2769 | 'ExtensionDirectories', | ||
| 2770 | '*BindPaths', | ||
| 2771 | 'User', | ||
| 2772 | { | ||
| 2773 | 'type' => 'leaf', | ||
| 2774 | 'value_type' => 'uniline' | ||
| 2775 | }, | ||
| 2776 | 'Group', | ||
| 2777 | '*User', | ||
| 2778 | 'DynamicUser', | ||
| 2779 | { | ||
| 2780 | 'type' => 'leaf', | ||
| 2781 | 'upstream_default' => 'no', | ||
| 2782 | 'value_type' => 'boolean', | ||
| 2783 | 'write_as' => [ | ||
| 2784 | 'no', | ||
| 2785 | 'yes' | ||
| 2786 | ] | ||
| 2787 | }, | ||
| 2788 | 'SupplementaryGroups', | ||
| 2789 | { | ||
| 2790 | 'cargo' => { | ||
| 2791 | 'type' => 'leaf', | ||
| 2792 | 'value_type' => 'uniline' | ||
| 2793 | }, | ||
| 2794 | 'type' => 'list' | ||
| 2795 | }, | ||
| 2796 | 'SetLoginEnvironment', | ||
| 2797 | { | ||
| 2798 | 'type' => 'leaf', | ||
| 2799 | 'value_type' => 'boolean', | ||
| 2800 | 'write_as' => [ | ||
| 2801 | 'no', | ||
| 2802 | 'yes' | ||
| 2803 | ] | ||
| 2804 | }, | ||
| 2805 | 'PAMName', | ||
| 2806 | { | ||
| 2807 | 'type' => 'leaf', | ||
| 2808 | 'value_type' => 'uniline' | ||
| 2809 | }, | ||
| 2810 | 'CapabilityBoundingSet', | ||
| 2811 | '*PAMName', | ||
| 2812 | 'AmbientCapabilities', | ||
| 2813 | '*PAMName', | ||
| 2814 | 'NoNewPrivileges', | ||
| 2815 | { | ||
| 2816 | 'type' => 'leaf', | ||
| 2817 | 'upstream_default' => 'no', | ||
| 2818 | 'value_type' => 'boolean', | ||
| 2819 | 'write_as' => [ | ||
| 2820 | 'no', | ||
| 2821 | 'yes' | ||
| 2822 | ] | ||
| 2823 | }, | ||
| 2824 | 'SecureBits', | ||
| 2825 | { | ||
| 2826 | 'type' => 'leaf', | ||
| 2827 | 'value_type' => 'uniline' | ||
| 2828 | }, | ||
| 2829 | 'SELinuxContext', | ||
| 2830 | '*SecureBits', | ||
| 2831 | 'AppArmorProfile', | ||
| 2832 | '*SecureBits', | ||
| 2833 | 'SmackProcessLabel', | ||
| 2834 | '*SecureBits', | ||
| 2835 | 'LimitCPU', | ||
| 2836 | '*SecureBits', | ||
| 2837 | 'LimitFSIZE', | ||
| 2838 | '*SecureBits', | ||
| 2839 | 'LimitDATA', | ||
| 2840 | '*SecureBits', | ||
| 2841 | 'LimitSTACK', | ||
| 2842 | '*SecureBits', | ||
| 2843 | 'LimitCORE', | ||
| 2844 | '*SecureBits', | ||
| 2845 | 'LimitRSS', | ||
| 2846 | '*SecureBits', | ||
| 2847 | 'LimitNOFILE', | ||
| 2848 | '*SecureBits', | ||
| 2849 | 'LimitAS', | ||
| 2850 | '*SecureBits', | ||
| 2851 | 'LimitNPROC', | ||
| 2852 | '*SecureBits', | ||
| 2853 | 'LimitMEMLOCK', | ||
| 2854 | '*SecureBits', | ||
| 2855 | 'LimitLOCKS', | ||
| 2856 | '*SecureBits', | ||
| 2857 | 'LimitSIGPENDING', | ||
| 2858 | '*SecureBits', | ||
| 2859 | 'LimitMSGQUEUE', | ||
| 2860 | '*SecureBits', | ||
| 2861 | 'LimitNICE', | ||
| 2862 | '*SecureBits', | ||
| 2863 | 'LimitRTPRIO', | ||
| 2864 | '*SecureBits', | ||
| 2865 | 'LimitRTTIME', | ||
| 2866 | '*SecureBits', | ||
| 2867 | 'UMask', | ||
| 2868 | '*SecureBits', | ||
| 2869 | 'CoredumpFilter', | ||
| 2870 | '*SecureBits', | ||
| 2871 | 'KeyringMode', | ||
| 2872 | { | ||
| 2873 | 'choice' => [ | ||
| 2874 | 'inherit', | ||
| 2875 | 'private', | ||
| 2876 | 'shared' | ||
| 2877 | ], | ||
| 2878 | 'type' => 'leaf', | ||
| 2879 | 'value_type' => 'enum' | ||
| 2880 | }, | ||
| 2881 | 'OOMScoreAdjust', | ||
| 2882 | { | ||
| 2883 | 'max' => '1000', | ||
| 2884 | 'min' => '-1000', | ||
| 2885 | 'type' => 'leaf', | ||
| 2886 | 'value_type' => 'integer' | ||
| 2887 | }, | ||
| 2888 | 'TimerSlackNSec', | ||
| 2889 | { | ||
| 2890 | 'type' => 'leaf', | ||
| 2891 | 'value_type' => 'uniline' | ||
| 2892 | }, | ||
| 2893 | 'Personality', | ||
| 2894 | { | ||
| 2895 | 'choice' => [ | ||
| 2896 | 'arm', | ||
| 2897 | 'arm-be', | ||
| 2898 | 'arm64', | ||
| 2899 | 'arm64-be', | ||
| 2900 | 'ppc', | ||
| 2901 | 'ppc-le', | ||
| 2902 | 'ppc64', | ||
| 2903 | 'ppc64-le', | ||
| 2904 | 's390', | ||
| 2905 | 's390x', | ||
| 2906 | 'x86', | ||
| 2907 | 'x86-64' | ||
| 2908 | ], | ||
| 2909 | 'type' => 'leaf', | ||
| 2910 | 'value_type' => 'enum' | ||
| 2911 | }, | ||
| 2912 | 'IgnoreSIGPIPE', | ||
| 2913 | { | ||
| 2914 | 'type' => 'leaf', | ||
| 2915 | 'value_type' => 'boolean', | ||
| 2916 | 'write_as' => [ | ||
| 2917 | 'no', | ||
| 2918 | 'yes' | ||
| 2919 | ] | ||
| 2920 | }, | ||
| 2921 | 'Nice', | ||
| 2922 | { | ||
| 2923 | 'max' => '19', | ||
| 2924 | 'min' => '-20', | ||
| 2925 | 'type' => 'leaf', | ||
| 2926 | 'value_type' => 'integer' | ||
| 2927 | }, | ||
| 2928 | 'CPUSchedulingPolicy', | ||
| 2929 | { | ||
| 2930 | 'choice' => [ | ||
| 2931 | 'batch', | ||
| 2932 | 'ext', | ||
| 2933 | 'fifo', | ||
| 2934 | 'idle', | ||
| 2935 | 'other', | ||
| 2936 | 'rr' | ||
| 2937 | ], | ||
| 2938 | 'type' => 'leaf', | ||
| 2939 | 'value_type' => 'enum' | ||
| 2940 | }, | ||
| 2941 | 'CPUSchedulingPriority', | ||
| 2942 | { | ||
| 2943 | 'type' => 'leaf', | ||
| 2944 | 'value_type' => 'uniline' | ||
| 2945 | }, | ||
| 2946 | 'CPUSchedulingResetOnFork', | ||
| 2947 | { | ||
| 2948 | 'type' => 'leaf', | ||
| 2949 | 'upstream_default' => 'no', | ||
| 2950 | 'value_type' => 'boolean', | ||
| 2951 | 'write_as' => [ | ||
| 2952 | 'no', | ||
| 2953 | 'yes' | ||
| 2954 | ] | ||
| 2955 | }, | ||
| 2956 | 'CPUAffinity', | ||
| 2957 | { | ||
| 2958 | 'cargo' => { | ||
| 2959 | 'type' => 'leaf', | ||
| 2960 | 'value_type' => 'uniline' | ||
| 2961 | }, | ||
| 2962 | 'type' => 'list' | ||
| 2963 | }, | ||
| 2964 | 'NUMAPolicy', | ||
| 2965 | { | ||
| 2966 | 'type' => 'leaf', | ||
| 2967 | 'value_type' => 'uniline' | ||
| 2968 | }, | ||
| 2969 | 'NUMAMask', | ||
| 2970 | '*NUMAPolicy', | ||
| 2971 | 'IOSchedulingClass', | ||
| 2972 | { | ||
| 2973 | 'choice' => [ | ||
| 2974 | '0', | ||
| 2975 | '1', | ||
| 2976 | '2', | ||
| 2977 | '3', | ||
| 2978 | 'none', | ||
| 2979 | 'realtime', | ||
| 2980 | 'best-effort', | ||
| 2981 | 'idle' | ||
| 2982 | ], | ||
| 2983 | 'type' => 'leaf', | ||
| 2984 | 'value_type' => 'enum' | ||
| 2985 | }, | ||
| 2986 | 'IOSchedulingPriority', | ||
| 2987 | { | ||
| 2988 | 'max' => '7', | ||
| 2989 | 'min' => '0', | ||
| 2990 | 'type' => 'leaf', | ||
| 2991 | 'upstream_default' => '4', | ||
| 2992 | 'value_type' => 'integer' | ||
| 2993 | }, | ||
| 2994 | 'ProtectSystem', | ||
| 2995 | { | ||
| 2996 | 'choice' => [ | ||
| 2997 | 'full', | ||
| 2998 | 'no', | ||
| 2999 | 'strict', | ||
| 3000 | 'yes' | ||
| 3001 | ], | ||
| 3002 | 'replace' => { | ||
| 3003 | '0' => 'no', | ||
| 3004 | '1' => 'yes', | ||
| 3005 | 'false' => 'no', | ||
| 3006 | 'true' => 'yes' | ||
| 3007 | }, | ||
| 3008 | 'type' => 'leaf', | ||
| 3009 | 'upstream_default' => 'no', | ||
| 3010 | 'value_type' => 'enum' | ||
| 3011 | }, | ||
| 3012 | 'ProtectHome', | ||
| 3013 | { | ||
| 3014 | 'choice' => [ | ||
| 3015 | 'no', | ||
| 3016 | 'read-only', | ||
| 3017 | 'tmpfs', | ||
| 3018 | 'yes' | ||
| 3019 | ], | ||
| 3020 | 'replace' => { | ||
| 3021 | '0' => 'no', | ||
| 3022 | '1' => 'yes', | ||
| 3023 | 'false' => 'no', | ||
| 3024 | 'true' => 'yes' | ||
| 3025 | }, | ||
| 3026 | 'type' => 'leaf', | ||
| 3027 | 'value_type' => 'enum' | ||
| 3028 | }, | ||
| 3029 | 'RuntimeDirectory', | ||
| 3030 | { | ||
| 3031 | 'type' => 'leaf', | ||
| 3032 | 'value_type' => 'uniline' | ||
| 3033 | }, | ||
| 3034 | 'StateDirectory', | ||
| 3035 | '*RuntimeDirectory', | ||
| 3036 | 'CacheDirectory', | ||
| 3037 | '*RuntimeDirectory', | ||
| 3038 | 'LogsDirectory', | ||
| 3039 | '*RuntimeDirectory', | ||
| 3040 | 'ConfigurationDirectory', | ||
| 3041 | '*RuntimeDirectory', | ||
| 3042 | 'RuntimeDirectoryMode', | ||
| 3043 | '*RuntimeDirectory', | ||
| 3044 | 'StateDirectoryMode', | ||
| 3045 | '*RuntimeDirectory', | ||
| 3046 | 'CacheDirectoryMode', | ||
| 3047 | '*RuntimeDirectory', | ||
| 3048 | 'LogsDirectoryMode', | ||
| 3049 | '*RuntimeDirectory', | ||
| 3050 | 'ConfigurationDirectoryMode', | ||
| 3051 | '*RuntimeDirectory', | ||
| 3052 | 'StateDirectoryQuota', | ||
| 3053 | '*RuntimeDirectory', | ||
| 3054 | 'CacheDirectoryQuota', | ||
| 3055 | '*RuntimeDirectory', | ||
| 3056 | 'LogsDirectoryQuota', | ||
| 3057 | '*RuntimeDirectory', | ||
| 3058 | 'StateDirectoryAccounting', | ||
| 3059 | { | ||
| 3060 | 'type' => 'leaf', | ||
| 3061 | 'upstream_default' => 'no', | ||
| 3062 | 'value_type' => 'boolean', | ||
| 3063 | 'write_as' => [ | ||
| 3064 | 'no', | ||
| 3065 | 'yes' | ||
| 3066 | ] | ||
| 3067 | }, | ||
| 3068 | 'CacheDirectoryAccounting', | ||
| 3069 | '*StateDirectoryAccounting', | ||
| 3070 | 'LogsDirectoryAccounting', | ||
| 3071 | '*StateDirectoryAccounting', | ||
| 3072 | 'RuntimeDirectoryPreserve', | ||
| 3073 | { | ||
| 3074 | 'choice' => [ | ||
| 3075 | 'no', | ||
| 3076 | 'restart', | ||
| 3077 | 'yes' | ||
| 3078 | ], | ||
| 3079 | 'replace' => { | ||
| 3080 | '0' => 'no', | ||
| 3081 | '1' => 'yes', | ||
| 3082 | 'false' => 'no', | ||
| 3083 | 'true' => 'yes' | ||
| 3084 | }, | ||
| 3085 | 'type' => 'leaf', | ||
| 3086 | 'value_type' => 'enum' | ||
| 3087 | }, | ||
| 3088 | 'TimeoutCleanSec', | ||
| 3089 | { | ||
| 3090 | 'type' => 'leaf', | ||
| 3091 | 'value_type' => 'uniline' | ||
| 3092 | }, | ||
| 3093 | 'ReadWritePaths', | ||
| 3094 | { | ||
| 3095 | 'cargo' => { | ||
| 3096 | 'type' => 'leaf', | ||
| 3097 | 'value_type' => 'uniline' | ||
| 3098 | }, | ||
| 3099 | 'type' => 'list' | ||
| 3100 | }, | ||
| 3101 | 'ReadOnlyPaths', | ||
| 3102 | '*ReadWritePaths', | ||
| 3103 | 'InaccessiblePaths', | ||
| 3104 | '*ReadWritePaths', | ||
| 3105 | 'ExecPaths', | ||
| 3106 | '*ReadWritePaths', | ||
| 3107 | 'NoExecPaths', | ||
| 3108 | '*ReadWritePaths', | ||
| 3109 | 'TemporaryFileSystem', | ||
| 3110 | '*ReadWritePaths', | ||
| 3111 | 'PrivateTmp', | ||
| 3112 | { | ||
| 3113 | 'choice' => [ | ||
| 3114 | 'disconnected', | ||
| 3115 | 'no', | ||
| 3116 | 'yes' | ||
| 3117 | ], | ||
| 3118 | 'replace' => { | ||
| 3119 | '0' => 'no', | ||
| 3120 | '1' => 'yes', | ||
| 3121 | 'false' => 'no', | ||
| 3122 | 'true' => 'yes' | ||
| 3123 | }, | ||
| 3124 | 'type' => 'leaf', | ||
| 3125 | 'value_type' => 'enum' | ||
| 3126 | }, | ||
| 3127 | 'PrivateDevices', | ||
| 3128 | { | ||
| 3129 | 'type' => 'leaf', | ||
| 3130 | 'upstream_default' => 'no', | ||
| 3131 | 'value_type' => 'boolean', | ||
| 3132 | 'write_as' => [ | ||
| 3133 | 'no', | ||
| 3134 | 'yes' | ||
| 3135 | ] | ||
| 3136 | }, | ||
| 3137 | 'PrivateNetwork', | ||
| 3138 | '*PrivateDevices', | ||
| 3139 | 'UserNamespacePath', | ||
| 3140 | { | ||
| 3141 | 'type' => 'leaf', | ||
| 3142 | 'value_type' => 'uniline' | ||
| 3143 | }, | ||
| 3144 | 'NetworkNamespacePath', | ||
| 3145 | '*UserNamespacePath', | ||
| 3146 | 'PrivateIPC', | ||
| 3147 | { | ||
| 3148 | 'type' => 'leaf', | ||
| 3149 | 'upstream_default' => 'no', | ||
| 3150 | 'value_type' => 'boolean', | ||
| 3151 | 'write_as' => [ | ||
| 3152 | 'no', | ||
| 3153 | 'yes' | ||
| 3154 | ] | ||
| 3155 | }, | ||
| 3156 | 'IPCNamespacePath', | ||
| 3157 | { | ||
| 3158 | 'type' => 'leaf', | ||
| 3159 | 'value_type' => 'uniline' | ||
| 3160 | }, | ||
| 3161 | 'MemoryKSM', | ||
| 3162 | { | ||
| 3163 | 'type' => 'leaf', | ||
| 3164 | 'value_type' => 'boolean', | ||
| 3165 | 'write_as' => [ | ||
| 3166 | 'no', | ||
| 3167 | 'yes' | ||
| 3168 | ] | ||
| 3169 | }, | ||
| 3170 | 'MemoryTHP', | ||
| 3171 | { | ||
| 3172 | 'type' => 'leaf', | ||
| 3173 | 'value_type' => 'uniline' | ||
| 3174 | }, | ||
| 3175 | 'PrivatePIDs', | ||
| 3176 | { | ||
| 3177 | 'type' => 'leaf', | ||
| 3178 | 'upstream_default' => 'no', | ||
| 3179 | 'value_type' => 'boolean', | ||
| 3180 | 'write_as' => [ | ||
| 3181 | 'no', | ||
| 3182 | 'yes' | ||
| 3183 | ] | ||
| 3184 | }, | ||
| 3185 | 'PrivateUsers', | ||
| 3186 | { | ||
| 3187 | 'choice' => [ | ||
| 3188 | 'full', | ||
| 3189 | 'identity', | ||
| 3190 | 'managed', | ||
| 3191 | 'no', | ||
| 3192 | 'self', | ||
| 3193 | 'yes' | ||
| 3194 | ], | ||
| 3195 | 'replace' => { | ||
| 3196 | '0' => 'no', | ||
| 3197 | '1' => 'yes', | ||
| 3198 | 'false' => 'no', | ||
| 3199 | 'true' => 'yes' | ||
| 3200 | }, | ||
| 3201 | 'type' => 'leaf', | ||
| 3202 | 'upstream_default' => 'no', | ||
| 3203 | 'value_type' => 'enum' | ||
| 3204 | }, | ||
| 3205 | 'ProtectHostname', | ||
| 3206 | { | ||
| 3207 | 'choice' => [ | ||
| 3208 | 'no', | ||
| 3209 | 'private', | ||
| 3210 | 'yes' | ||
| 3211 | ], | ||
| 3212 | 'replace' => { | ||
| 3213 | '0' => 'no', | ||
| 3214 | '1' => 'yes', | ||
| 3215 | 'false' => 'no', | ||
| 3216 | 'true' => 'yes' | ||
| 3217 | }, | ||
| 3218 | 'type' => 'leaf', | ||
| 3219 | 'upstream_default' => 'no', | ||
| 3220 | 'value_type' => 'enum' | ||
| 3221 | }, | ||
| 3222 | 'ProtectClock', | ||
| 3223 | { | ||
| 3224 | 'type' => 'leaf', | ||
| 3225 | 'upstream_default' => 'no', | ||
| 3226 | 'value_type' => 'boolean', | ||
| 3227 | 'write_as' => [ | ||
| 3228 | 'no', | ||
| 3229 | 'yes' | ||
| 3230 | ] | ||
| 3231 | }, | ||
| 3232 | 'ProtectKernelTunables', | ||
| 3233 | '*ProtectClock', | ||
| 3234 | 'ProtectKernelModules', | ||
| 3235 | '*ProtectClock', | ||
| 3236 | 'ProtectKernelLogs', | ||
| 3237 | { | ||
| 3238 | 'type' => 'leaf', | ||
| 3239 | 'value_type' => 'boolean', | ||
| 3240 | 'write_as' => [ | ||
| 3241 | 'no', | ||
| 3242 | 'yes' | ||
| 3243 | ] | ||
| 3244 | }, | ||
| 3245 | 'ProtectControlGroups', | ||
| 3246 | { | ||
| 3247 | 'choice' => [ | ||
| 3248 | 'no', | ||
| 3249 | 'private', | ||
| 3250 | 'strict', | ||
| 3251 | 'yes' | ||
| 3252 | ], | ||
| 3253 | 'replace' => { | ||
| 3254 | '0' => 'no', | ||
| 3255 | '1' => 'yes', | ||
| 3256 | 'false' => 'no', | ||
| 3257 | 'true' => 'yes' | ||
| 3258 | }, | ||
| 3259 | 'type' => 'leaf', | ||
| 3260 | 'upstream_default' => 'no', | ||
| 3261 | 'value_type' => 'enum' | ||
| 3262 | }, | ||
| 3263 | 'RestrictAddressFamilies', | ||
| 3264 | { | ||
| 3265 | 'type' => 'leaf', | ||
| 3266 | 'value_type' => 'uniline' | ||
| 3267 | }, | ||
| 3268 | 'RestrictFileSystems', | ||
| 3269 | '*RestrictAddressFamilies', | ||
| 3270 | 'RestrictNamespaces', | ||
| 3271 | '*RestrictAddressFamilies', | ||
| 3272 | 'DelegateNamespaces', | ||
| 3273 | '*RestrictAddressFamilies', | ||
| 3274 | 'PrivateBPF', | ||
| 3275 | { | ||
| 3276 | 'type' => 'leaf', | ||
| 3277 | 'upstream_default' => 'no', | ||
| 3278 | 'value_type' => 'boolean', | ||
| 3279 | 'write_as' => [ | ||
| 3280 | 'no', | ||
| 3281 | 'yes' | ||
| 3282 | ] | ||
| 3283 | }, | ||
| 3284 | 'BPFDelegateCommands', | ||
| 3285 | { | ||
| 3286 | 'type' => 'leaf', | ||
| 3287 | 'value_type' => 'uniline' | ||
| 3288 | }, | ||
| 3289 | 'BPFDelegateMaps', | ||
| 3290 | '*BPFDelegateCommands', | ||
| 3291 | 'BPFDelegatePrograms', | ||
| 3292 | '*BPFDelegateCommands', | ||
| 3293 | 'BPFDelegateAttachments', | ||
| 3294 | '*BPFDelegateCommands', | ||
| 3295 | 'LockPersonality', | ||
| 3296 | { | ||
| 3297 | 'type' => 'leaf', | ||
| 3298 | 'value_type' => 'boolean', | ||
| 3299 | 'write_as' => [ | ||
| 3300 | 'no', | ||
| 3301 | 'yes' | ||
| 3302 | ] | ||
| 3303 | }, | ||
| 3304 | 'MemoryDenyWriteExecute', | ||
| 3305 | '*LockPersonality', | ||
| 3306 | 'RestrictRealtime', | ||
| 3307 | { | ||
| 3308 | 'type' => 'leaf', | ||
| 3309 | 'upstream_default' => 'no', | ||
| 3310 | 'value_type' => 'boolean', | ||
| 3311 | 'write_as' => [ | ||
| 3312 | 'no', | ||
| 3313 | 'yes' | ||
| 3314 | ] | ||
| 3315 | }, | ||
| 3316 | 'RestrictSUIDSGID', | ||
| 3317 | { | ||
| 3318 | 'type' => 'leaf', | ||
| 3319 | 'value_type' => 'boolean', | ||
| 3320 | 'write_as' => [ | ||
| 3321 | 'no', | ||
| 3322 | 'yes' | ||
| 3323 | ] | ||
| 3324 | }, | ||
| 3325 | 'RemoveIPC', | ||
| 3326 | '*RestrictSUIDSGID', | ||
| 3327 | 'PrivateMounts', | ||
| 3328 | { | ||
| 3329 | 'type' => 'leaf', | ||
| 3330 | 'upstream_default' => 'no', | ||
| 3331 | 'value_type' => 'boolean', | ||
| 3332 | 'write_as' => [ | ||
| 3333 | 'no', | ||
| 3334 | 'yes' | ||
| 3335 | ] | ||
| 3336 | }, | ||
| 3337 | 'MountFlags', | ||
| 3338 | { | ||
| 3339 | 'type' => 'leaf', | ||
| 3340 | 'value_type' => 'uniline' | ||
| 3341 | }, | ||
| 3342 | 'SystemCallFilter', | ||
| 3343 | { | ||
| 3344 | 'cargo' => { | ||
| 3345 | 'type' => 'leaf', | ||
| 3346 | 'value_type' => 'uniline' | ||
| 3347 | }, | ||
| 3348 | 'type' => 'list' | ||
| 3349 | }, | ||
| 3350 | 'SystemCallErrorNumber', | ||
| 3351 | { | ||
| 3352 | 'type' => 'leaf', | ||
| 3353 | 'value_type' => 'uniline' | ||
| 3354 | }, | ||
| 3355 | 'SystemCallArchitectures', | ||
| 3356 | '*SystemCallErrorNumber', | ||
| 3357 | 'SystemCallLog', | ||
| 3358 | { | ||
| 3359 | 'cargo' => { | ||
| 3360 | 'type' => 'leaf', | ||
| 3361 | 'value_type' => 'uniline' | ||
| 3362 | }, | ||
| 3363 | 'type' => 'list' | ||
| 3364 | }, | ||
| 3365 | 'Environment', | ||
| 3366 | '*SystemCallLog', | ||
| 3367 | 'EnvironmentFile', | ||
| 3368 | '*SystemCallLog', | ||
| 3369 | 'PassEnvironment', | ||
| 3370 | '*SystemCallLog', | ||
| 3371 | 'UnsetEnvironment', | ||
| 3372 | '*SystemCallLog', | ||
| 3373 | 'StandardInput', | ||
| 3374 | { | ||
| 3375 | 'choice' => [ | ||
| 3376 | 'data', | ||
| 3377 | 'null', | ||
| 3378 | 'socket', | ||
| 3379 | 'tty', | ||
| 3380 | 'tty-fail', | ||
| 3381 | 'tty-force' | ||
| 3382 | ], | ||
| 3383 | 'type' => 'leaf', | ||
| 3384 | 'value_type' => 'enum' | ||
| 3385 | }, | ||
| 3386 | 'StandardOutput', | ||
| 3387 | { | ||
| 3388 | 'choice' => [ | ||
| 3389 | 'inherit', | ||
| 3390 | 'journal', | ||
| 3391 | 'journal+console', | ||
| 3392 | 'kmsg', | ||
| 3393 | 'kmsg+console', | ||
| 3394 | 'null', | ||
| 3395 | 'socket', | ||
| 3396 | 'tty' | ||
| 3397 | ], | ||
| 3398 | 'type' => 'leaf', | ||
| 3399 | 'value_type' => 'enum' | ||
| 3400 | }, | ||
| 3401 | 'StandardError', | ||
| 3402 | { | ||
| 3403 | 'type' => 'leaf', | ||
| 3404 | 'value_type' => 'uniline' | ||
| 3405 | }, | ||
| 3406 | 'StandardInputText', | ||
| 3407 | '*StandardError', | ||
| 3408 | 'StandardInputData', | ||
| 3409 | '*StandardError', | ||
| 3410 | 'LogLevelMax', | ||
| 3411 | '*StandardError', | ||
| 3412 | 'LogExtraFields', | ||
| 3413 | '*StandardError', | ||
| 3414 | 'LogRateLimitIntervalSec', | ||
| 3415 | '*StandardError', | ||
| 3416 | 'LogRateLimitBurst', | ||
| 3417 | '*StandardError', | ||
| 3418 | 'LogFilterPatterns', | ||
| 3419 | '*StandardError', | ||
| 3420 | 'LogNamespace', | ||
| 3421 | '*StandardError', | ||
| 3422 | 'SyslogIdentifier', | ||
| 3423 | '*StandardError', | ||
| 3424 | 'SyslogFacility', | ||
| 3425 | '*StandardError', | ||
| 3426 | 'SyslogLevel', | ||
| 3427 | '*StandardError', | ||
| 3428 | 'SyslogLevelPrefix', | ||
| 3429 | { | ||
| 3430 | 'type' => 'leaf', | ||
| 3431 | 'upstream_default' => 'yes', | ||
| 3432 | 'value_type' => 'boolean', | ||
| 3433 | 'write_as' => [ | ||
| 3434 | 'no', | ||
| 3435 | 'yes' | ||
| 3436 | ] | ||
| 3437 | }, | ||
| 3438 | 'TTYPath', | ||
| 3439 | { | ||
| 3440 | 'type' => 'leaf', | ||
| 3441 | 'value_type' => 'uniline' | ||
| 3442 | }, | ||
| 3443 | 'TTYReset', | ||
| 3444 | '*TTYPath', | ||
| 3445 | 'TTYVHangup', | ||
| 3446 | '*TTYPath', | ||
| 3447 | 'TTYColumns', | ||
| 3448 | '*TTYPath', | ||
| 3449 | 'TTYRows', | ||
| 3450 | '*TTYPath', | ||
| 3451 | 'TTYVTDisallocate', | ||
| 3452 | '*TTYPath', | ||
| 3453 | 'LoadCredential', | ||
| 3454 | '*TTYPath', | ||
| 3455 | 'LoadCredentialEncrypted', | ||
| 3456 | '*TTYPath', | ||
| 3457 | 'ImportCredential', | ||
| 3458 | '*TTYPath', | ||
| 3459 | 'SetCredential', | ||
| 3460 | '*TTYPath', | ||
| 3461 | 'SetCredentialEncrypted', | ||
| 3462 | '*TTYPath', | ||
| 3463 | 'UtmpIdentifier', | ||
| 3464 | '*TTYPath', | ||
| 3465 | 'UtmpMode', | ||
| 3466 | { | ||
| 3467 | 'choice' => [ | ||
| 3468 | 'init', | ||
| 3469 | 'login', | ||
| 3470 | 'user' | ||
| 3471 | ], | ||
| 3472 | 'type' => 'leaf', | ||
| 3473 | 'value_type' => 'enum' | ||
| 3474 | } | ||
| 3475 | ], | ||
| 3476 | 'generated_by' => 'parse-man.pl from systemd 261 doc', | ||
| 3477 | 'license' => 'LGPLv2.1+', | ||
| 3478 | 'name' => 'Systemd::Common::Exec' | ||
| 3479 | } | ||
| 3480 | ] | ||
| 3481 | ; | ||