models/Systemd/Common/ResourceControl.pl

filter: Statementstmt 100% 34 / 34 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 12 / 12 Podpod n/a totaltotal 100% 46 / 46 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« models/Systemd/Common/Kill.pl ↑ Summary models/Systemd/Section/Install.pl »
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, slices, scopes, sockets, mount points, and swap devices share a subset
26 of configuration options for resource control of spawned processes. Internally, this relies on the Linux Control
27 Groups (cgroups) kernel concept for organizing processes in a hierarchical tree of named groups for the purpose of
28 resource management.
29  
30 This man page lists the configuration options shared by
31 those six unit types. See
32 L<systemd.unit(5)>
33 for the common options of all unit configuration files, and
34 L<systemd.slice(5)>,
35 L<systemd.scope(5)>,
36 L<systemd.service(5)>,
37 L<systemd.socket(5)>,
38 L<systemd.mount(5)>,
39 and
40 L<systemd.swap(5)>
41 for more information on the specific unit configuration files. The
42 resource control configuration options are configured in the
43 [Slice], [Scope], [Service], [Socket], [Mount], or [Swap]
44 sections, depending on the unit type.
45  
46 In addition, options which control resources available to programs
47 executed by systemd are listed in
48 L<systemd.exec(5)>.
49 Those options complement options listed here.
50 This configuration class was generated from systemd documentation.
51 by L<parse-man.pl|https://github.com/dod38fr/config-model-systemd/contrib/parse-man.pl>
52 ',
53 'copyright' => [
54 '2010-2016 Lennart Poettering and others',
55 '2016 Dominique Dumont'
56 ],
57 'description' => {
58 'AllowedCPUs' => 'This setting controls the C<cpuset> controller in the unified hierarchy.
59  
60 Restrict processes to be executed on specific CPUs. Takes a list of CPU indices or ranges separated by either
61 whitespace or commas. CPU ranges are specified by the lower and upper CPU indices separated by a dash.
62  
63 Setting C<AllowedCPUs> or C<StartupAllowedCPUs> does not guarantee that all
64 of the CPUs will be used by the processes as it may be limited by parent units. The effective configuration is
65 reported as C<EffectiveCPUs>.
66  
67 While C<StartupAllowedCPUs> applies to the startup and shutdown phases of the system,
68 C<AllowedCPUs> applies to normal runtime of the system, and if the former is not set also to
69 the startup and shutdown phases. Using C<StartupAllowedCPUs> allows prioritizing specific services at
70 boot-up and shutdown differently than during normal runtime.
71  
72 This setting is supported only with the unified control group hierarchy.',
73 'AllowedMemoryNodes' => 'These settings control the C<cpuset> controller in the unified hierarchy.
74  
75 Restrict processes to be executed on specific memory NUMA nodes. Takes a list of memory NUMA nodes indices
76 or ranges separated by either whitespace or commas. Memory NUMA nodes ranges are specified by the lower and upper
77 NUMA nodes indices separated by a dash.
78  
79 Setting C<AllowedMemoryNodes> or C<StartupAllowedMemoryNodes> does not
80 guarantee that all of the memory NUMA nodes will be used by the processes as it may be limited by parent units.
81 The effective configuration is reported as C<EffectiveMemoryNodes>.
82  
83 While C<StartupAllowedMemoryNodes> applies to the startup and shutdown phases of the system,
84 C<AllowedMemoryNodes> applies to normal runtime of the system, and if the former is not set also to
85 the startup and shutdown phases. Using C<StartupAllowedMemoryNodes> allows prioritizing specific services at
86 boot-up and shutdown differently than during normal runtime.
87  
88 This setting is supported only with the unified control group hierarchy.',
89 'BPFProgram' => 'C<BPFProgram> allows attaching custom BPF programs to the cgroup of a
90 unit. (This generalizes the functionality exposed via C<IPEgressFilterPath> and
91 C<IPIngressFilterPath> for other hooks.) Cgroup-bpf hooks in the form of BPF
92 programs loaded to the BPF filesystem are attached with cgroup-bpf attach flags determined by the
93 unit. For details about attachment types and flags see
94 L<C<bpf.h>|https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/include/uapi/linux/bpf.h>. Also
95 refer to the general L<BPF documentation|https://docs.kernel.org/bpf/>.
96  
97 The specification of BPF program consists of a pair of BPF program type and program path in
98 the file system, with C<:> as the separator:
99 type:program-path.
100  
101 The BPF program type is equivalent to the BPF attach type used in
102 L<bpftool(8)>
103 It may be one of
104 C<egress>,
105 C<ingress>,
106 C<sock_create>,
107 C<sock_ops>,
108 C<device>,
109 C<bind4>,
110 C<bind6>,
111 C<connect4>,
112 C<connect6>,
113 C<post_bind4>,
114 C<post_bind6>,
115 C<sendmsg4>,
116 C<sendmsg6>,
117 C<sysctl>,
118 C<recvmsg4>,
119 C<recvmsg6>,
120 C<getsockopt>,
121 or C<setsockopt>.
122  
123 The specified program path must be an absolute path referencing a BPF program inode in the
124 bpffs file system (which generally means it must begin with C</sys/fs/bpf/>). If
125 a specified program does not exist (i.e. has not been uploaded to the BPF subsystem of the kernel
126 yet), it will not be installed but unit activation will continue (a warning will be printed to the
127 logs).
128  
129 Setting C<BPFProgram> to an empty value makes previous assignments
130 ineffective.
131  
132 Multiple assignments of the same program type/path pair have the same effect as a single
133 assignment: the program will be attached just once.
134  
135 If BPF C<egress> pinned to program-path path is already being
136 handled by C<IPEgressFilterPath>, C<BPFProgram>
137 assignment will be considered valid and C<BPFProgram> will be attached to a cgroup.
138 Similarly for C<ingress> hook and C<IPIngressFilterPath> assignment.
139  
140 BPF programs passed with C<BPFProgram> are attached to the cgroup of a unit
141 with BPF attach flag C<multi>, that allows further attachments of the same
142 type within cgroup hierarchy topped by the unit cgroup.
143  
144 Examples:
145 BPFProgram=egress:/sys/fs/bpf/egress-hook
146 BPFProgram=bind6:/sys/fs/bpf/sock-addr-hook
147 ',
148 'BindNetworkInterface' => 'Takes the name of a network interface. This option causes every socket created by processes of this
149 unit to be bound to the specified network interface.
150  
151 It is specially useful to confine a process to a VRF, when the program does not offer native support
152 for it. It is equivalent to running the program using C<ip vrf exec>.
153  
154 In systems using C<nss-resolve>, the interface used for DNS resolution can be chosen
155 by using the C<SYSTEMD_NSS_RESOLVE_IFINDEX> environment variable.
156  
157 The feature is implemented with C<cgroup/sock_create> cgroup-bpf hooks.
158  
159 Example:
160 [Service]
161 BindNetworkInterface=vrf-mgmt
162 ',
163 'CPUPressureThresholdSec' => "Sets the CPU pressure threshold time for CPU pressure monitor as configured via
164 C<CPUPressureWatch>. Specifies the maximum CPU stall time before a CPU
165 pressure event is signalled to the service, per 2s window. If not specified, defaults to the
166 C<DefaultCPUPressureThresholdSec> setting in
167 L<systemd-system.conf(5)>
168 (which in turn defaults to 200ms). The specified value expects a time unit such as
169 C<ms> or C<\x{3bc}s>, see
170 L<systemd.time(7)> for
171 details on the permitted syntax.",
172 'CPUPressureWatch' => 'Controls CPU pressure monitoring for invoked processes. Takes a boolean or one of
173 C<auto> and C<skip>. If C<no>, tells the service not
174 to watch for CPU pressure events, by setting the C<$CPU_PRESSURE_WATCH>
175 environment variable to the literal string C</dev/null>. If C<yes>,
176 tells the service to watch for CPU pressure events. This ensures the
177 C<cpu.pressure> cgroup attribute file is accessible for
178 reading and writing by the service\'s user. It then sets the C<$CPU_PRESSURE_WATCH>
179 environment variable for processes invoked by the unit to the file system path to this file. The
180 threshold information configured with C<CPUPressureThresholdSec> is encoded in
181 the C<$CPU_PRESSURE_WRITE> environment variable. If the C<auto>
182 value is set the protocol is enabled if CPU resource controls are configured for the unit (e.g. because
183 C<CPUWeight> or C<CPUQuota> is set), and
184 disabled otherwise. If set to C<skip> the logic is neither enabled, nor disabled and
185 the two environment variables are not set.
186  
187 Note that services are free to use the two environment variables, but it is unproblematic if
188 they ignore them. CPU pressure handling must be implemented individually in each service, and
189 usually means different things for different software.
190  
191 Services implemented using
192 L<sd-event(3)> may use
193 L<sd_event_add_cpu_pressure(3)>
194 to watch for and handle CPU pressure events.
195  
196 If not explicitly set, defaults to the C<DefaultCPUPressureWatch> setting in
197 L<systemd-system.conf(5)>.',
198 'CPUQuota' => 'This setting controls the C<cpu> controller in the unified hierarchy.
199  
200 Assign the specified CPU time quota to the processes executed. Takes a percentage value, suffixed with
201 "%". The percentage specifies how much CPU time the unit shall get at maximum, relative to the total CPU time
202 available on one CPU. Use values > 100% for allotting CPU time on more than one CPU. This controls the
203 C<cpu.max> attribute on the unified control group hierarchy and
204 C<cpu.cfs_quota_us> on legacy. For details about these control group attributes, see L<Control Groups
205 v2|https://docs.kernel.org/admin-guide/cgroup-v2.html> and L<CFS Bandwidth
206 Control|https://docs.kernel.org/scheduler/sched-bwc.html>.
207 Setting C<CPUQuota> to an empty value unsets the quota.
208  
209 Example: C<CPUQuota=20%> ensures that the executed processes will never get more than
210 20% CPU time on one CPU.',
211 'CPUQuotaPeriodSec' => 'This setting controls the C<cpu> controller in the unified hierarchy.
212  
213 Assign the duration over which the CPU time quota specified by C<CPUQuota> is measured.
214 Takes a time duration value in seconds, with an optional suffix such as "ms" for milliseconds (or "s" for seconds.)
215 The default setting is 100ms. The period is clamped to the range supported by the kernel, which is [1ms, 1000ms].
216 Additionally, the period is adjusted up so that the quota interval is also at least 1ms.
217 Setting C<CPUQuotaPeriodSec> to an empty value resets it to the default.
218  
219 This controls the second field of C<cpu.max> attribute on the unified control group hierarchy
220 and C<cpu.cfs_period_us> on legacy. For details about these control group attributes, see
221 L<Control Groups v2|https://docs.kernel.org/admin-guide/cgroup-v2.html> and
222 L<CFS Scheduler|https://docs.kernel.org/scheduler/sched-design-CFS.html>.
223  
224 Example: C<CPUQuotaPeriodSec=10ms> to request that the CPU quota is measured in periods of 10ms.',
225 'CPUSetPartition' => 'Sets the C<cpuset> partition type for the executed processes. Takes one
226 of C<member>, C<root>, or C<isolated>. This setting
227 controls the C<cpuset.cpus.partition> cgroup attribute.
228  
229 When set to C<member>, the cpuset operates in normal mode.
230 C<root> creates a partition root, which can further divide CPUs among child cgroups.
231 C<isolated> provides full CPU isolation, useful for real-time workloads that
232 require dedicated CPU resources without interference from other processes.
233 Defaults to the kernel default, which is C<member>. For more details about this
234 control group attribute, see L<Control Groups v2|https://docs.kernel.org/admin-guide/cgroup-v2.html>.
235  
236 This setting requires C<AllowedCPUs> to also be set.',
237 'CPUWeight' => 'These settings control the C<cpu> controller in the unified hierarchy.
238  
239 These options accept an integer value or the special string "idle":
240  
241 While C<StartupCPUWeight> applies to the startup and shutdown phases of the system,
242 C<CPUWeight> applies to normal runtime of the system, and if the former is not set also to
243 the startup and shutdown phases. Using C<StartupCPUWeight> allows prioritizing specific services at
244 boot-up and shutdown differently than during normal runtime.
245  
246 In addition to the resource allocation performed by the C<cpu> controller, the
247 kernel may automatically divide resources based on session-id grouping, see "The autogroup feature"
248 in L<sched(7)>.
249 The effect of this feature is similar to the C<cpu> controller with no explicit
250 configuration, so users should be careful to not mistake one for the other.',
251 'CoredumpReceive' => 'Takes a boolean argument. This setting is used to enable coredump forwarding for containers
252 that belong to this unit\'s cgroup. Units with C<CoredumpReceive=yes> must also be configured
253 with C<Delegate=yes>. Defaults to false.
254  
255 When systemd-coredump is handling a coredump for a process from a container,
256 if the container\'s leader process is a descendant of a cgroup with C<CoredumpReceive=yes>
257 and C<Delegate=yes>, then systemd-coredump will attempt to forward
258 the coredump to systemd-coredump within the container. See also
259 L<systemd-coredump(8)>.',
260 'Delegate' => 'Turns on delegation of further resource control partitioning to processes of the unit. Units
261 where this is enabled may create and manage their own private subhierarchy of control groups below
262 the control group of the unit itself. For unprivileged services (i.e. those using the
263 C<User> setting) the unit\'s control group will be made accessible to the relevant
264 user.
265  
266 When enabled the service manager will refrain from manipulating control groups or moving
267 processes below the unit\'s control group, so that a clear concept of ownership is established: the
268 control group tree at the level of the unit\'s control group and above (i.e. towards the root
269 control group) is owned and managed by the service manager of the host, while the control group
270 tree below the unit\'s control group is owned and managed by the unit itself.
271  
272 Takes either a boolean argument or a (possibly empty) list of control group controller names.
273 If true, delegation is turned on, and all supported controllers are enabled for the unit, making
274 them available to the unit\'s processes for management. If false, delegation is turned off entirely
275 (and no additional controllers are enabled). If set to a list of controllers, delegation is turned
276 on, and the specified controllers are enabled for the unit. Assigning the empty string will enable
277 delegation, but reset the list of controllers, and all assignments prior to this will have no
278 effect. Note that additional controllers other than the ones specified might be made available as
279 well, depending on configuration of the containing slice unit or other units contained in it.
280 Defaults to false.
281  
282 Note that controller delegation to less privileged code is only safe on the unified control
283 group hierarchy. Accordingly, access to the specified controllers will not be granted to
284 unprivileged services on the legacy hierarchy, even when requested.
285  
286 Not all of these controllers are available on all kernels however, and some are specific to
287 the unified hierarchy while others are specific to the legacy hierarchy. Also note that the kernel
288 might support further controllers, which are not covered here yet, as delegation is either not
289 supported at all for them or not defined cleanly.
290  
291 Note that because of the hierarchical nature of cgroup hierarchy, any controllers that are
292 delegated will be enabled for the parent and sibling units of the unit with delegation.
293  
294 For further details on the delegation model consult L<Control Group APIs and
295 Delegation|https://systemd.io/CGROUP_DELEGATION>.',
296 'DelegateSubgroup' => 'Place unit processes in the specified subgroup of the unit\'s control group. Takes a valid
297 control group name (not a path!) as parameter, or an empty string to turn this feature
298 off. Defaults to off. The control group name must be usable as filename and avoid conflicts with
299 the kernel\'s control group attribute files (i.e. C<cgroup.procs> is not an
300 acceptable name, since the kernel exposes a native control group attribute file by that name). This
301 option has no effect unless control group delegation is turned on via C<Delegate>,
302 see above. Note that this setting only applies to "main" processes of a unit, i.e. for services to
303 C<ExecStart>, but not for C<ExecReload> and similar. If
304 delegation is enabled, the latter are always placed inside a subgroup named
305 C<.control>. The specified subgroup is automatically created (and potentially
306 ownership is passed to the unit\'s configured user/group) when a process is started in it.
307  
308 This option is useful to avoid manually moving the invoked process into a subgroup after it
309 has been started. Since no processes should live in inner nodes of the control group tree it is
310 almost always necessary to run the main ("supervising") process of a unit that has delegation
311 turned on in a subgroup.',
312 'DeviceAllow' => "Control access to specific device nodes by the executed processes. Takes two space-separated
313 strings: a device node specifier followed by a combination of C<r>,
314 C<w>, C<m> to control reading,
315 writing, or creation of the specific device nodes by the unit
316 (mknod), respectively. This functionality is implemented using eBPF
317 filtering.
318  
319 When access to all physical devices should be disallowed,
320 C<PrivateDevices> may be used instead. See
321 L<systemd.exec(5)>.
322  
323 The device node specifier is either a path to a device node in the file system, starting with
324 C</dev/>, or a string starting with either C<char-> or
325 C<block-> followed by a device group name, as listed in
326 C</proc/devices>. The latter is useful to allow-list all current and future
327 devices belonging to a specific device group at once. The device group is matched according to
328 filename globbing rules, you may hence use the C<*> and C<?>
329 wildcards. (Note that such globbing wildcards are not available for device node path
330 specifications!) In order to match device nodes by numeric major/minor, use device node paths in
331 the C</dev/char/> and C</dev/block/> directories. However,
332 matching devices by major/minor is generally not recommended as assignments are neither stable nor
333 portable between systems or different kernel versions.
334  
335 Examples: C</dev/sda5> is a path to a device node, referring to an ATA or
336 SCSI block device. C<char-pts> and C<char-alsa> are specifiers for
337 all pseudo TTYs and all ALSA sound devices, respectively. C<char-cpu/*> is a
338 specifier matching all CPU related device groups.
339  
340 Note that allow lists defined this way should only reference device groups which are
341 resolvable at the time the unit is started. Any device groups not resolvable then are not added to
342 the device allow list. In order to work around this limitation, consider extending service units
343 with a pair of After=modprobe\@xyz.service and
344 Wants=modprobe\@xyz.service lines that load the necessary kernel module
345 implementing the device group if missing.
346 Example:
347 \x{2026}
348 [Unit]
349 Wants=modprobe\@loop.service
350 After=modprobe\@loop.service
351 [Service]
352 DeviceAllow=block-loop
353 DeviceAllow=/dev/loop-control
354 \x{2026}
355 ",
356 'DevicePolicy' => '
357 Control the policy for allowing device access:
358 ',
359 'DisableControllers' => 'Disables controllers from being enabled for a unit\'s children. If a controller listed is
360 already in use in its subtree, the controller will be removed from the subtree. This can be used to
361 avoid configuration in child units from being able to implicitly or explicitly enable a controller.
362 Defaults to empty.
363  
364 Multiple controllers may be specified, separated by spaces. You may also pass
365 C<DisableControllers> multiple times, in which case each new instance adds another controller
366 to disable. Passing C<DisableControllers> by itself with no controller name present resets
367 the disabled controller list.
368  
369 It may not be possible to disable a controller after units have been started, if the unit or
370 any child of the unit in question delegates controllers to its children, as any delegated subtree
371 of the cgroup hierarchy is unmanaged by systemd.',
372 'IOAccounting' => 'This setting controls the C<io> controller in the unified hierarchy.
373  
374 Turn on Block I/O accounting for this unit, if the unified control group hierarchy is used on the
375 system. Takes a boolean argument. Note that turning on block I/O accounting for one unit will also implicitly
376 turn it on for all units contained in the same slice and all for its parent slices and the units contained
377 therein. The system default for this setting may be controlled with C<DefaultIOAccounting>
378 in
379 L<systemd-system.conf(5)>.',
380 'IODeviceLatencyTargetSec' => 'This setting controls the C<io> controller in the unified hierarchy.
381  
382 Set the per-device average target I/O latency for the executed processes, if the unified control group
383 hierarchy is used on the system. Takes a file path and a timespan separated by a space to specify
384 the device specific latency target. (Example: "/dev/sda 25ms"). The file path may be specified
385 as path to a block device node or as any other file, in which case the backing block device of the file
386 system of the file is determined. This controls the C<io.latency> control group
387 attribute. Use this option multiple times to set latency target for multiple devices. For details about this
388 control group attribute, see L<IO Interface
389 Files|https://docs.kernel.org/admin-guide/cgroup-v2.html#io-interface-files>.
390  
391 Implies C<IOAccounting=yes>.
392  
393 These settings are supported only if the unified control group hierarchy is used.
394  
395 Similar restrictions on block device discovery as for C<IODeviceWeight> apply, see above.',
396 'IODeviceWeight' => 'This setting controls the C<io> controller in the unified hierarchy.
397  
398 Set the per-device overall block I/O weight for the executed processes, if the unified control group
399 hierarchy is used on the system. Takes a space-separated pair of a file path and a weight value to specify
400 the device specific weight value, between 1 and 10000. (Example: C</dev/sda 1000>). The file
401 path may be specified as path to a block device node or as any other file, in which case the backing block
402 device of the file system of the file is determined. This controls the C<io.weight> control
403 group attribute, which defaults to 100. Use this option multiple times to set weights for multiple devices.
404 For details about this control group attribute, see L<IO Interface
405 Files|https://docs.kernel.org/admin-guide/cgroup-v2.html#io-interface-files>.
406  
407 The specified device node should reference a block device that has an I/O scheduler
408 associated, i.e. should not refer to partition or loopback block devices, but to the originating,
409 physical device. When a path to a regular file or directory is specified it is attempted to
410 discover the correct originating device backing the file system of the specified path. This works
411 correctly only for simpler cases, where the file system is directly placed on a partition or
412 physical block device, or where simple 1:1 encryption using dm-crypt/LUKS is used. This discovery
413 does not cover complex storage and in particular RAID and volume management storage devices.',
414 'IOPressureThresholdSec' => "Sets the IO pressure threshold time for IO pressure monitor as configured via
415 C<IOPressureWatch>. Specifies the maximum IO stall time before an IO
416 pressure event is signalled to the service, per 2s window. If not specified, defaults to the
417 C<DefaultIOPressureThresholdSec> setting in
418 L<systemd-system.conf(5)>
419 (which in turn defaults to 200ms). The specified value expects a time unit such as
420 C<ms> or C<\x{3bc}s>, see
421 L<systemd.time(7)> for
422 details on the permitted syntax.",
423 'IOPressureWatch' => 'Controls IO pressure monitoring for invoked processes. Takes a boolean or one of
424 C<auto> and C<skip>. If C<no>, tells the service not
425 to watch for IO pressure events, by setting the C<$IO_PRESSURE_WATCH>
426 environment variable to the literal string C</dev/null>. If C<yes>,
427 tells the service to watch for IO pressure events. This enables IO accounting for the
428 service, and ensures the C<io.pressure> cgroup attribute file is accessible for
429 reading and writing by the service\'s user. It then sets the C<$IO_PRESSURE_WATCH>
430 environment variable for processes invoked by the unit to the file system path to this file. The
431 threshold information configured with C<IOPressureThresholdSec> is encoded in
432 the C<$IO_PRESSURE_WRITE> environment variable. If the C<auto>
433 value is set the protocol is enabled if IO accounting is anyway enabled for the unit (e.g. because
434 C<IOWeight> or C<IODeviceWeight> is set), and
435 disabled otherwise. If set to C<skip> the logic is neither enabled, nor disabled and
436 the two environment variables are not set.
437  
438 Note that services are free to use the two environment variables, but it is unproblematic if
439 they ignore them. IO pressure handling must be implemented individually in each service, and
440 usually means different things for different software.
441  
442 Services implemented using
443 L<sd-event(3)> may use
444 L<sd_event_add_io_pressure(3)>
445 to watch for and handle IO pressure events.
446  
447 If not explicitly set, defaults to the C<DefaultIOPressureWatch> setting in
448 L<systemd-system.conf(5)>.',
449 'IOReadBandwidthMax' => 'These settings control the C<io> controller in the unified hierarchy.
450  
451 Set the per-device overall block I/O bandwidth maximum limit for the executed processes, if the unified
452 control group hierarchy is used on the system. This limit is not work-conserving and the executed processes
453 are not allowed to use more even if the device has idle capacity. Takes a space-separated pair of a file
454 path and a bandwidth value (in bytes per second) to specify the device specific bandwidth. The file path may
455 be a path to a block device node, or as any other file in which case the backing block device of the file
456 system of the file is used. If the bandwidth is suffixed with K, M, G, or T, the specified bandwidth is
457 parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes, respectively, to the base of 1000. (Example:
458 "/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 5M"). This controls the C<io.max> control
459 group attributes. Use this option multiple times to set bandwidth limits for multiple devices. For details
460 about this control group attribute, see L<IO Interface
461 Files|https://docs.kernel.org/admin-guide/cgroup-v2.html#io-interface-files>.
462  
463 Similar restrictions on block device discovery as for C<IODeviceWeight> apply, see above.',
464 'IOReadIOPSMax' => 'These settings control the C<io> controller in the unified hierarchy.
465  
466 Set the per-device overall block I/O IOs-Per-Second maximum limit for the executed processes, if the
467 unified control group hierarchy is used on the system. This limit is not work-conserving and the executed
468 processes are not allowed to use more even if the device has idle capacity. Takes a space-separated pair of
469 a file path and an IOPS value to specify the device specific IOPS. The file path may be a path to a block
470 device node, or as any other file in which case the backing block device of the file system of the file is
471 used. If the IOPS is suffixed with K, M, G, or T, the specified IOPS is parsed as KiloIOPS, MegaIOPS,
472 GigaIOPS, or TeraIOPS, respectively, to the base of 1000. (Example:
473 "/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 1K"). This controls the C<io.max> control
474 group attributes. Use this option multiple times to set IOPS limits for multiple devices. For details about
475 this control group attribute, see L<IO Interface
476 Files|https://docs.kernel.org/admin-guide/cgroup-v2.html#io-interface-files>.
477  
478 Similar restrictions on block device discovery as for C<IODeviceWeight> apply, see above.',
479 'IOWeight' => 'These settings control the C<io> controller in the unified hierarchy.
480  
481 Set the default overall block I/O weight for the executed processes, if the unified control
482 group hierarchy is used on the system. Takes a single weight value (between 1 and 10000) to set the
483 default block I/O weight. This controls the C<io.weight> control group attribute,
484 which defaults to 100. For details about this control group attribute, see L<IO
485 Interface Files|https://docs.kernel.org/admin-guide/cgroup-v2.html#io-interface-files>. The available I/O bandwidth is
486 split up among all units within one slice
487 relative to their block I/O weight. A higher weight means more I/O bandwidth, a lower weight means
488 less.
489  
490 While C<StartupIOWeight> applies
491 to the startup and shutdown phases of the system,
492 C<IOWeight> applies to the later runtime of
493 the system, and if the former is not set also to the startup
494 and shutdown phases. This allows prioritizing specific services at boot-up
495 and shutdown differently than during runtime.',
496 'IOWriteBandwidthMax' => '*IOReadBandwidthMax',
497 'IOWriteIOPSMax' => '*IOReadIOPSMax',
498 'IPAccounting' => "Takes a boolean argument. If true, turns on IPv4 and IPv6 network traffic accounting for packets sent
499 or received by the unit. When this option is turned on, all IPv4 and IPv6 sockets created by any process of
500 the unit are accounted for.
501  
502 When this option is used in socket units, it applies to all IPv4 and IPv6 sockets
503 associated with it (including both listening and connection sockets where this applies). Note that for
504 socket-activated services, this configuration setting and the accounting data of the service unit and the
505 socket unit are kept separate, and displayed separately. No propagation of the setting and the collected
506 statistics is done, in either direction. Moreover, any traffic sent or received on any of the socket unit's
507 sockets is accounted to the socket unit \x{2014} and never to the service unit it might have activated, even if the
508 socket is used by it.
509  
510 The system default for this setting may be controlled with C<DefaultIPAccounting> in
511 L<systemd-system.conf(5)>.
512  
513 Note that this functionality is currently only available for system services, not for
514 per-user services.",
515 'IPAddressAllow' => "Turn on network traffic filtering for IP packets sent and received over
516 C<AF_INET> and C<AF_INET6> sockets. Both directives take a
517 space separated list of IPv4 or IPv6 addresses, each optionally suffixed with an address prefix
518 length in bits after a C</> character. If the suffix is omitted, the address is
519 considered a host address, i.e. the filter covers the whole address (32 bits for IPv4, 128 bits for
520 IPv6).
521  
522 The access lists configured with this option are applied to all sockets created by processes
523 of this unit (or in the case of socket units, associated with it). The lists are implicitly
524 combined with any lists configured for any of the parent slice units this unit might be a member
525 of. By default, both access lists are empty. Both ingress and egress traffic is filtered by these
526 settings. In case of ingress traffic the source IP address is checked against these access lists,
527 in case of egress traffic the destination IP address is checked. The following rules are applied in
528 turn:
529  
530 In order to implement an allow-listing IP firewall, it is recommended to use a
531 C<IPAddressDeny>=C<any> setting on an upper-level slice unit
532 (such as the root slice C<-.slice> or the slice containing all system services
533 C<system.slice> \x{2013} see
534 L<systemd.special(7)>
535 for details on these slice units), plus individual per-service C<IPAddressAllow>
536 lines permitting network access to relevant services, and only them.
537  
538 Note that for socket-activated services, the IP access list configured on the socket unit
539 applies to all sockets associated with it directly, but not to any sockets created by the
540 ultimately activated services for it. Conversely, the IP access list configured for the service is
541 not applied to any sockets passed into the service via socket activation. Thus, it is usually a
542 good idea to replicate the IP access lists on both the socket and the service unit. Nevertheless,
543 it may make sense to maintain one list more open and the other one more restricted, depending on
544 the use case.
545  
546 If these settings are used multiple times in the same unit the specified lists are combined. If an
547 empty string is assigned to these settings the specific access list is reset and all previous settings undone.
548  
549 In place of explicit IPv4 or IPv6 address and prefix length specifications a small set of symbolic
550 names may be used. The following names are defined:
551  
552 Note that these settings might not be supported on some systems (for example if eBPF control group
553 support is not enabled in the underlying kernel or container manager). These settings will have no effect in
554 that case. If compatibility with such systems is desired it is hence recommended to not exclusively rely on
555 them for IP security.",
556 'IPAddressDeny' => '*IPAddressAllow',
557 'IPEgressFilterPath' => 'Add custom network traffic filters implemented as BPF programs, applying to all IP packets
558 sent and received over C<AF_INET> and C<AF_INET6> sockets.
559 Takes an absolute path to a pinned BPF program in the BPF virtual filesystem (C</sys/fs/bpf/>).
560  
561 The filters configured with this option are applied to all sockets created by processes
562 of this unit (or in the case of socket units, associated with it). The filters are loaded in addition
563 to filters any of the parent slice units this unit might be a member of as well as any
564 C<IPAddressAllow> and C<IPAddressDeny> filters in any of these units.
565 By default, there are no filters specified.
566  
567 If these settings are used multiple times in the same unit all the specified programs are attached. If an
568 empty string is assigned to these settings the program list is reset and all previous specified programs ignored.
569  
570 If the path BPF_FS_PROGRAM_PATH in C<IPIngressFilterPath> assignment
571 is already being handled by C<BPFProgram> ingress hook, e.g.
572 C<BPFProgram>=C<ingress>:BPF_FS_PROGRAM_PATH,
573 the assignment will be still considered valid and the program will be attached to a cgroup. Same for
574 C<IPEgressFilterPath> path and C<egress> hook.
575  
576 Note that for socket-activated services, the IP filter programs configured on the socket unit apply to
577 all sockets associated with it directly, but not to any sockets created by the ultimately activated services
578 for it. Conversely, the IP filter programs configured for the service are not applied to any sockets passed into
579 the service via socket activation. Thus, it is usually a good idea, to replicate the IP filter programs on both
580 the socket and the service unit, however it often makes sense to maintain one configuration more open and the other
581 one more restricted, depending on the use case.
582  
583 Note that these settings might not be supported on some systems (for example if eBPF control group
584 support is not enabled in the underlying kernel or container manager). These settings will have no effect in
585 that case. If compatibility with such systems is desired it is hence recommended to attach your filter manually
586 (requires C<Delegate>=C<yes>) instead of using this setting.',
587 'IPIngressFilterPath' => '*IPEgressFilterPath',
588 'ManagedOOMMemoryPressure' => 'Specifies how
589 L<systemd-oomd.service(8)>
590 will act on this unit\'s cgroups. Defaults to C<auto>.
591  
592 When set to C<kill>, the unit becomes a candidate for monitoring by
593 systemd-oomd. If the cgroup passes the limits set by
594 L<oomd.conf(5)> or
595 the unit configuration, systemd-oomd will select a descendant cgroup and send
596 C<SIGKILL> to all of the processes under it. You can find more details on
597 candidates and kill behavior at
598 L<systemd-oomd.service(8)>
599 and
600 L<oomd.conf(5)>.
601  
602 Setting either of these properties to C<kill> will also result in
603 C<After> and C<Wants> dependencies on
604 C<systemd-oomd.service> unless C<DefaultDependencies=no>.
605  
606 When set to C<auto>, systemd-oomd will not actively use this
607 cgroup\'s data for monitoring and detection. However, if an ancestor cgroup has one of these
608 properties set to C<kill>, a unit with C<auto> can still be a candidate
609 for systemd-oomd to terminate.',
610 'ManagedOOMMemoryPressureDurationSec' => "Overrides the default memory pressure duration set by
611 L<oomd.conf(5)> for
612 the cgroup of this unit. The specified value supports a time unit such as C<ms> or
613 C<\x{3bc}s>, see
614 L<systemd.time(7)>
615 for details on the permitted syntax. Must be set to either empty or a value of at least 1s. Defaults
616 to empty, which means to use the default set by
617 L<oomd.conf(5)>.
618 This property is ignored unless C<ManagedOOMMemoryPressure>=C<kill>.
619 ",
620 'ManagedOOMMemoryPressureLimit' => 'Overrides the default memory pressure limit set by
621 L<oomd.conf(5)> for
622 the cgroup of this unit. Takes a percentage value between 0% and 100%, inclusive. Defaults to 0%,
623 which means to use the default set by
624 L<oomd.conf(5)>.
625 This property is ignored unless C<ManagedOOMMemoryPressure>=C<kill>.
626 ',
627 'ManagedOOMPreference' => 'Allows deprioritizing or omitting this unit\'s cgroup as a candidate when
628 systemd-oomd needs to act. Requires support for extended attributes (see
629 L<xattr(7)>)
630 in order to use C<avoid> or C<omit>.
631  
632 When calculating candidates to relieve swap usage, systemd-oomd will
633 only respect these extended attributes if the unit\'s cgroup is owned by root.
634  
635 When calculating candidates to relieve memory pressure, systemd-oomd
636 will only respect these extended attributes if the unit\'s cgroup is owned by root, or if the
637 unit\'s cgroup owner, and the owner of the monitored ancestor cgroup are the same. For example,
638 if systemd-oomd is calculating candidates for C<-.slice>,
639 then extended attributes set on descendants of C</user.slice/user-1000.slice/user@1000.service/>
640 will be ignored because the descendants are owned by UID 1000, and C<-.slice>
641 is owned by UID 0. But, if calculating candidates for
642 C</user.slice/user-1000.slice/user@1000.service/>, then extended attributes set
643 on the descendants would be respected.
644  
645 If this property is set to C<avoid>, the service manager will convey this to
646 systemd-oomd, which will only select this cgroup if there are no other viable
647 candidates.
648  
649 If this property is set to C<omit>, the service manager will convey this to
650 systemd-oomd, which will ignore this cgroup as a candidate and will not perform
651 any actions on it.
652  
653 It is recommended to use C<avoid> and C<omit> sparingly, as it
654 can adversely affect systemd-oomd\'s kill behavior. Also note that these extended
655 attributes are not applied recursively to cgroups under this unit\'s cgroup.
656  
657 Defaults to C<none> which means systemd-oomd will rank this
658 unit\'s cgroup as defined in
659 L<systemd-oomd.service(8)>
660 and L<oomd.conf(5)>.
661 ',
662 'ManagedOOMSwap' => '*ManagedOOMMemoryPressure',
663 'MemoryAccounting' => 'This setting controls the C<memory> controller in the unified hierarchy.
664  
665 Turn on process and kernel memory accounting for this
666 unit. Takes a boolean argument. Note that turning on memory
667 accounting for one unit will also implicitly turn it on for
668 all units contained in the same slice and for all its parent
669 slices and the units contained therein. The system default
670 for this setting may be controlled with
671 C<DefaultMemoryAccounting> in
672 L<systemd-system.conf(5)>.',
673 'MemoryHigh' => 'These settings control the C<memory> controller in the unified hierarchy.
674  
675 Specify the throttling limit on memory usage of the executed processes in this unit. Memory usage may go
676 above the limit if unavoidable, but the processes are heavily slowed down and memory is taken away
677 aggressively in such cases. This is the main mechanism to control memory usage of a unit.
678  
679 Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is
680 parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a
681 percentage value may be specified, which is taken relative to the installed physical memory on the
682 system. If assigned the
683 special value C<infinity>, no memory throttling is applied. This controls the
684 C<memory.high> control group attribute. For details about this control group attribute, see
685 L<Memory Interface Files|https://docs.kernel.org/admin-guide/cgroup-v2.html#memory-interface-files>.
686 The effective configuration is reported as C<EffectiveMemoryHigh>
687 (see also C<EffectiveMemoryMax>).
688  
689 While C<StartupMemoryHigh> applies to the startup and shutdown phases of the system,
690 C<MemoryHigh> applies to normal runtime of the system, and if the former is not set also to
691 the startup and shutdown phases. Using C<StartupMemoryHigh> allows prioritizing specific services at
692 boot-up and shutdown differently than during normal runtime.',
693 'MemoryMax' => 'These settings control the C<memory> controller in the unified hierarchy.
694  
695 Specify the absolute limit on memory usage of the executed processes in this unit. If memory usage
696 cannot be contained under the limit, out-of-memory killer is invoked inside the unit. It is recommended to
697 use C<MemoryHigh> as the main control mechanism and use C<MemoryMax> as the
698 last line of defense.
699  
700 Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is
701 parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a
702 percentage value may be specified, which is taken relative to the installed physical memory on the system. If
703 assigned the special value C<infinity>, no memory limit is applied. This controls the
704 C<memory.max> control group attribute. For details about this control group attribute, see
705 L<Memory Interface Files|https://docs.kernel.org/admin-guide/cgroup-v2.html#memory-interface-files>.
706 The effective configuration is reported as C<EffectiveMemoryMax> (the value is
707 the most stringent limit of the unit and parent slices and it is capped by physical memory).
708  
709 While C<StartupMemoryMax> applies to the startup and shutdown phases of the system,
710 C<MemoryMax> applies to normal runtime of the system, and if the former is not set also to
711 the startup and shutdown phases. Using C<StartupMemoryMax> allows prioritizing specific services at
712 boot-up and shutdown differently than during normal runtime.',
713 'MemoryMin' => 'These settings control the C<memory> controller in the unified hierarchy.
714  
715 Specify the memory usage protection of the executed processes in this unit.
716 When reclaiming memory, the unit is treated as if it was using less memory resulting in memory
717 to be preferentially reclaimed from unprotected units.
718 Using C<MemoryLow> results in a weaker protection where memory may still
719 be reclaimed to avoid invoking the OOM killer in case there is no other reclaimable memory.
720  
721 For a protection to be effective, it is generally required to set a corresponding
722 allocation on all ancestors, which is then distributed between children
723 (with the exception of the root slice).
724 Any C<MemoryMin> or C<MemoryLow> allocation that is not
725 explicitly distributed to specific children is used to create a shared protection for all children.
726 As this is a shared protection, the children will freely compete for the memory.
727  
728 Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is
729 parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a
730 percentage value may be specified, which is taken relative to the installed physical memory on the
731 system. If assigned the special value C<infinity>, all available memory is protected, which may be
732 useful in order to always inherit all of the protection afforded by ancestors.
733 This controls the C<memory.min> or C<memory.low> control group attribute.
734 For details about this control group attribute, see L<Memory Interface
735 Files|https://docs.kernel.org/admin-guide/cgroup-v2.html#memory-interface-files>.
736  
737 While C<StartupMemoryLow> applies to the startup and shutdown phases of the system,
738 C<MemoryMin> applies to normal runtime of the system, and if the former is not set also to
739 the startup and shutdown phases. Using C<StartupMemoryLow> allows prioritizing specific services at
740 boot-up and shutdown differently than during normal runtime.',
741 'MemoryPressureThresholdSec' => "Sets the memory pressure threshold time for memory pressure monitor as configured via
742 C<MemoryPressureWatch>. Specifies the maximum allocation latency before a memory
743 pressure event is signalled to the service, per 2s window. If not specified, defaults to the
744 C<DefaultMemoryPressureThresholdSec> setting in
745 L<systemd-system.conf(5)>
746 (which in turn defaults to 200ms). The specified value expects a time unit such as
747 C<ms> or C<\x{3bc}s>, see
748 L<systemd.time(7)> for
749 details on the permitted syntax.",
750 'MemoryPressureWatch' => 'Controls memory pressure monitoring for invoked processes. Takes a boolean or one of
751 C<auto> and C<skip>. If C<no>, tells the service not
752 to watch for memory pressure events, by setting the C<$MEMORY_PRESSURE_WATCH>
753 environment variable to the literal string C</dev/null>. If C<yes>,
754 tells the service to watch for memory pressure events. This enables memory accounting for the
755 service, and ensures the C<memory.pressure> cgroup attribute file is accessible for
756 reading and writing by the service\'s user. It then sets the C<$MEMORY_PRESSURE_WATCH>
757 environment variable for processes invoked by the unit to the file system path to this file. The
758 threshold information configured with C<MemoryPressureThresholdSec> is encoded in
759 the C<$MEMORY_PRESSURE_WRITE> environment variable. If the C<auto>
760 value is set the protocol is enabled if memory accounting is anyway enabled for the unit, and
761 disabled otherwise. If set to C<skip> the logic is neither enabled, nor disabled and
762 the two environment variables are not set.
763  
764 Note that services are free to use the two environment variables, but it is unproblematic if
765 they ignore them. Memory pressure handling must be implemented individually in each service, and
766 usually means different things for different software. For further details on memory pressure
767 handling see L<Resource Pressure Handling in
768 systemd|https://systemd.io/PRESSURE>.
769  
770 Services implemented using
771 L<sd-event(3)> may use
772 L<sd_event_add_memory_pressure(3)>
773 to watch for and handle memory pressure events.
774  
775 If not explicit set, defaults to the C<DefaultMemoryPressureWatch> setting in
776 L<systemd-system.conf(5)>.',
777 'MemorySwapMax' => 'These settings control the C<memory> controller in the unified hierarchy.
778  
779 Specify the absolute limit on swap usage of the executed processes in this unit.
780  
781 Takes a swap size in bytes. If the value is suffixed with K, M, G or T, the specified swap size is
782 parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a
783 percentage value may be specified, which is taken relative to the specified swap size on the system. If assigned the
784 special value C<infinity>, no swap limit is applied. These settings control the
785 C<memory.swap.max> control group attribute. For details about this control group attribute,
786 see L<Memory Interface Files|https://docs.kernel.org/admin-guide/cgroup-v2.html#memory-interface-files>.
787  
788 While C<StartupMemorySwapMax> applies to the startup and shutdown phases of the system,
789 C<MemorySwapMax> applies to normal runtime of the system, and if the former is not set also to
790 the startup and shutdown phases. Using C<StartupMemorySwapMax> allows prioritizing specific services at
791 boot-up and shutdown differently than during normal runtime.',
792 'MemoryZSwapMax' => 'These settings control the C<memory> controller in the unified hierarchy.
793  
794 Specify the absolute limit on zswap usage of the processes in this unit. Zswap is a lightweight compressed
795 cache for swap pages. It takes pages that are in the process of being swapped out and attempts to compress them into a
796 dynamically allocated RAM-based memory pool. If the limit specified is hit, no entries from this unit will be
797 stored in the pool until existing entries are faulted back or written out to disk. See the kernel\'s
798 L<Zswap|https://docs.kernel.org/admin-guide/mm/zswap.html> documentation for more details.
799  
800 Takes a size in bytes. If the value is suffixed with K, M, G or T, the specified size is
801 parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. If assigned the
802 special value C<infinity>, no limit is applied. These settings control the
803 C<memory.zswap.max> control group attribute. For details about this control group attribute,
804 see L<Memory Interface Files|https://docs.kernel.org/admin-guide/cgroup-v2.html#memory-interface-files>.
805  
806 While C<StartupMemoryZSwapMax> applies to the startup and shutdown phases of the system,
807 C<MemoryZSwapMax> applies to normal runtime of the system, and if the former is not set also to
808 the startup and shutdown phases. Using C<StartupMemoryZSwapMax> allows prioritizing specific services at
809 boot-up and shutdown differently than during normal runtime.',
810 'MemoryZSwapWriteback' => 'This setting controls the C<memory> controller in the unified hierarchy.
811  
812 Takes a boolean argument. Defaults to true if C<DefaultMemoryZSwapWriteback>
813 is not set. When true, pages stored in the Zswap cache are permitted to be
814 written to the backing storage, false otherwise. This allows disabling writeback of swap pages for
815 IO-intensive applications, while retaining the ability to store compressed pages in Zswap. See the kernel\'s
816 L<Zswap|https://docs.kernel.org/admin-guide/mm/zswap.html> documentation
817 for more details.
818  
819 The system default for this setting may be controlled with C<DefaultMemoryZSwapWriteback>
820 in L<systemd-system.conf(5)>.',
821 'NFTSet' => 'This setting provides a method for integrating dynamic cgroup, user and group IDs into
822 firewall rules with L<NFT|https://netfilter.org/projects/nftables/index.html>
823 sets. The benefit of using this setting is to be able to use the IDs as selectors in firewall rules
824 easily and this in turn allows more fine grained filtering. NFT rules for cgroup matching use
825 numeric cgroup IDs, which change every time a service is restarted, making them hard to use in
826 systemd environment otherwise. Dynamic and random IDs used by C<DynamicUser> can
827 be also integrated with this setting.
828  
829 This option expects a whitespace separated list of NFT set definitions. Each definition
830 consists of a colon-separated tuple of source type (one of C<cgroup>,
831 C<user> or C<group>), NFT address family (one of
832 C<arp>, C<bridge>, C<inet>, C<ip>,
833 C<ip6>, or C<netdev>), table name and set name. The names of tables
834 and sets must conform to lexicographic restrictions of NFT table names. The type of the element used in
835 the NFT filter must match the type implied by the directive (C<cgroup>,
836 C<user> or C<group>) as shown in the table below. When a control
837 group or a unit is realized, the corresponding ID will be appended to the NFT sets and it will be
838 be removed when the control group or unit is removed. systemd only inserts
839 elements to (or removes from) the sets, so the related NFT rules, tables and sets must be prepared
840 elsewhere in advance. Failures to manage the sets will be ignored.
841  
842 If the firewall rules are reinstalled so that the contents of NFT sets are destroyed, command
843 systemctl daemon-reload can be used to refill the sets.
844  
845 Example:
846  
847 [Service]
848 NFTSet=cgroup:inet:filter:my_service user:inet:filter:serviceuser
849  
850  
851 Corresponding NFT rules:
852  
853 table inet filter {
854 set my_service {
855 type cgroupsv2
856 }
857 set serviceuser {
858 typeof meta skuid
859 }
860 chain x {
861 socket cgroupv2 level 2 @my_service accept
862 drop
863 }
864 chain y {
865 meta skuid @serviceuser accept
866 drop
867 }
868 }
869 ',
870 'OOMRules' => 'Takes a space-separated list of OOM ruleset names. The rulesets are defined in
871 C<.oomrule> files placed in
872 C</etc/systemd/oomd/rules.d/>,
873 C</run/systemd/oomd/rules.d/>,
874 C</usr/local/lib/systemd/oomd/rules.d/>, or
875 C</usr/lib/systemd/oomd/rules.d/>. When set,
876 L<systemd-oomd.service(8)>
877 will monitor this unit\'s cgroup and evaluate the specified rulesets against it.
878 Each ruleset defines conditions (such as memory pressure or swap usage thresholds) and an action
879 to take when those conditions are met. See
880 L<oomd.conf(5)> for
881 details on the available ruleset options.
882  
883 Setting this property will also result in C<After> and
884 C<Wants> dependencies on C<systemd-oomd.service> unless
885 C<DefaultDependencies=no>.
886  
887 Defaults to an empty list, which means no rulesets are applied. Note that each monitored
888 cgroup incurs a per-interval walk of its descendant cgroup tree, so monitoring very large numbers of
889 cgroups via C<OOMRules> may have a measurable performance impact.',
890 'RestrictNetworkInterfaces' => 'Takes a list of space-separated network interface names. This option restricts the network
891 interfaces that processes of this unit can use. By default, processes can only use the network interfaces
892 listed (allow-list). If the first character of the rule is C<~>, the effect is inverted:
893 the processes can only use network interfaces not listed (deny-list).
894  
895 This option can appear multiple times, in which case the network interface names are merged. If the
896 empty string is assigned the set is reset, all prior assignments will have not effect.
897  
898 If you specify both types of this option (i.e. allow-listing and deny-listing), the first encountered
899 will take precedence and will dictate the default action (allow vs deny). Then the next occurrences of this
900 option will add or delete the listed network interface names from the set, depending of its type and the
901 default action.
902  
903 The loopback interface ("lo") is not treated in any special way, you have to configure it explicitly
904 in the unit file.
905  
906 Example 1: allow-list
907  
908  
909 RestrictNetworkInterfaces=eth1
910 RestrictNetworkInterfaces=eth2
911  
912 Programs in the unit will be only able to use the eth1 and eth2 network
913 interfaces.
914  
915 Example 2: deny-list
916  
917  
918 RestrictNetworkInterfaces=~eth1 eth2
919  
920 Programs in the unit will be able to use any network interface but eth1 and eth2.
921  
922 Example 3: mixed
923  
924  
925 RestrictNetworkInterfaces=eth1 eth2
926 RestrictNetworkInterfaces=~eth1
927  
928 Programs in the unit will be only able to use the eth2 network interface.
929 ',
930 'Slice' => 'The name of the slice unit to place the unit
931 in. Defaults to C<system.slice> for all
932 non-instantiated units of all unit types (except for slice
933 units themselves see below). Instance units are by default
934 placed in a subslice of C<system.slice>
935 that is named after the template name.
936  
937 This option may be used to arrange systemd units in a
938 hierarchy of slices each of which might have resource
939 settings applied.
940  
941 For units of type slice, the only accepted value for
942 this setting is the parent slice. Since the name of a slice
943 unit implies the parent slice, it is hence redundant to ever
944 set this parameter directly for slice units.
945  
946 Special care should be taken when relying on the default slice assignment in templated service units
947 that have C<DefaultDependencies=no> set, see
948 L<systemd.service(5)>, section
949 "Default Dependencies" for details.',
950 'SocketBindAllow' => "Configures restrictions on the ability of unit processes to invoke L<bind(2)> on a
951 socket. Both allow and deny rules to be defined that restrict which addresses a socket may be bound
952 to.
953  
954 bind-rule describes socket properties such as address-family,
955 transport-protocol and ip-ports.
956  
957 bind-rule :=
958 { [address-familyC<:>][transport-protocolC<:>][ip-ports] | C<any> }
959  
960 address-family := { C<ipv4> | C<ipv6> }
961  
962 transport-protocol := { C<tcp> | C<udp> }
963  
964 ip-ports := { ip-port | ip-port-range }
965  
966 An optional address-family expects C<ipv4> or C<ipv6> values.
967 If not specified, a rule will be matched for both IPv4 and IPv6 addresses and applied depending on other socket fields,
968 e.g. transport-protocol,
969 ip-port.
970  
971 An optional transport-protocol expects C<tcp> or C<udp> transport protocol names.
972 If not specified, a rule will be matched for any transport protocol.
973  
974 An optional ip-port value must lie within 1\x{2026}65535 interval inclusively, i.e.
975 dynamic port C<0> is not allowed. A range of sequential ports is described by
976 ip-port-range := ip-port-lowC<->ip-port-high,
977 where ip-port-low is smaller than or equal to ip-port-high
978 and both are within 1\x{2026}65535 inclusively.
979  
980 A special value C<any> can be used to apply a rule to any address family, transport protocol and any port with a
981 positive value.
982  
983 To allow multiple rules assign C<SocketBindAllow> or C<SocketBindDeny> multiple times.
984 To clear the existing assignments pass an empty C<SocketBindAllow> or C<SocketBindDeny>
985 assignment.
986  
987 For each of C<SocketBindAllow> and C<SocketBindDeny>, maximum allowed number of assignments is
988 C<128>.
989  
990 The feature is implemented with C<cgroup/bind4> and C<cgroup/bind6> cgroup-bpf hooks.
991  
992 Note that these settings apply to any L<bind(2)>
993 system call invocation by the unit processes, regardless in which network namespace they are
994 placed. Or in other words: changing the network namespace is not a suitable mechanism for escaping
995 these restrictions on bind().
996  
997 Examples:
998 \x{2026}
999 # Allow binding IPv6 socket addresses with a port greater than or equal to 10000.
1000 [Service]
1001 SocketBindAllow=ipv6:10000-65535
1002 SocketBindDeny=any
1003 \x{2026}
1004 # Allow binding IPv4 and IPv6 socket addresses with 1234 and 4321 ports.
1005 [Service]
1006 SocketBindAllow=1234
1007 SocketBindAllow=4321
1008 SocketBindDeny=any
1009 \x{2026}
1010 # Deny binding IPv6 socket addresses.
1011 [Service]
1012 SocketBindDeny=ipv6
1013 \x{2026}
1014 # Deny binding IPv4 and IPv6 socket addresses.
1015 [Service]
1016 SocketBindDeny=any
1017 \x{2026}
1018 # Allow binding only over TCP
1019 [Service]
1020 SocketBindAllow=tcp
1021 SocketBindDeny=any
1022 \x{2026}
1023 # Allow binding only over IPv6/TCP
1024 [Service]
1025 SocketBindAllow=ipv6:tcp
1026 SocketBindDeny=any
1027 \x{2026}
1028 # Allow binding ports within 10000-65535 range over IPv4/UDP.
1029 [Service]
1030 SocketBindAllow=ipv4:udp:10000-65535
1031 SocketBindDeny=any
1032 \x{2026}
1033 ",
1034 'SocketBindDeny' => '*SocketBindAllow',
1035 'StartupAllowedCPUs' => '*AllowedCPUs',
1036 'StartupAllowedMemoryNodes' => '*AllowedMemoryNodes',
1037 'StartupCPUWeight' => '*CPUWeight',
1038 'StartupIOWeight' => '*IOWeight',
1039 'StartupMemoryHigh' => '*MemoryHigh',
1040 'StartupMemoryLow' => '*MemoryMin',
1041 'StartupMemoryMax' => '*MemoryMax',
1042 'StartupMemorySwapMax' => '*MemorySwapMax',
1043 'StartupMemoryZSwapMax' => '*MemoryZSwapMax',
1044 'TasksAccounting' => 'This setting controls the C<pids> controller in the unified hierarchy.
1045  
1046 Turn on task accounting for this unit. Takes a boolean argument. If enabled, the kernel will
1047 keep track of the total number of tasks in the unit and its children. This number includes both
1048 kernel threads and userspace processes, with each thread counted individually. Note that turning on
1049 tasks accounting for one unit will also implicitly turn it on for all units contained in the same
1050 slice and for all its parent slices and the units contained therein. The system default for this
1051 setting may be controlled with C<DefaultTasksAccounting> in
1052 L<systemd-system.conf(5)>.',
1053 'TasksMax' => 'This setting controls the C<pids> controller in the unified hierarchy.
1054  
1055 Specify the maximum number of tasks that may be created in the unit. This ensures that the
1056 number of tasks accounted for the unit (see above) stays below a specific limit. This either takes
1057 an absolute number of tasks or a percentage value that is taken relative to the configured maximum
1058 number of tasks on the system. If assigned the special value C<infinity>, no tasks
1059 limit is applied. This controls the C<pids.max> control group attribute. For
1060 details about this control group attribute, see the
1061 L<pids controller|https://docs.kernel.org/admin-guide/cgroup-v2.html#pid>.
1062 The effective configuration is reported as C<EffectiveTasksMax>.
1063  
1064 The system default for this setting may be controlled with
1065 C<DefaultTasksMax> in
1066 L<systemd-system.conf(5)>.'
1067 },
1068 'element' => [
1069 'CPUWeight',
1070 {
1071 'type' => 'leaf',
1072 'value_type' => 'uniline'
1073 },
1074 'StartupCPUWeight',
1075 '*CPUWeight',
1076 'CPUQuota',
1077 '*CPUWeight',
1078 'CPUQuotaPeriodSec',
1079 '*CPUWeight',
1080 'AllowedCPUs',
1081 '*CPUWeight',
1082 'StartupAllowedCPUs',
1083 '*CPUWeight',
1084 'MemoryAccounting',
1085 {
1086 'type' => 'leaf',
1087 'value_type' => 'boolean',
1088 'write_as' => [
1089 'no',
1090 'yes'
1091 ]
1092 },
1093 'MemoryMin',
1094 {
1095 'type' => 'leaf',
1096 'value_type' => 'uniline'
1097 },
1098 'StartupMemoryLow',
1099 '*MemoryMin',
1100 'MemoryHigh',
1101 '*MemoryMin',
1102 'StartupMemoryHigh',
1103 '*MemoryMin',
1104 'MemoryMax',
1105 '*MemoryMin',
1106 'StartupMemoryMax',
1107 '*MemoryMin',
1108 'MemorySwapMax',
1109 '*MemoryMin',
1110 'StartupMemorySwapMax',
1111 '*MemoryMin',
1112 'MemoryZSwapMax',
1113 '*MemoryMin',
1114 'StartupMemoryZSwapMax',
1115 '*MemoryMin',
1116 'MemoryZSwapWriteback',
1117 {
1118 'type' => 'leaf',
1119 'value_type' => 'boolean',
1120 'write_as' => [
1121 'no',
1122 'yes'
1123 ]
1124 },
1125 'AllowedMemoryNodes',
1126 {
1127 'type' => 'leaf',
1128 'value_type' => 'uniline'
1129 },
1130 'StartupAllowedMemoryNodes',
1131 '*AllowedMemoryNodes',
1132 'CPUSetPartition',
1133 {
1134 'choice' => [
1135 'isolated',
1136 'member',
1137 'root'
1138 ],
1139 'type' => 'leaf',
1140 'value_type' => 'enum'
1141 },
1142 'TasksAccounting',
1143 {
1144 'type' => 'leaf',
1145 'value_type' => 'boolean',
1146 'write_as' => [
1147 'no',
1148 'yes'
1149 ]
1150 },
1151 'TasksMax',
1152 {
1153 'type' => 'leaf',
1154 'value_type' => 'uniline'
1155 },
1156 'IOAccounting',
1157 {
1158 'type' => 'leaf',
1159 'value_type' => 'boolean',
1160 'write_as' => [
1161 'no',
1162 'yes'
1163 ]
1164 },
1165 'IOWeight',
1166 {
1167 'type' => 'leaf',
1168 'value_type' => 'uniline'
1169 },
1170 'StartupIOWeight',
1171 '*IOWeight',
1172 'IODeviceWeight',
1173 '*IOWeight',
1174 'IOReadBandwidthMax',
1175 '*IOWeight',
1176 'IOWriteBandwidthMax',
1177 '*IOWeight',
1178 'IOReadIOPSMax',
1179 '*IOWeight',
1180 'IOWriteIOPSMax',
1181 '*IOWeight',
1182 'IODeviceLatencyTargetSec',
1183 '*IOWeight',
1184 'IPAccounting',
1185 {
1186 'type' => 'leaf',
1187 'value_type' => 'boolean',
1188 'write_as' => [
1189 'no',
1190 'yes'
1191 ]
1192 },
1193 'IPAddressAllow',
1194 {
1195 'type' => 'leaf',
1196 'value_type' => 'uniline'
1197 },
1198 'IPAddressDeny',
1199 '*IPAddressAllow',
1200 'SocketBindAllow',
1201 '*IPAddressAllow',
1202 'SocketBindDeny',
1203 '*IPAddressAllow',
1204 'RestrictNetworkInterfaces',
1205 '*IPAddressAllow',
1206 'BindNetworkInterface',
1207 '*IPAddressAllow',
1208 'NFTSet',
1209 '*IPAddressAllow',
1210 'IPIngressFilterPath',
1211 '*IPAddressAllow',
1212 'IPEgressFilterPath',
1213 '*IPAddressAllow',
1214 'BPFProgram',
1215 '*IPAddressAllow',
1216 'DeviceAllow',
1217 {
1218 'cargo' => {
1219 'type' => 'leaf',
1220 'value_type' => 'uniline'
1221 },
1222 'type' => 'list'
1223 },
1224 'DevicePolicy',
1225 {
1226 'choice' => [
1227 'auto',
1228 'closed',
1229 'strict'
1230 ],
1231 'type' => 'leaf',
1232 'value_type' => 'enum'
1233 },
1234 'Slice',
1235 {
1236 'type' => 'leaf',
1237 'value_type' => 'uniline'
1238 },
1239 'Delegate',
1240 '*Slice',
1241 'DelegateSubgroup',
1242 '*Slice',
1243 'DisableControllers',
1244 '*Slice',
1245 'ManagedOOMSwap',
1246 {
1247 'choice' => [
1248 'auto',
1249 'kill'
1250 ],
1251 'type' => 'leaf',
1252 'value_type' => 'enum'
1253 },
1254 'ManagedOOMMemoryPressure',
1255 '*ManagedOOMSwap',
1256 'ManagedOOMMemoryPressureLimit',
1257 {
1258 'type' => 'leaf',
1259 'value_type' => 'uniline'
1260 },
1261 'ManagedOOMMemoryPressureDurationSec',
1262 '*ManagedOOMMemoryPressureLimit',
1263 'ManagedOOMPreference',
1264 {
1265 'choice' => [
1266 'avoid',
1267 'none',
1268 'omit'
1269 ],
1270 'type' => 'leaf',
1271 'value_type' => 'enum'
1272 },
1273 'OOMRules',
1274 {
1275 'type' => 'leaf',
1276 'value_type' => 'uniline'
1277 },
1278 'MemoryPressureWatch',
1279 {
1280 'choice' => [
1281 'auto',
1282 'no',
1283 'skip',
1284 'yes'
1285 ],
1286 'replace' => {
1287 '0' => 'no',
1288 '1' => 'yes',
1289 'false' => 'no',
1290 'true' => 'yes'
1291 },
1292 'type' => 'leaf',
1293 'value_type' => 'enum'
1294 },
1295 'MemoryPressureThresholdSec',
1296 {
1297 'type' => 'leaf',
1298 'value_type' => 'uniline'
1299 },
1300 'CPUPressureWatch',
1301 {
1302 'choice' => [
1303 'auto',
1304 'no',
1305 'skip',
1306 'yes'
1307 ],
1308 'replace' => {
1309 '0' => 'no',
1310 '1' => 'yes',
1311 'false' => 'no',
1312 'true' => 'yes'
1313 },
1314 'type' => 'leaf',
1315 'value_type' => 'enum'
1316 },
1317 'CPUPressureThresholdSec',
1318 {
1319 'type' => 'leaf',
1320 'value_type' => 'uniline'
1321 },
1322 'IOPressureWatch',
1323 {
1324 'choice' => [
1325 'auto',
1326 'no',
1327 'skip',
1328 'yes'
1329 ],
1330 'replace' => {
1331 '0' => 'no',
1332 '1' => 'yes',
1333 'false' => 'no',
1334 'true' => 'yes'
1335 },
1336 'type' => 'leaf',
1337 'value_type' => 'enum'
1338 },
1339 'IOPressureThresholdSec',
1340 {
1341 'type' => 'leaf',
1342 'value_type' => 'uniline'
1343 },
1344 'CoredumpReceive',
1345 {
1346 'type' => 'leaf',
1347 'upstream_default' => 'no',
1348 'value_type' => 'boolean',
1349 'write_as' => [
1350 'no',
1351 'yes'
1352 ]
1353 }
1354 ],
1355 'generated_by' => 'parse-man.pl from systemd 261 doc',
1356 'license' => 'LGPLv2.1+',
1357 'name' => 'Systemd::Common::ResourceControl'
1358 }
1359 ]
1360 ;
« models/Systemd/Common/Kill.pl ↑ Summary models/Systemd/Section/Install.pl »