Debian Codegraph @

man/systemd.resource-control.xml

raw
1 <?xml version='1.0'?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
5
6 <refentry id="systemd.resource-control" xmlns:xi="http://www.w3.org/2001/XInclude">
7 <refentryinfo>
8 <title>systemd.resource-control</title>
9 <productname>systemd</productname>
10 </refentryinfo>
11
12 <refmeta>
13 <refentrytitle>systemd.resource-control</refentrytitle>
14 <manvolnum>5</manvolnum>
15 </refmeta>
16
17 <refnamediv>
18 <refname>systemd.resource-control</refname>
19 <refpurpose>Resource control unit settings</refpurpose>
20 </refnamediv>
21
22 <refsynopsisdiv>
23 <para>
24 <filename><replaceable>slice</replaceable>.slice</filename>,
25 <filename><replaceable>scope</replaceable>.scope</filename>,
26 <filename><replaceable>service</replaceable>.service</filename>,
27 <filename><replaceable>socket</replaceable>.socket</filename>,
28 <filename><replaceable>mount</replaceable>.mount</filename>,
29 <filename><replaceable>swap</replaceable>.swap</filename>
30 </para>
31 </refsynopsisdiv>
32
33 <refsect1>
34 <title>Description</title>
35
36 <para>Unit configuration files for services, slices, scopes, sockets, mount points, and swap devices share a subset
37 of configuration options for resource control of spawned processes. Internally, this relies on the Linux Control
38 Groups (cgroups) kernel concept for organizing processes in a hierarchical tree of named groups for the purpose of
39 resource management.</para>
40
41 <para>This man page lists the configuration options shared by
42 those six unit types. See
43 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
44 for the common options of all unit configuration files, and
45 <citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
46 <citerefentry><refentrytitle>systemd.scope</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
47 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
48 <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
49 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
50 and
51 <citerefentry><refentrytitle>systemd.swap</refentrytitle><manvolnum>5</manvolnum></citerefentry>
52 for more information on the specific unit configuration files. The
53 resource control configuration options are configured in the
54 [Slice], [Scope], [Service], [Socket], [Mount], or [Swap]
55 sections, depending on the unit type.</para>
56
57 <para>In addition, options which control resources available to programs
58 <emphasis>executed</emphasis> by systemd are listed in
59 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
60 Those options complement options listed here.</para>
61
62 <refsect2>
63 <title>Enabling and disabling controllers</title>
64
65 <para>Controllers in the cgroup hierarchy are hierarchical, and resource control is realized by
66 distributing resource assignments between siblings in branches of the cgroup hierarchy. There is no
67 need to explicitly <emphasis>enable</emphasis> a cgroup controller for a unit.
68 <command>systemd</command> will instruct the kernel to enable a controller for a given unit when this
69 unit has configuration for a given controller. For example, when <varname>CPUWeight=</varname> is set,
70 the <option>cpu</option> controller will be enabled, and when <varname>TasksMax=</varname> are set, the
71 <option>pids</option> controller will be enabled. In addition, various controllers may be also be
72 enabled explicitly via the
73 <varname>MemoryAccounting=</varname>/<varname>TasksAccounting=</varname>/<varname>IOAccounting=</varname>
74 settings. Because of how the cgroup hierarchy works, controllers will be automatically enabled for all
75 parent units and for any sibling units starting with the lowest level at which a controller is enabled.
76 Units for which a controller is enabled may be subject to resource control even if they do not have any
77 explicit configuration.</para>
78
79 <para>Setting <varname>Delegate=</varname> enables any delegated controllers for that unit (see below).
80 The delegatee may then enable controllers for its children as appropriate. In particular, if the
81 delegatee is <command>systemd</command> (in the <filename>[email protected]</filename> unit), it will
82 repeat the same logic as the system instance and enable controllers for user units which have resource
83 limits configured, and their siblings and parents and parents' siblings.</para>
84
85 <para>Controllers may be <emphasis>disabled</emphasis> for parts of the cgroup hierarchy with
86 <varname>DisableControllers=</varname> (see below).</para>
87
88 <example>
89 <title>Enabling and disabling controllers</title>
90
91 <programlisting>
92 -.slice
93 / \
94 /-----/ \--------------\
95 / \
96 system.slice user.slice
97 / \ / \
98 / \ / \
99 / \ [email protected] [email protected]
100 / \ Delegate= Delegate=yes
101 a.service b.slice / \
102 CPUWeight=20 DisableControllers=cpu / \
103 / \ app.slice session.slice
104 / \ CPUWeight=100 CPUWeight=100
105 / \
106 b1.service b2.service
107 CPUWeight=1000
108 </programlisting>
109
110 <para>In this hierarchy, the <option>cpu</option> controller is enabled for all units shown except
111 <filename>b1.service</filename> and <filename>b2.service</filename>. Because there is no explicit
112 configuration for <filename>system.slice</filename> and <filename>user.slice</filename>, CPU
113 resources will be split equally between them. Similarly, resources are allocated equally between
114 children of <filename>user.slice</filename> and between the child slices beneath
115 <filename>[email protected]</filename>. Assuming that there is no further configuration of resources
116 or delegation below slices <filename>app.slice</filename> or <filename>session.slice</filename>, the
117 <option>cpu</option> controller would not be enabled for units in those slices and CPU resources
118 would be further allocated using other mechanisms, e.g. based on nice levels. The manager for user
119 42 has delegation enabled without any controllers, i.e. it can manipulate its subtree of the cgroup
120 hierarchy, but without resource control.</para>
121
122 <para>In the slice <filename>system.slice</filename>, CPU resources are split 1:6 for service
123 <filename>a.service</filename>, and 5:6 for slice <filename>b.slice</filename>, because slice
124 <filename>b.slice</filename> gets the default value of 100 for <filename>cpu.weight</filename> when
125 <varname>CPUWeight=</varname> is not set.</para>
126
127 <para><varname>CPUWeight=</varname> setting in service <filename>b2.service</filename> is neutralized
128 by <varname>DisableControllers=</varname> in slice <filename>b.slice</filename>, so the
129 <option>cpu</option> controller would not be enabled for services <filename>b1.service</filename> and
130 <filename>b2.service</filename>, and CPU resources would be further allocated using other mechanisms,
131 e.g. based on nice levels.</para>
132 </example>
133 </refsect2>
134
135 <refsect2>
136 <title>Setting resource controls for a group of related units</title>
137
138 <para>As described in
139 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>, the
140 settings listed here may be set through the main file of a unit and drop-in snippets in
141 <filename index="false">*.d/</filename> directories. The list of directories searched for drop-ins
142 includes names formed by repeatedly truncating the unit name after all dashes. This is particularly
143 convenient to set resource limits for a group of units with similar names.</para>
144
145 <para>For example, every user gets their own slice
146 <filename>user-<replaceable>nnn</replaceable>.slice</filename>. Drop-ins with local configuration that
147 affect user 1000 may be placed in
148 <filename index="false">/etc/systemd/system/user-1000.slice</filename>,
149 <filename index="false">/etc/systemd/system/user-1000.slice.d/*.conf</filename>, but also
150 <filename index="false">/etc/systemd/system/user-.slice.d/*.conf</filename>. This last directory
151 applies to all user slices.</para>
152 </refsect2>
153
154 <refsect2>
155 <title/>
156 <para>See the <ulink
157 url="https://systemd.io/CONTROL_GROUP_INTERFACE">New
158 Control Group Interfaces</ulink> for an introduction on how to make
159 use of resource control APIs from programs.</para>
160 </refsect2>
161 </refsect1>
162
163 <refsect1>
164 <title>Implicit Dependencies</title>
165
166 <para>The following dependencies are implicitly added:</para>
167
168 <itemizedlist>
169 <listitem><para>Units with the <varname>Slice=</varname> setting set automatically acquire
170 <varname>Requires=</varname> and <varname>After=</varname> dependencies on the specified
171 slice unit.</para></listitem>
172 </itemizedlist>
173 </refsect1>
174
175 <!-- We do not have any default dependency here. -->
176
177 <refsect1>
178 <title>Options</title>
179
180 <para>Units of the types listed above can have settings for resource control configuration:</para>
181
182 <refsect2><title>CPU Control</title>
183
184 <variablelist class='unit-directives'>
185
186 <varlistentry>
187 <term><varname>CPUWeight=<replaceable>weight</replaceable></varname></term>
188 <term><varname>StartupCPUWeight=<replaceable>weight</replaceable></varname></term>
189
190 <listitem>
191 <para>These settings control the <option>cpu</option> controller in the unified hierarchy.</para>
192
193 <para>These options accept an integer value or the special string "idle":</para>
194 <itemizedlist>
195 <listitem>
196 <para>If set to an integer value, assign the specified CPU time weight to the processes
197 executed, if the unified control group hierarchy is used on the system. These options control
198 the <literal>cpu.weight</literal> control group attribute. The allowed range is 1 to 10000.
199 Defaults to unset, but the kernel default is 100. For details about this control group
200 attribute, see <ulink url="https://docs.kernel.org/admin-guide/cgroup-v2.html">Control Groups
201 v2</ulink> and <ulink url="https://docs.kernel.org/scheduler/sched-design-CFS.html">CFS
202 Scheduler</ulink>. The available CPU time is split up among all units within one slice
203 relative to their CPU time weight. A higher weight means more CPU time, a lower weight means
204 less.</para>
205 </listitem>
206 <listitem>
207 <para>If set to the special string "idle", mark the cgroup for "idle scheduling", which means
208 that it will get CPU resources only when there are no processes not marked in this way to execute in this
209 cgroup or its siblings. This setting corresponds to the <literal>cpu.idle</literal> cgroup attribute.</para>
210
211 <para>Note that this value only has an effect on cgroup-v2, for cgroup-v1 it is equivalent to the minimum weight.</para>
212 </listitem>
213 </itemizedlist>
214
215 <para>While <varname>StartupCPUWeight=</varname> applies to the startup and shutdown phases of the system,
216 <varname>CPUWeight=</varname> applies to normal runtime of the system, and if the former is not set also to
217 the startup and shutdown phases. Using <varname>StartupCPUWeight=</varname> allows prioritizing specific services at
218 boot-up and shutdown differently than during normal runtime.</para>
219
220 <para>In addition to the resource allocation performed by the <option>cpu</option> controller, the
221 kernel may automatically divide resources based on session-id grouping, see "The autogroup feature"
222 in <citerefentry
223 project='man-pages'><refentrytitle>sched</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
224 The effect of this feature is similar to the <option>cpu</option> controller with no explicit
225 configuration, so users should be careful to not mistake one for the other.</para>
226
227 <xi:include href="version-info.xml" xpointer="v232"/>
228 </listitem>
229 </varlistentry>
230
231 <varlistentry>
232 <term><varname>CPUQuota=</varname></term>
233
234 <listitem>
235 <para>This setting controls the <option>cpu</option> controller in the unified hierarchy.</para>
236
237 <para>Assign the specified CPU time quota to the processes executed. Takes a percentage value, suffixed with
238 "%". The percentage specifies how much CPU time the unit shall get at maximum, relative to the total CPU time
239 available on one CPU. Use values &gt; 100% for allotting CPU time on more than one CPU. This controls the
240 <literal>cpu.max</literal> attribute on the unified control group hierarchy and
241 <literal>cpu.cfs_quota_us</literal> on legacy. For details about these control group attributes, see <ulink
242 url="https://docs.kernel.org/admin-guide/cgroup-v2.html">Control Groups v2</ulink> and <ulink
243 url="https://docs.kernel.org/scheduler/sched-bwc.html">CFS Bandwidth Control</ulink>.
244 Setting <varname>CPUQuota=</varname> to an empty value unsets the quota.</para>
245
246 <para>Example: <varname>CPUQuota=20%</varname> ensures that the executed processes will never get more than
247 20% CPU time on one CPU.</para>
248
249 <xi:include href="version-info.xml" xpointer="v213"/>
250
251 </listitem>
252 </varlistentry>
253
254 <varlistentry>
255 <term><varname>CPUQuotaPeriodSec=</varname></term>
256
257 <listitem>
258 <para>This setting controls the <option>cpu</option> controller in the unified hierarchy.</para>
259
260 <para>Assign the duration over which the CPU time quota specified by <varname>CPUQuota=</varname> is measured.
261 Takes a time duration value in seconds, with an optional suffix such as "ms" for milliseconds (or "s" for seconds.)
262 The default setting is 100ms. The period is clamped to the range supported by the kernel, which is [1ms, 1000ms].
263 Additionally, the period is adjusted up so that the quota interval is also at least 1ms.
264 Setting <varname>CPUQuotaPeriodSec=</varname> to an empty value resets it to the default.</para>
265
266 <para>This controls the second field of <literal>cpu.max</literal> attribute on the unified control group hierarchy
267 and <literal>cpu.cfs_period_us</literal> on legacy. For details about these control group attributes, see
268 <ulink url="https://docs.kernel.org/admin-guide/cgroup-v2.html">Control Groups v2</ulink> and
269 <ulink url="https://docs.kernel.org/scheduler/sched-design-CFS.html">CFS Scheduler</ulink>.</para>
270
271 <para>Example: <varname>CPUQuotaPeriodSec=10ms</varname> to request that the CPU quota is measured in periods of 10ms.</para>
272
273 <xi:include href="version-info.xml" xpointer="v242"/>
274 </listitem>
275 </varlistentry>
276
277 <varlistentry>
278 <term><varname>AllowedCPUs=</varname></term>
279 <term><varname>StartupAllowedCPUs=</varname></term>
280
281 <listitem>
282 <para>This setting controls the <option>cpuset</option> controller in the unified hierarchy.</para>
283
284 <para>Restrict processes to be executed on specific CPUs. Takes a list of CPU indices or ranges separated by either
285 whitespace or commas. CPU ranges are specified by the lower and upper CPU indices separated by a dash.</para>
286
287 <para>Setting <varname>AllowedCPUs=</varname> or <varname>StartupAllowedCPUs=</varname> does not guarantee that all
288 of the CPUs will be used by the processes as it may be limited by parent units. The effective configuration is
289 reported as <varname>EffectiveCPUs=</varname>.</para>
290
291 <para>While <varname>StartupAllowedCPUs=</varname> applies to the startup and shutdown phases of the system,
292 <varname>AllowedCPUs=</varname> applies to normal runtime of the system, and if the former is not set also to
293 the startup and shutdown phases. Using <varname>StartupAllowedCPUs=</varname> allows prioritizing specific services at
294 boot-up and shutdown differently than during normal runtime.</para>
295
296 <para>This setting is supported only with the unified control group hierarchy.</para>
297
298 <xi:include href="version-info.xml" xpointer="v244"/>
299 </listitem>
300 </varlistentry>
301
302 </variablelist>
303
304 </refsect2><refsect2><title>Memory Accounting and Control</title>
305
306 <variablelist class='unit-directives'>
307
308 <varlistentry>
309 <term><varname>MemoryAccounting=</varname></term>
310
311 <listitem>
312 <para>This setting controls the <option>memory</option> controller in the unified hierarchy.</para>
313
314 <para>Turn on process and kernel memory accounting for this
315 unit. Takes a boolean argument. Note that turning on memory
316 accounting for one unit will also implicitly turn it on for
317 all units contained in the same slice and for all its parent
318 slices and the units contained therein. The system default
319 for this setting may be controlled with
320 <varname>DefaultMemoryAccounting=</varname> in
321 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
322
323 <xi:include href="version-info.xml" xpointer="v208"/>
324 </listitem>
325 </varlistentry>
326
327 <varlistentry>
328 <term><varname>MemoryMin=<replaceable>bytes</replaceable></varname>, <varname>MemoryLow=<replaceable>bytes</replaceable></varname></term>
329 <term><varname>StartupMemoryLow=<replaceable>bytes</replaceable></varname></term>
330
331 <listitem>
332 <para>These settings control the <option>memory</option> controller in the unified hierarchy.</para>
333
334 <para>Specify the memory usage protection of the executed processes in this unit.
335 When reclaiming memory, the unit is treated as if it was using less memory resulting in memory
336 to be preferentially reclaimed from unprotected units.
337 Using <varname>MemoryLow=</varname> results in a weaker protection where memory may still
338 be reclaimed to avoid invoking the OOM killer in case there is no other reclaimable memory.</para>
339 <para>
340 For a protection to be effective, it is generally required to set a corresponding
341 allocation on all ancestors, which is then distributed between children
342 (with the exception of the root slice).
343 Any <varname>MemoryMin=</varname> or <varname>MemoryLow=</varname> allocation that is not
344 explicitly distributed to specific children is used to create a shared protection for all children.
345 As this is a shared protection, the children will freely compete for the memory.</para>
346
347 <para>Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is
348 parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a
349 percentage value may be specified, which is taken relative to the installed physical memory on the
350 system. If assigned the special value <literal>infinity</literal>, all available memory is protected, which may be
351 useful in order to always inherit all of the protection afforded by ancestors.
352 This controls the <literal>memory.min</literal> or <literal>memory.low</literal> control group attribute.
353 For details about this control group attribute, see <ulink
354 url="https://docs.kernel.org/admin-guide/cgroup-v2.html#memory-interface-files">Memory Interface Files</ulink>.</para>
355
356 <para>While <varname>StartupMemoryLow=</varname> applies to the startup and shutdown phases of the system,
357 <varname>MemoryMin=</varname> applies to normal runtime of the system, and if the former is not set also to
358 the startup and shutdown phases. Using <varname>StartupMemoryLow=</varname> allows prioritizing specific services at
359 boot-up and shutdown differently than during normal runtime.</para>
360
361 <xi:include href="version-info.xml" xpointer="v240"/>
362 </listitem>
363 </varlistentry>
364
365 <varlistentry>
366 <term><varname>MemoryHigh=<replaceable>bytes</replaceable></varname></term>
367 <term><varname>StartupMemoryHigh=<replaceable>bytes</replaceable></varname></term>
368
369 <listitem>
370 <para>These settings control the <option>memory</option> controller in the unified hierarchy.</para>
371
372 <para>Specify the throttling limit on memory usage of the executed processes in this unit. Memory usage may go
373 above the limit if unavoidable, but the processes are heavily slowed down and memory is taken away
374 aggressively in such cases. This is the main mechanism to control memory usage of a unit.</para>
375
376 <para>Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is
377 parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a
378 percentage value may be specified, which is taken relative to the installed physical memory on the
379 system. If assigned the
380 special value <literal>infinity</literal>, no memory throttling is applied. This controls the
381 <literal>memory.high</literal> control group attribute. For details about this control group attribute, see
382 <ulink url="https://docs.kernel.org/admin-guide/cgroup-v2.html#memory-interface-files">Memory Interface Files</ulink>.
383 The effective configuration is reported as <varname>EffectiveMemoryHigh=</varname>
384 (see also <varname>EffectiveMemoryMax=</varname>).</para>
385
386 <para>While <varname>StartupMemoryHigh=</varname> applies to the startup and shutdown phases of the system,
387 <varname>MemoryHigh=</varname> applies to normal runtime of the system, and if the former is not set also to
388 the startup and shutdown phases. Using <varname>StartupMemoryHigh=</varname> allows prioritizing specific services at
389 boot-up and shutdown differently than during normal runtime.</para>
390
391 <xi:include href="version-info.xml" xpointer="v231"/>
392 </listitem>
393 </varlistentry>
394
395 <varlistentry>
396 <term><varname>MemoryMax=<replaceable>bytes</replaceable></varname></term>
397 <term><varname>StartupMemoryMax=<replaceable>bytes</replaceable></varname></term>
398
399 <listitem>
400 <para>These settings control the <option>memory</option> controller in the unified hierarchy.</para>
401
402 <para>Specify the absolute limit on memory usage of the executed processes in this unit. If memory usage
403 cannot be contained under the limit, out-of-memory killer is invoked inside the unit. It is recommended to
404 use <varname>MemoryHigh=</varname> as the main control mechanism and use <varname>MemoryMax=</varname> as the
405 last line of defense.</para>
406
407 <para>Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is
408 parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a
409 percentage value may be specified, which is taken relative to the installed physical memory on the system. If
410 assigned the special value <literal>infinity</literal>, no memory limit is applied. This controls the
411 <literal>memory.max</literal> control group attribute. For details about this control group attribute, see
412 <ulink url="https://docs.kernel.org/admin-guide/cgroup-v2.html#memory-interface-files">Memory Interface Files</ulink>.
413 The effective configuration is reported as <varname>EffectiveMemoryMax=</varname> (the value is
414 the most stringent limit of the unit and parent slices and it is capped by physical memory).</para>
415
416 <para>While <varname>StartupMemoryMax=</varname> applies to the startup and shutdown phases of the system,
417 <varname>MemoryMax=</varname> applies to normal runtime of the system, and if the former is not set also to
418 the startup and shutdown phases. Using <varname>StartupMemoryMax=</varname> allows prioritizing specific services at
419 boot-up and shutdown differently than during normal runtime.</para>
420
421 <xi:include href="version-info.xml" xpointer="v231"/>
422 </listitem>
423 </varlistentry>
424
425 <varlistentry>
426 <term><varname>MemorySwapMax=<replaceable>bytes</replaceable></varname></term>
427 <term><varname>StartupMemorySwapMax=<replaceable>bytes</replaceable></varname></term>
428
429 <listitem>
430 <para>These settings control the <option>memory</option> controller in the unified hierarchy.</para>
431
432 <para>Specify the absolute limit on swap usage of the executed processes in this unit.</para>
433
434 <para>Takes a swap size in bytes. If the value is suffixed with K, M, G or T, the specified swap size is
435 parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a
436 percentage value may be specified, which is taken relative to the specified swap size on the system. If assigned the
437 special value <literal>infinity</literal>, no swap limit is applied. These settings control the
438 <literal>memory.swap.max</literal> control group attribute. For details about this control group attribute,
439 see <ulink url="https://docs.kernel.org/admin-guide/cgroup-v2.html#memory-interface-files">Memory Interface Files</ulink>.</para>
440
441 <para>While <varname>StartupMemorySwapMax=</varname> applies to the startup and shutdown phases of the system,
442 <varname>MemorySwapMax=</varname> applies to normal runtime of the system, and if the former is not set also to
443 the startup and shutdown phases. Using <varname>StartupMemorySwapMax=</varname> allows prioritizing specific services at
444 boot-up and shutdown differently than during normal runtime.</para>
445
446 <xi:include href="version-info.xml" xpointer="v232"/>
447 </listitem>
448 </varlistentry>
449
450 <varlistentry>
451 <term><varname>MemoryZSwapMax=<replaceable>bytes</replaceable></varname></term>
452 <term><varname>StartupMemoryZSwapMax=<replaceable>bytes</replaceable></varname></term>
453
454 <listitem>
455 <para>These settings control the <option>memory</option> controller in the unified hierarchy.</para>
456
457 <para>Specify the absolute limit on zswap usage of the processes in this unit. Zswap is a lightweight compressed
458 cache for swap pages. It takes pages that are in the process of being swapped out and attempts to compress them into a
459 dynamically allocated RAM-based memory pool. If the limit specified is hit, no entries from this unit will be
460 stored in the pool until existing entries are faulted back or written out to disk. See the kernel's
461 <ulink url="https://docs.kernel.org/admin-guide/mm/zswap.html">Zswap</ulink> documentation for more details.</para>
462
463 <para>Takes a size in bytes. If the value is suffixed with K, M, G or T, the specified size is
464 parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. If assigned the
465 special value <literal>infinity</literal>, no limit is applied. These settings control the
466 <literal>memory.zswap.max</literal> control group attribute. For details about this control group attribute,
467 see <ulink url="https://docs.kernel.org/admin-guide/cgroup-v2.html#memory-interface-files">Memory Interface Files</ulink>.</para>
468
469 <para>While <varname>StartupMemoryZSwapMax=</varname> applies to the startup and shutdown phases of the system,
470 <varname>MemoryZSwapMax=</varname> applies to normal runtime of the system, and if the former is not set also to
471 the startup and shutdown phases. Using <varname>StartupMemoryZSwapMax=</varname> allows prioritizing specific services at
472 boot-up and shutdown differently than during normal runtime.</para>
473
474 <xi:include href="version-info.xml" xpointer="v253"/>
475 </listitem>
476 </varlistentry>
477
478 <varlistentry>
479 <term><varname>MemoryZSwapWriteback=</varname></term>
480
481 <listitem>
482 <para>This setting controls the <option>memory</option> controller in the unified hierarchy.</para>
483
484 <para>Takes a boolean argument. Defaults to true if <varname>DefaultMemoryZSwapWriteback=</varname>
485 is not set. When true, pages stored in the Zswap cache are permitted to be
486 written to the backing storage, false otherwise. This allows disabling writeback of swap pages for
487 IO-intensive applications, while retaining the ability to store compressed pages in Zswap. See the kernel's
488 <ulink url="https://docs.kernel.org/admin-guide/mm/zswap.html">Zswap</ulink> documentation
489 for more details.</para>
490
491 <para>The system default for this setting may be controlled with <varname>DefaultMemoryZSwapWriteback=</varname>
492 in <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
493
494 <xi:include href="version-info.xml" xpointer="v256"/>
495 </listitem>
496 </varlistentry>
497
498 <varlistentry>
499 <term><varname>AllowedMemoryNodes=</varname></term>
500 <term><varname>StartupAllowedMemoryNodes=</varname></term>
501
502 <listitem>
503 <para>These settings control the <option>cpuset</option> controller in the unified hierarchy.</para>
504
505 <para>Restrict processes to be executed on specific memory NUMA nodes. Takes a list of memory NUMA nodes indices
506 or ranges separated by either whitespace or commas. Memory NUMA nodes ranges are specified by the lower and upper
507 NUMA nodes indices separated by a dash.</para>
508
509 <para>Setting <varname>AllowedMemoryNodes=</varname> or <varname>StartupAllowedMemoryNodes=</varname> does not
510 guarantee that all of the memory NUMA nodes will be used by the processes as it may be limited by parent units.
511 The effective configuration is reported as <varname>EffectiveMemoryNodes=</varname>.</para>
512
513 <para>While <varname>StartupAllowedMemoryNodes=</varname> applies to the startup and shutdown phases of the system,
514 <varname>AllowedMemoryNodes=</varname> applies to normal runtime of the system, and if the former is not set also to
515 the startup and shutdown phases. Using <varname>StartupAllowedMemoryNodes=</varname> allows prioritizing specific services at
516 boot-up and shutdown differently than during normal runtime.</para>
517
518 <para>This setting is supported only with the unified control group hierarchy.</para>
519
520 <xi:include href="version-info.xml" xpointer="v244"/>
521 </listitem>
522 </varlistentry>
523
524 <varlistentry>
525 <term><varname>CPUSetPartition=</varname></term>
526
527 <listitem>
528 <para>Sets the <option>cpuset</option> partition type for the executed processes. Takes one
529 of <literal>member</literal>, <literal>root</literal>, or <literal>isolated</literal>. This setting
530 controls the <literal>cpuset.cpus.partition</literal> cgroup attribute.</para>
531
532 <para>When set to <literal>member</literal>, the cpuset operates in normal mode.
533 <literal>root</literal> creates a partition root, which can further divide CPUs among child cgroups.
534 <literal>isolated</literal> provides full CPU isolation, useful for real-time workloads that
535 require dedicated CPU resources without interference from other processes.
536 Defaults to the kernel default, which is <literal>member</literal>. For more details about this
537 control group attribute, see <ulink url="https://docs.kernel.org/admin-guide/cgroup-v2.html">
538 Control Groups v2</ulink>.</para>
539
540 <para>This setting requires <varname>AllowedCPUs=</varname> to also be set.</para>
541
542 <xi:include href="version-info.xml" xpointer="v261"/>
543 </listitem>
544 </varlistentry>
545
546 </variablelist>
547
548 </refsect2><refsect2><title>Process Accounting and Control</title>
549
550 <variablelist class='unit-directives'>
551
552 <varlistentry>
553 <term><varname>TasksAccounting=</varname></term>
554
555 <listitem>
556 <para>This setting controls the <option>pids</option> controller in the unified hierarchy.</para>
557
558 <para>Turn on task accounting for this unit. Takes a boolean argument. If enabled, the kernel will
559 keep track of the total number of tasks in the unit and its children. This number includes both
560 kernel threads and userspace processes, with each thread counted individually. Note that turning on
561 tasks accounting for one unit will also implicitly turn it on for all units contained in the same
562 slice and for all its parent slices and the units contained therein. The system default for this
563 setting may be controlled with <varname>DefaultTasksAccounting=</varname> in
564 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
565
566 <xi:include href="version-info.xml" xpointer="v227"/>
567 </listitem>
568 </varlistentry>
569
570 <varlistentry>
571 <term><varname>TasksMax=<replaceable>N</replaceable></varname></term>
572
573 <listitem>
574 <para>This setting controls the <option>pids</option> controller in the unified hierarchy.</para>
575
576 <para>Specify the maximum number of tasks that may be created in the unit. This ensures that the
577 number of tasks accounted for the unit (see above) stays below a specific limit. This either takes
578 an absolute number of tasks or a percentage value that is taken relative to the configured maximum
579 number of tasks on the system. If assigned the special value <literal>infinity</literal>, no tasks
580 limit is applied. This controls the <literal>pids.max</literal> control group attribute. For
581 details about this control group attribute, see the
582 <ulink url="https://docs.kernel.org/admin-guide/cgroup-v2.html#pid">pids controller
583 </ulink>.
584 The effective configuration is reported as <varname>EffectiveTasksMax=</varname>.</para>
585
586 <para>The system default for this setting may be controlled with
587 <varname>DefaultTasksMax=</varname> in
588 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
589
590 <xi:include href="version-info.xml" xpointer="v227"/>
591 </listitem>
592 </varlistentry>
593
594 </variablelist>
595
596 </refsect2><refsect2><title>IO Accounting and Control</title>
597
598 <variablelist class='unit-directives'>
599
600 <varlistentry>
601 <term><varname>IOAccounting=</varname></term>
602
603 <listitem>
604 <para>This setting controls the <option>io</option> controller in the unified hierarchy.</para>
605
606 <para>Turn on Block I/O accounting for this unit, if the unified control group hierarchy is used on the
607 system. Takes a boolean argument. Note that turning on block I/O accounting for one unit will also implicitly
608 turn it on for all units contained in the same slice and all for its parent slices and the units contained
609 therein. The system default for this setting may be controlled with <varname>DefaultIOAccounting=</varname>
610 in
611 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
612
613 <xi:include href="version-info.xml" xpointer="v230"/>
614 </listitem>
615 </varlistentry>
616
617 <varlistentry>
618 <term><varname>IOWeight=<replaceable>weight</replaceable></varname></term>
619 <term><varname>StartupIOWeight=<replaceable>weight</replaceable></varname></term>
620
621 <listitem>
622 <para>These settings control the <option>io</option> controller in the unified hierarchy.</para>
623
624 <para>Set the default overall block I/O weight for the executed processes, if the unified control
625 group hierarchy is used on the system. Takes a single weight value (between 1 and 10000) to set the
626 default block I/O weight. This controls the <literal>io.weight</literal> control group attribute,
627 which defaults to 100. For details about this control group attribute, see <ulink
628 url="https://docs.kernel.org/admin-guide/cgroup-v2.html#io-interface-files">IO
629 Interface Files</ulink>. The available I/O bandwidth is split up among all units within one slice
630 relative to their block I/O weight. A higher weight means more I/O bandwidth, a lower weight means
631 less.</para>
632
633 <para>While <varname>StartupIOWeight=</varname> applies
634 to the startup and shutdown phases of the system,
635 <varname>IOWeight=</varname> applies to the later runtime of
636 the system, and if the former is not set also to the startup
637 and shutdown phases. This allows prioritizing specific services at boot-up
638 and shutdown differently than during runtime.</para>
639
640 <xi:include href="version-info.xml" xpointer="v230"/>
641 </listitem>
642 </varlistentry>
643
644 <varlistentry>
645 <term><varname>IODeviceWeight=<replaceable>device</replaceable> <replaceable>weight</replaceable></varname></term>
646
647 <listitem>
648 <para>This setting controls the <option>io</option> controller in the unified hierarchy.</para>
649
650 <para>Set the per-device overall block I/O weight for the executed processes, if the unified control group
651 hierarchy is used on the system. Takes a space-separated pair of a file path and a weight value to specify
652 the device specific weight value, between 1 and 10000. (Example: <literal>/dev/sda 1000</literal>). The file
653 path may be specified as path to a block device node or as any other file, in which case the backing block
654 device of the file system of the file is determined. This controls the <literal>io.weight</literal> control
655 group attribute, which defaults to 100. Use this option multiple times to set weights for multiple devices.
656 For details about this control group attribute, see <ulink
657 url="https://docs.kernel.org/admin-guide/cgroup-v2.html#io-interface-files">IO Interface Files</ulink>.</para>
658
659 <para>The specified device node should reference a block device that has an I/O scheduler
660 associated, i.e. should not refer to partition or loopback block devices, but to the originating,
661 physical device. When a path to a regular file or directory is specified it is attempted to
662 discover the correct originating device backing the file system of the specified path. This works
663 correctly only for simpler cases, where the file system is directly placed on a partition or
664 physical block device, or where simple 1:1 encryption using dm-crypt/LUKS is used. This discovery
665 does not cover complex storage and in particular RAID and volume management storage devices.</para>
666
667 <xi:include href="version-info.xml" xpointer="v230"/>
668 </listitem>
669 </varlistentry>
670
671 <varlistentry>
672 <term><varname>IOReadBandwidthMax=<replaceable>device</replaceable> <replaceable>bytes</replaceable></varname></term>
673 <term><varname>IOWriteBandwidthMax=<replaceable>device</replaceable> <replaceable>bytes</replaceable></varname></term>
674
675 <listitem>
676 <para>These settings control the <option>io</option> controller in the unified hierarchy.</para>
677
678 <para>Set the per-device overall block I/O bandwidth maximum limit for the executed processes, if the unified
679 control group hierarchy is used on the system. This limit is not work-conserving and the executed processes
680 are not allowed to use more even if the device has idle capacity. Takes a space-separated pair of a file
681 path and a bandwidth value (in bytes per second) to specify the device specific bandwidth. The file path may
682 be a path to a block device node, or as any other file in which case the backing block device of the file
683 system of the file is used. If the bandwidth is suffixed with K, M, G, or T, the specified bandwidth is
684 parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes, respectively, to the base of 1000. (Example:
685 "/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 5M"). This controls the <literal>io.max</literal> control
686 group attributes. Use this option multiple times to set bandwidth limits for multiple devices. For details
687 about this control group attribute, see <ulink
688 url="https://docs.kernel.org/admin-guide/cgroup-v2.html#io-interface-files">IO Interface Files</ulink>.
689 </para>
690
691 <para>Similar restrictions on block device discovery as for <varname>IODeviceWeight=</varname> apply, see above.</para>
692
693 <xi:include href="version-info.xml" xpointer="v230"/>
694 </listitem>
695 </varlistentry>
696
697 <varlistentry>
698 <term><varname>IOReadIOPSMax=<replaceable>device</replaceable> <replaceable>IOPS</replaceable></varname></term>
699 <term><varname>IOWriteIOPSMax=<replaceable>device</replaceable> <replaceable>IOPS</replaceable></varname></term>
700
701 <listitem>
702 <para>These settings control the <option>io</option> controller in the unified hierarchy.</para>
703
704 <para>Set the per-device overall block I/O IOs-Per-Second maximum limit for the executed processes, if the
705 unified control group hierarchy is used on the system. This limit is not work-conserving and the executed
706 processes are not allowed to use more even if the device has idle capacity. Takes a space-separated pair of
707 a file path and an IOPS value to specify the device specific IOPS. The file path may be a path to a block
708 device node, or as any other file in which case the backing block device of the file system of the file is
709 used. If the IOPS is suffixed with K, M, G, or T, the specified IOPS is parsed as KiloIOPS, MegaIOPS,
710 GigaIOPS, or TeraIOPS, respectively, to the base of 1000. (Example:
711 "/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 1K"). This controls the <literal>io.max</literal> control
712 group attributes. Use this option multiple times to set IOPS limits for multiple devices. For details about
713 this control group attribute, see <ulink
714 url="https://docs.kernel.org/admin-guide/cgroup-v2.html#io-interface-files">IO Interface Files</ulink>.
715 </para>
716
717 <para>Similar restrictions on block device discovery as for <varname>IODeviceWeight=</varname> apply, see above.</para>
718
719 <xi:include href="version-info.xml" xpointer="v230"/>
720 </listitem>
721 </varlistentry>
722
723 <varlistentry>
724 <term><varname>IODeviceLatencyTargetSec=<replaceable>device</replaceable> <replaceable>target</replaceable></varname></term>
725
726 <listitem>
727 <para>This setting controls the <option>io</option> controller in the unified hierarchy.</para>
728
729 <para>Set the per-device average target I/O latency for the executed processes, if the unified control group
730 hierarchy is used on the system. Takes a file path and a timespan separated by a space to specify
731 the device specific latency target. (Example: "/dev/sda 25ms"). The file path may be specified
732 as path to a block device node or as any other file, in which case the backing block device of the file
733 system of the file is determined. This controls the <literal>io.latency</literal> control group
734 attribute. Use this option multiple times to set latency target for multiple devices. For details about this
735 control group attribute, see <ulink
736 url="https://docs.kernel.org/admin-guide/cgroup-v2.html#io-interface-files">IO Interface Files</ulink>.</para>
737
738 <para>Implies <literal>IOAccounting=yes</literal>.</para>
739
740 <para>These settings are supported only if the unified control group hierarchy is used.</para>
741
742 <para>Similar restrictions on block device discovery as for <varname>IODeviceWeight=</varname> apply, see above.</para>
743
744 <xi:include href="version-info.xml" xpointer="v240"/>
745 </listitem>
746 </varlistentry>
747
748 </variablelist>
749
750 </refsect2><refsect2><title>Network Accounting and Control</title>
751
752 <variablelist class='unit-directives'>
753
754 <varlistentry>
755 <term><varname>IPAccounting=</varname></term>
756
757 <listitem>
758 <para>Takes a boolean argument. If true, turns on IPv4 and IPv6 network traffic accounting for packets sent
759 or received by the unit. When this option is turned on, all IPv4 and IPv6 sockets created by any process of
760 the unit are accounted for.</para>
761
762 <para>When this option is used in socket units, it applies to all IPv4 and IPv6 sockets
763 associated with it (including both listening and connection sockets where this applies). Note that for
764 socket-activated services, this configuration setting and the accounting data of the service unit and the
765 socket unit are kept separate, and displayed separately. No propagation of the setting and the collected
766 statistics is done, in either direction. Moreover, any traffic sent or received on any of the socket unit's
767 sockets is accounted to the socket unit — and never to the service unit it might have activated, even if the
768 socket is used by it.</para>
769
770 <para>The system default for this setting may be controlled with <varname>DefaultIPAccounting=</varname> in
771 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
772
773 <para>Note that this functionality is currently only available for system services, not for
774 per-user services.</para>
775
776 <xi:include href="version-info.xml" xpointer="v235"/>
777 </listitem>
778 </varlistentry>
779
780 <varlistentry>
781 <term><varname>IPAddressAllow=<replaceable>ADDRESS[/PREFIXLENGTH]…</replaceable></varname></term>
782 <term><varname>IPAddressDeny=<replaceable>ADDRESS[/PREFIXLENGTH]…</replaceable></varname></term>
783
784 <listitem>
785 <para>Turn on network traffic filtering for IP packets sent and received over
786 <constant>AF_INET</constant> and <constant>AF_INET6</constant> sockets. Both directives take a
787 space separated list of IPv4 or IPv6 addresses, each optionally suffixed with an address prefix
788 length in bits after a <literal>/</literal> character. If the suffix is omitted, the address is
789 considered a host address, i.e. the filter covers the whole address (32 bits for IPv4, 128 bits for
790 IPv6).</para>
791
792 <para>The access lists configured with this option are applied to all sockets created by processes
793 of this unit (or in the case of socket units, associated with it). The lists are implicitly
794 combined with any lists configured for any of the parent slice units this unit might be a member
795 of. By default, both access lists are empty. Both ingress and egress traffic is filtered by these
796 settings. In case of ingress traffic the source IP address is checked against these access lists,
797 in case of egress traffic the destination IP address is checked. The following rules are applied in
798 turn:</para>
799
800 <itemizedlist>
801 <listitem><para>Access is granted when the checked IP address matches an entry in the
802 <varname>IPAddressAllow=</varname> list.</para></listitem>
803
804 <listitem><para>Otherwise, access is denied when the checked IP address matches an entry in the
805 <varname>IPAddressDeny=</varname> list.</para></listitem>
806
807 <listitem><para>Otherwise, access is granted.</para></listitem>
808 </itemizedlist>
809
810 <para>In order to implement an allow-listing IP firewall, it is recommended to use a
811 <varname>IPAddressDeny=</varname><constant>any</constant> setting on an upper-level slice unit
812 (such as the root slice <filename>-.slice</filename> or the slice containing all system services
813 <filename>system.slice</filename> – see
814 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>
815 for details on these slice units), plus individual per-service <varname>IPAddressAllow=</varname>
816 lines permitting network access to relevant services, and only them.</para>
817
818 <para>Note that for socket-activated services, the IP access list configured on the socket unit
819 applies to all sockets associated with it directly, but not to any sockets created by the
820 ultimately activated services for it. Conversely, the IP access list configured for the service is
821 not applied to any sockets passed into the service via socket activation. Thus, it is usually a
822 good idea to replicate the IP access lists on both the socket and the service unit. Nevertheless,
823 it may make sense to maintain one list more open and the other one more restricted, depending on
824 the use case.</para>
825
826 <para>If these settings are used multiple times in the same unit the specified lists are combined. If an
827 empty string is assigned to these settings the specific access list is reset and all previous settings undone.</para>
828
829 <para>In place of explicit IPv4 or IPv6 address and prefix length specifications a small set of symbolic
830 names may be used. The following names are defined:</para>
831
832 <table>
833 <title>Special address/network names</title>
834
835 <tgroup cols='3'>
836 <colspec colname='name'/>
837 <colspec colname='definition'/>
838 <colspec colname='meaning'/>
839
840 <thead>
841 <row>
842 <entry>Symbolic Name</entry>
843 <entry>Definition</entry>
844 <entry>Meaning</entry>
845 </row>
846 </thead>
847
848 <tbody>
849 <row>
850 <entry><constant>any</constant></entry>
851 <entry>0.0.0.0/0 ::/0</entry>
852 <entry>Any host</entry>
853 </row>
854
855 <row>
856 <entry><constant>localhost</constant></entry>
857 <entry>127.0.0.0/8 ::1/128</entry>
858 <entry>All addresses on the local loopback</entry>
859 </row>
860
861 <row>
862 <entry><constant>link-local</constant></entry>
863 <entry>169.254.0.0/16 fe80::/64</entry>
864 <entry>All link-local IP addresses</entry>
865 </row>
866
867 <row>
868 <entry><constant>multicast</constant></entry>
869 <entry>224.0.0.0/4 ff00::/8</entry>
870 <entry>All IP multicasting addresses</entry>
871 </row>
872 </tbody>
873 </tgroup>
874 </table>
875
876 <para>Note that these settings might not be supported on some systems (for example if eBPF control group
877 support is not enabled in the underlying kernel or container manager). These settings will have no effect in
878 that case. If compatibility with such systems is desired it is hence recommended to not exclusively rely on
879 them for IP security.</para>
880
881 <xi:include href="cgroup-sandboxing.xml" xpointer="singular"/>
882
883 <xi:include href="version-info.xml" xpointer="v235"/>
884 </listitem>
885 </varlistentry>
886
887 <varlistentry>
888 <term><varname>SocketBindAllow=<replaceable>bind-rule</replaceable></varname></term>
889 <term><varname>SocketBindDeny=<replaceable>bind-rule</replaceable></varname></term>
890
891 <listitem>
892 <para>Configures restrictions on the ability of unit processes to invoke <citerefentry
893 project='man-pages'><refentrytitle>bind</refentrytitle><manvolnum>2</manvolnum></citerefentry> on a
894 socket. Both allow and deny rules to be defined that restrict which addresses a socket may be bound
895 to.</para>
896
897 <para><replaceable>bind-rule</replaceable> describes socket properties such as <replaceable>address-family</replaceable>,
898 <replaceable>transport-protocol</replaceable> and <replaceable>ip-ports</replaceable>.</para>
899
900 <para><replaceable>bind-rule</replaceable> :=
901 { [<replaceable>address-family</replaceable><constant>:</constant>][<replaceable>transport-protocol</replaceable><constant>:</constant>][<replaceable>ip-ports</replaceable>] | <constant>any</constant> }</para>
902
903 <para><replaceable>address-family</replaceable> := { <constant>ipv4</constant> | <constant>ipv6</constant> }</para>
904
905 <para><replaceable>transport-protocol</replaceable> := { <constant>tcp</constant> | <constant>udp</constant> }</para>
906
907 <para><replaceable>ip-ports</replaceable> := { <replaceable>ip-port</replaceable> | <replaceable>ip-port-range</replaceable> }</para>
908
909 <para>An optional <replaceable>address-family</replaceable> expects <constant>ipv4</constant> or <constant>ipv6</constant> values.
910 If not specified, a rule will be matched for both IPv4 and IPv6 addresses and applied depending on other socket fields, e.g. <replaceable>transport-protocol</replaceable>,
911 <replaceable>ip-port</replaceable>.</para>
912
913 <para>An optional <replaceable>transport-protocol</replaceable> expects <constant>tcp</constant> or <constant>udp</constant> transport protocol names.
914 If not specified, a rule will be matched for any transport protocol.</para>
915
916 <para>An optional <replaceable>ip-port</replaceable> value must lie within 1…65535 interval inclusively, i.e.
917 dynamic port <constant>0</constant> is not allowed. A range of sequential ports is described by
918 <replaceable>ip-port-range</replaceable> := <replaceable>ip-port-low</replaceable><constant>-</constant><replaceable>ip-port-high</replaceable>,
919 where <replaceable>ip-port-low</replaceable> is smaller than or equal to <replaceable>ip-port-high</replaceable>
920 and both are within 1…65535 inclusively.</para>
921
922 <para>A special value <constant>any</constant> can be used to apply a rule to any address family, transport protocol and any port with a positive value.</para>
923
924 <para>To allow multiple rules assign <varname>SocketBindAllow=</varname> or <varname>SocketBindDeny=</varname> multiple times.
925 To clear the existing assignments pass an empty <varname>SocketBindAllow=</varname> or <varname>SocketBindDeny=</varname>
926 assignment.</para>
927
928 <para>For each of <varname>SocketBindAllow=</varname> and <varname>SocketBindDeny=</varname>, maximum allowed number of assignments is
929 <constant>128</constant>.</para>
930
931 <itemizedlist>
932 <listitem><para>Binding to a socket is allowed when a socket address matches an entry in the
933 <varname>SocketBindAllow=</varname> list.</para></listitem>
934
935 <listitem><para>Otherwise, binding is denied when the socket address matches an entry in the
936 <varname>SocketBindDeny=</varname> list.</para></listitem>
937
938 <listitem><para>Otherwise, binding is allowed.</para></listitem>
939 </itemizedlist>
940
941 <para>The feature is implemented with <constant>cgroup/bind4</constant> and <constant>cgroup/bind6</constant> cgroup-bpf hooks.</para>
942
943 <para>Note that these settings apply to any <citerefentry
944 project='man-pages'><refentrytitle>bind</refentrytitle><manvolnum>2</manvolnum></citerefentry>
945 system call invocation by the unit processes, regardless in which network namespace they are
946 placed. Or in other words: changing the network namespace is not a suitable mechanism for escaping
947 these restrictions on <function>bind()</function>.</para>
948
949 <para>Examples:<programlisting>…
950 # Allow binding IPv6 socket addresses with a port greater than or equal to 10000.
951 [Service]
952 SocketBindAllow=ipv6:10000-65535
953 SocketBindDeny=any
954 …
955 # Allow binding IPv4 and IPv6 socket addresses with 1234 and 4321 ports.
956 [Service]
957 SocketBindAllow=1234
958 SocketBindAllow=4321
959 SocketBindDeny=any
960 …
961 # Deny binding IPv6 socket addresses.
962 [Service]
963 SocketBindDeny=ipv6
964 …
965 # Deny binding IPv4 and IPv6 socket addresses.
966 [Service]
967 SocketBindDeny=any
968 …
969 # Allow binding only over TCP
970 [Service]
971 SocketBindAllow=tcp
972 SocketBindDeny=any
973 …
974 # Allow binding only over IPv6/TCP
975 [Service]
976 SocketBindAllow=ipv6:tcp
977 SocketBindDeny=any
978 …
979 # Allow binding ports within 10000-65535 range over IPv4/UDP.
980 [Service]
981 SocketBindAllow=ipv4:udp:10000-65535
982 SocketBindDeny=any
983 …</programlisting></para>
984
985 <xi:include href="cgroup-sandboxing.xml" xpointer="singular"/>
986
987 <xi:include href="version-info.xml" xpointer="v249"/>
988 </listitem>
989 </varlistentry>
990
991 <varlistentry>
992 <term><varname>RestrictNetworkInterfaces=</varname></term>
993
994 <listitem>
995 <para>Takes a list of space-separated network interface names. This option restricts the network
996 interfaces that processes of this unit can use. By default, processes can only use the network interfaces
997 listed (allow-list). If the first character of the rule is <literal>~</literal>, the effect is inverted:
998 the processes can only use network interfaces not listed (deny-list).
999 </para>
1000
1001 <para>This option can appear multiple times, in which case the network interface names are merged. If the
1002 empty string is assigned the set is reset, all prior assignments will have not effect.
1003 </para>
1004
1005 <para>If you specify both types of this option (i.e. allow-listing and deny-listing), the first encountered
1006 will take precedence and will dictate the default action (allow vs deny). Then the next occurrences of this
1007 option will add or delete the listed network interface names from the set, depending of its type and the
1008 default action.
1009 </para>
1010
1011 <para>The loopback interface ("lo") is not treated in any special way, you have to configure it explicitly
1012 in the unit file.
1013 </para>
1014 <para>Example 1: allow-list
1015 <programlisting>
1016 RestrictNetworkInterfaces=eth1
1017 RestrictNetworkInterfaces=eth2</programlisting>
1018 Programs in the unit will be only able to use the eth1 and eth2 network
1019 interfaces.
1020 </para>
1021
1022 <para>Example 2: deny-list
1023 <programlisting>
1024 RestrictNetworkInterfaces=~eth1 eth2</programlisting>
1025 Programs in the unit will be able to use any network interface but eth1 and eth2.
1026 </para>
1027
1028 <para>Example 3: mixed
1029 <programlisting>
1030 RestrictNetworkInterfaces=eth1 eth2
1031 RestrictNetworkInterfaces=~eth1</programlisting>
1032 Programs in the unit will be only able to use the eth2 network interface.
1033 </para>
1034
1035 <xi:include href="cgroup-sandboxing.xml" xpointer="singular"/>
1036
1037 <xi:include href="version-info.xml" xpointer="v250"/>
1038 </listitem>
1039 </varlistentry>
1040
1041 <varlistentry>
1042 <term><varname>BindNetworkInterface=</varname></term>
1043
1044 <listitem>
1045 <para>Takes the name of a network interface. This option causes every socket created by processes of this
1046 unit to be bound to the specified network interface.
1047 </para>
1048
1049 <para>It is specially useful to confine a process to a VRF, when the program does not offer native support
1050 for it. It is equivalent to running the program using <constant>ip vrf exec</constant>.
1051 </para>
1052
1053 <para>In systems using <filename>nss-resolve</filename>, the interface used for DNS resolution can be chosen
1054 by using the <varname>SYSTEMD_NSS_RESOLVE_IFINDEX</varname> environment variable.</para>
1055
1056 <para>The feature is implemented with <constant>cgroup/sock_create</constant> cgroup-bpf hooks.</para>
1057
1058 <para>Example:<programlisting>[Service]
1059 BindNetworkInterface=vrf-mgmt
1060 </programlisting></para>
1061
1062 <xi:include href="cgroup-sandboxing.xml" xpointer="singular"/>
1063
1064 <xi:include href="version-info.xml" xpointer="v260"/>
1065 </listitem>
1066 </varlistentry>
1067
1068 <varlistentry>
1069 <term><varname>NFTSet=</varname><replaceable>family</replaceable>:<replaceable>table</replaceable>:<replaceable>set</replaceable></term>
1070 <listitem>
1071 <para>This setting provides a method for integrating dynamic cgroup, user and group IDs into
1072 firewall rules with <ulink url="https://netfilter.org/projects/nftables/index.html">NFT</ulink>
1073 sets. The benefit of using this setting is to be able to use the IDs as selectors in firewall rules
1074 easily and this in turn allows more fine grained filtering. NFT rules for cgroup matching use
1075 numeric cgroup IDs, which change every time a service is restarted, making them hard to use in
1076 systemd environment otherwise. Dynamic and random IDs used by <varname>DynamicUser=</varname> can
1077 be also integrated with this setting.</para>
1078
1079 <para>This option expects a whitespace separated list of NFT set definitions. Each definition
1080 consists of a colon-separated tuple of source type (one of <literal>cgroup</literal>,
1081 <literal>user</literal> or <literal>group</literal>), NFT address family (one of
1082 <literal>arp</literal>, <literal>bridge</literal>, <literal>inet</literal>, <literal>ip</literal>,
1083 <literal>ip6</literal>, or <literal>netdev</literal>), table name and set name. The names of tables
1084 and sets must conform to lexicographic restrictions of NFT table names. The type of the element used in
1085 the NFT filter must match the type implied by the directive (<literal>cgroup</literal>,
1086 <literal>user</literal> or <literal>group</literal>) as shown in the table below. When a control
1087 group or a unit is realized, the corresponding ID will be appended to the NFT sets and it will be
1088 be removed when the control group or unit is removed. <command>systemd</command> only inserts
1089 elements to (or removes from) the sets, so the related NFT rules, tables and sets must be prepared
1090 elsewhere in advance. Failures to manage the sets will be ignored.</para>
1091
1092 <table>
1093 <title>Defined <varname>source type</varname> values</title>
1094 <tgroup cols='3'>
1095 <colspec colname='source type'/>
1096 <colspec colname='description'/>
1097 <colspec colname='NFT type name'/>
1098 <thead>
1099 <row>
1100 <entry>Source type</entry>
1101 <entry>Description</entry>
1102 <entry>Corresponding NFT type name</entry>
1103 </row>
1104 </thead>
1105
1106 <tbody>
1107 <row>
1108 <entry><literal>cgroup</literal></entry>
1109 <entry>control group ID</entry>
1110 <entry><literal>cgroupsv2</literal></entry>
1111 </row>
1112 <row>
1113 <entry><literal>user</literal></entry>
1114 <entry>user ID</entry>
1115 <entry><literal>meta skuid</literal></entry>
1116 </row>
1117 <row>
1118 <entry><literal>group</literal></entry>
1119 <entry>group ID</entry>
1120 <entry><literal>meta skgid</literal></entry>
1121 </row>
1122 </tbody>
1123 </tgroup>
1124 </table>
1125
1126 <para>If the firewall rules are reinstalled so that the contents of NFT sets are destroyed, command
1127 <command>systemctl daemon-reload</command> can be used to refill the sets.</para>
1128
1129 <para>Example:
1130 <programlisting>[Service]
1131 NFTSet=cgroup:inet:filter:my_service user:inet:filter:serviceuser
1132 </programlisting>
1133 Corresponding NFT rules:
1134 <programlisting>table inet filter {
1135 set my_service {
1136 type cgroupsv2
1137 }
1138 set serviceuser {
1139 typeof meta skuid
1140 }
1141 chain x {
1142 socket cgroupv2 level 2 @my_service accept
1143 drop
1144 }
1145 chain y {
1146 meta skuid @serviceuser accept
1147 drop
1148 }
1149 }</programlisting>
1150 </para>
1151 <xi:include href="system-only.xml" xpointer="singular"/>
1152 <xi:include href="version-info.xml" xpointer="v255"/></listitem>
1153 </varlistentry>
1154
1155 </variablelist>
1156
1157 </refsect2><refsect2><title>BPF Programs</title>
1158
1159 <variablelist class='unit-directives'>
1160
1161 <varlistentry>
1162 <term><varname>IPIngressFilterPath=<replaceable>BPF_FS_PROGRAM_PATH</replaceable></varname></term>
1163 <term><varname>IPEgressFilterPath=<replaceable>BPF_FS_PROGRAM_PATH</replaceable></varname></term>
1164
1165 <listitem>
1166 <para>Add custom network traffic filters implemented as BPF programs, applying to all IP packets
1167 sent and received over <constant>AF_INET</constant> and <constant>AF_INET6</constant> sockets.
1168 Takes an absolute path to a pinned BPF program in the BPF virtual filesystem (<filename>/sys/fs/bpf/</filename>).
1169 </para>
1170
1171 <para>The filters configured with this option are applied to all sockets created by processes
1172 of this unit (or in the case of socket units, associated with it). The filters are loaded in addition
1173 to filters any of the parent slice units this unit might be a member of as well as any
1174 <varname>IPAddressAllow=</varname> and <varname>IPAddressDeny=</varname> filters in any of these units.
1175 By default, there are no filters specified.</para>
1176
1177 <para>If these settings are used multiple times in the same unit all the specified programs are attached. If an
1178 empty string is assigned to these settings the program list is reset and all previous specified programs ignored.</para>
1179
1180 <para>If the path <replaceable>BPF_FS_PROGRAM_PATH</replaceable> in <varname>IPIngressFilterPath=</varname> assignment
1181 is already being handled by <varname>BPFProgram=</varname> ingress hook, e.g.
1182 <varname>BPFProgram=</varname><constant>ingress</constant>:<replaceable>BPF_FS_PROGRAM_PATH</replaceable>,
1183 the assignment will be still considered valid and the program will be attached to a cgroup. Same for
1184 <varname>IPEgressFilterPath=</varname> path and <constant>egress</constant> hook.</para>
1185
1186 <para>Note that for socket-activated services, the IP filter programs configured on the socket unit apply to
1187 all sockets associated with it directly, but not to any sockets created by the ultimately activated services
1188 for it. Conversely, the IP filter programs configured for the service are not applied to any sockets passed into
1189 the service via socket activation. Thus, it is usually a good idea, to replicate the IP filter programs on both
1190 the socket and the service unit, however it often makes sense to maintain one configuration more open and the other
1191 one more restricted, depending on the use case.</para>
1192
1193 <para>Note that these settings might not be supported on some systems (for example if eBPF control group
1194 support is not enabled in the underlying kernel or container manager). These settings will have no effect in
1195 that case. If compatibility with such systems is desired it is hence recommended to attach your filter manually
1196 (requires <varname>Delegate=</varname><constant>yes</constant>) instead of using this setting.</para>
1197
1198 <xi:include href="version-info.xml" xpointer="v243"/>
1199 </listitem>
1200 </varlistentry>
1201
1202 <varlistentry>
1203 <term><varname>BPFProgram=<replaceable>type</replaceable>:<replaceable>program-path</replaceable></varname></term>
1204 <listitem>
1205 <para><varname>BPFProgram=</varname> allows attaching custom BPF programs to the cgroup of a
1206 unit. (This generalizes the functionality exposed via <varname>IPEgressFilterPath=</varname> and
1207 <varname>IPIngressFilterPath=</varname> for other hooks.) Cgroup-bpf hooks in the form of BPF
1208 programs loaded to the BPF filesystem are attached with cgroup-bpf attach flags determined by the
1209 unit. For details about attachment types and flags see <ulink
1210 url="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/include/uapi/linux/bpf.h"><filename>bpf.h</filename></ulink>. Also
1211 refer to the general <ulink url="https://docs.kernel.org/bpf/">BPF documentation</ulink>.</para>
1212
1213 <para>The specification of BPF program consists of a pair of BPF program type and program path in
1214 the file system, with <literal>:</literal> as the separator:
1215 <replaceable>type</replaceable>:<replaceable>program-path</replaceable>.</para>
1216
1217 <para>The BPF program type is equivalent to the BPF attach type used in
1218 <citerefentry project='mankier'><refentrytitle>bpftool</refentrytitle><manvolnum>8</manvolnum></citerefentry>
1219 It may be one of
1220 <constant>egress</constant>,
1221 <constant>ingress</constant>,
1222 <constant>sock_create</constant>,
1223 <constant>sock_ops</constant>,
1224 <constant>device</constant>,
1225 <constant>bind4</constant>,
1226 <constant>bind6</constant>,
1227 <constant>connect4</constant>,
1228 <constant>connect6</constant>,
1229 <constant>post_bind4</constant>,
1230 <constant>post_bind6</constant>,
1231 <constant>sendmsg4</constant>,
1232 <constant>sendmsg6</constant>,
1233 <constant>sysctl</constant>,
1234 <constant>recvmsg4</constant>,
1235 <constant>recvmsg6</constant>,
1236 <constant>getsockopt</constant>,
1237 or <constant>setsockopt</constant>.
1238 </para>
1239
1240 <para>The specified program path must be an absolute path referencing a BPF program inode in the
1241 bpffs file system (which generally means it must begin with <filename>/sys/fs/bpf/</filename>). If
1242 a specified program does not exist (i.e. has not been uploaded to the BPF subsystem of the kernel
1243 yet), it will not be installed but unit activation will continue (a warning will be printed to the
1244 logs).</para>
1245
1246 <para>Setting <varname>BPFProgram=</varname> to an empty value makes previous assignments
1247 ineffective.</para>
1248
1249 <para>Multiple assignments of the same program type/path pair have the same effect as a single
1250 assignment: the program will be attached just once.</para>
1251
1252 <para>If BPF <constant>egress</constant> pinned to <replaceable>program-path</replaceable> path is already being
1253 handled by <varname>IPEgressFilterPath=</varname>, <varname>BPFProgram=</varname>
1254 assignment will be considered valid and <varname>BPFProgram=</varname> will be attached to a cgroup.
1255 Similarly for <constant>ingress</constant> hook and <varname>IPIngressFilterPath=</varname> assignment.</para>
1256
1257 <para>BPF programs passed with <varname>BPFProgram=</varname> are attached to the cgroup of a unit
1258 with BPF attach flag <constant>multi</constant>, that allows further attachments of the same
1259 <replaceable>type</replaceable> within cgroup hierarchy topped by the unit cgroup.</para>
1260
1261 <para>Examples:<programlisting>BPFProgram=egress:/sys/fs/bpf/egress-hook
1262 BPFProgram=bind6:/sys/fs/bpf/sock-addr-hook
1263 </programlisting></para>
1264
1265 <xi:include href="version-info.xml" xpointer="v249"/>
1266 </listitem>
1267 </varlistentry>
1268
1269 </variablelist>
1270
1271 </refsect2><refsect2><title>Device Access</title>
1272
1273 <variablelist class='unit-directives'>
1274
1275 <varlistentry>
1276 <term><varname>DeviceAllow=</varname></term>
1277
1278 <listitem>
1279 <para>Control access to specific device nodes by the executed processes. Takes two space-separated
1280 strings: a device node specifier followed by a combination of <constant>r</constant>,
1281 <constant>w</constant>, <constant>m</constant> to control <emphasis>r</emphasis>eading,
1282 <emphasis>w</emphasis>riting, or creation of the specific device nodes by the unit
1283 (<emphasis>m</emphasis>knod), respectively. This functionality is implemented using eBPF
1284 filtering.</para>
1285
1286 <para>When access to <emphasis>all</emphasis> physical devices should be disallowed,
1287 <varname>PrivateDevices=</varname> may be used instead. See
1288 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
1289 </para>
1290
1291 <para>The device node specifier is either a path to a device node in the file system, starting with
1292 <filename>/dev/</filename>, or a string starting with either <literal>char-</literal> or
1293 <literal>block-</literal> followed by a device group name, as listed in
1294 <filename>/proc/devices</filename>. The latter is useful to allow-list all current and future
1295 devices belonging to a specific device group at once. The device group is matched according to
1296 filename globbing rules, you may hence use the <literal>*</literal> and <literal>?</literal>
1297 wildcards. (Note that such globbing wildcards are not available for device node path
1298 specifications!) In order to match device nodes by numeric major/minor, use device node paths in
1299 the <filename>/dev/char/</filename> and <filename>/dev/block/</filename> directories. However,
1300 matching devices by major/minor is generally not recommended as assignments are neither stable nor
1301 portable between systems or different kernel versions.</para>
1302
1303 <para>Examples: <filename>/dev/sda5</filename> is a path to a device node, referring to an ATA or
1304 SCSI block device. <literal>char-pts</literal> and <literal>char-alsa</literal> are specifiers for
1305 all pseudo TTYs and all ALSA sound devices, respectively. <literal>char-cpu/*</literal> is a
1306 specifier matching all CPU related device groups.</para>
1307
1308 <para>Note that allow lists defined this way should only reference device groups which are
1309 resolvable at the time the unit is started. Any device groups not resolvable then are not added to
1310 the device allow list. In order to work around this limitation, consider extending service units
1311 with a pair of <command>[email protected]</command> and
1312 <command>[email protected]</command> lines that load the necessary kernel module
1313 implementing the device group if missing.
1314 Example: <programlisting>…
1315 [Unit]
1316 [email protected]
1317 [email protected]
1318
1319 [Service]
1320 DeviceAllow=block-loop
1321 DeviceAllow=/dev/loop-control
1322 …</programlisting></para>
1323
1324 <xi:include href="cgroup-sandboxing.xml" xpointer="singular"/>
1325
1326 <xi:include href="version-info.xml" xpointer="v208"/>
1327 </listitem>
1328 </varlistentry>
1329
1330 <varlistentry>
1331 <term><varname>DevicePolicy=auto|closed|strict</varname></term>
1332
1333 <listitem>
1334 <para>
1335 Control the policy for allowing device access:
1336 </para>
1337 <variablelist>
1338 <varlistentry>
1339 <term><option>strict</option></term>
1340 <listitem>
1341 <para>means to only allow types of access that are
1342 explicitly specified.</para>
1343
1344 <xi:include href="version-info.xml" xpointer="v208"/>
1345 </listitem>
1346 </varlistentry>
1347
1348 <varlistentry>
1349 <term><option>closed</option></term>
1350 <listitem>
1351 <para>in addition, allows access to standard pseudo
1352 devices including
1353 <filename>/dev/null</filename>,
1354 <filename>/dev/zero</filename>,
1355 <filename>/dev/full</filename>,
1356 <filename>/dev/random</filename>, and
1357 <filename>/dev/urandom</filename>.
1358 </para>
1359
1360 <xi:include href="version-info.xml" xpointer="v208"/>
1361 </listitem>
1362 </varlistentry>
1363
1364 <varlistentry>
1365 <term><option>auto</option></term>
1366 <listitem>
1367 <para>
1368 in addition, allows access to all devices if no
1369 explicit <varname>DeviceAllow=</varname> is present.
1370 This is the default.
1371 </para>
1372
1373 <xi:include href="version-info.xml" xpointer="v208"/>
1374 </listitem>
1375 </varlistentry>
1376 </variablelist>
1377
1378 <xi:include href="cgroup-sandboxing.xml" xpointer="singular"/>
1379
1380 <xi:include href="version-info.xml" xpointer="v208"/>
1381 </listitem>
1382 </varlistentry>
1383
1384 </variablelist>
1385
1386 </refsect2><refsect2><title>Control Group Management</title>
1387
1388 <variablelist class='unit-directives'>
1389
1390 <varlistentry>
1391 <term><varname>Slice=</varname></term>
1392
1393 <listitem>
1394 <para>The name of the slice unit to place the unit
1395 in. Defaults to <filename>system.slice</filename> for all
1396 non-instantiated units of all unit types (except for slice
1397 units themselves see below). Instance units are by default
1398 placed in a subslice of <filename>system.slice</filename>
1399 that is named after the template name.</para>
1400
1401 <para>This option may be used to arrange systemd units in a
1402 hierarchy of slices each of which might have resource
1403 settings applied.</para>
1404
1405 <para>For units of type slice, the only accepted value for
1406 this setting is the parent slice. Since the name of a slice
1407 unit implies the parent slice, it is hence redundant to ever
1408 set this parameter directly for slice units.</para>
1409
1410 <para>Special care should be taken when relying on the default slice assignment in templated service units
1411 that have <varname>DefaultDependencies=no</varname> set, see
1412 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>, section
1413 "Default Dependencies" for details.</para>
1414
1415 <xi:include href="version-info.xml" xpointer="v208"/>
1416
1417 </listitem>
1418 </varlistentry>
1419
1420 <varlistentry>
1421 <term><varname>Delegate=</varname></term>
1422
1423 <listitem>
1424 <para>Turns on delegation of further resource control partitioning to processes of the unit. Units
1425 where this is enabled may create and manage their own private subhierarchy of control groups below
1426 the control group of the unit itself. For unprivileged services (i.e. those using the
1427 <varname>User=</varname> setting) the unit's control group will be made accessible to the relevant
1428 user.</para>
1429
1430 <para>When enabled the service manager will refrain from manipulating control groups or moving
1431 processes below the unit's control group, so that a clear concept of ownership is established: the
1432 control group tree at the level of the unit's control group and above (i.e. towards the root
1433 control group) is owned and managed by the service manager of the host, while the control group
1434 tree below the unit's control group is owned and managed by the unit itself.</para>
1435
1436 <para>Takes either a boolean argument or a (possibly empty) list of control group controller names.
1437 If true, delegation is turned on, and all supported controllers are enabled for the unit, making
1438 them available to the unit's processes for management. If false, delegation is turned off entirely
1439 (and no additional controllers are enabled). If set to a list of controllers, delegation is turned
1440 on, and the specified controllers are enabled for the unit. Assigning the empty string will enable
1441 delegation, but reset the list of controllers, and all assignments prior to this will have no
1442 effect. Note that additional controllers other than the ones specified might be made available as
1443 well, depending on configuration of the containing slice unit or other units contained in it.
1444 Defaults to false.</para>
1445
1446 <para>Note that controller delegation to less privileged code is only safe on the unified control
1447 group hierarchy. Accordingly, access to the specified controllers will not be granted to
1448 unprivileged services on the legacy hierarchy, even when requested.</para>
1449
1450 <xi:include href="supported-controllers.xml" xpointer="controllers-text" />
1451
1452 <para>Not all of these controllers are available on all kernels however, and some are specific to
1453 the unified hierarchy while others are specific to the legacy hierarchy. Also note that the kernel
1454 might support further controllers, which are not covered here yet, as delegation is either not
1455 supported at all for them or not defined cleanly.</para>
1456
1457 <para>Note that because of the hierarchical nature of cgroup hierarchy, any controllers that are
1458 delegated will be enabled for the parent and sibling units of the unit with delegation.</para>
1459
1460 <para>For further details on the delegation model consult <ulink
1461 url="https://systemd.io/CGROUP_DELEGATION">Control Group APIs and Delegation</ulink>.</para>
1462
1463 <xi:include href="version-info.xml" xpointer="v218"/>
1464 </listitem>
1465 </varlistentry>
1466
1467 <varlistentry>
1468 <term><varname>DelegateSubgroup=</varname></term>
1469
1470 <listitem>
1471 <para>Place unit processes in the specified subgroup of the unit's control group. Takes a valid
1472 control group name (not a path!) as parameter, or an empty string to turn this feature
1473 off. Defaults to off. The control group name must be usable as filename and avoid conflicts with
1474 the kernel's control group attribute files (i.e. <filename>cgroup.procs</filename> is not an
1475 acceptable name, since the kernel exposes a native control group attribute file by that name). This
1476 option has no effect unless control group delegation is turned on via <varname>Delegate=</varname>,
1477 see above. Note that this setting only applies to "main" processes of a unit, i.e. for services to
1478 <varname>ExecStart=</varname>, but not for <varname>ExecReload=</varname> and similar. If
1479 delegation is enabled, the latter are always placed inside a subgroup named
1480 <filename>.control</filename>. The specified subgroup is automatically created (and potentially
1481 ownership is passed to the unit's configured user/group) when a process is started in it.</para>
1482
1483 <para>This option is useful to avoid manually moving the invoked process into a subgroup after it
1484 has been started. Since no processes should live in inner nodes of the control group tree it is
1485 almost always necessary to run the main ("supervising") process of a unit that has delegation
1486 turned on in a subgroup.</para>
1487
1488 <xi:include href="version-info.xml" xpointer="v254"/>
1489 </listitem>
1490 </varlistentry>
1491
1492 <varlistentry>
1493 <term><varname>DisableControllers=</varname></term>
1494
1495 <listitem>
1496 <para>Disables controllers from being enabled for a unit's children. If a controller listed is
1497 already in use in its subtree, the controller will be removed from the subtree. This can be used to
1498 avoid configuration in child units from being able to implicitly or explicitly enable a controller.
1499 Defaults to empty.</para>
1500
1501 <para>Multiple controllers may be specified, separated by spaces. You may also pass
1502 <varname>DisableControllers=</varname> multiple times, in which case each new instance adds another controller
1503 to disable. Passing <varname>DisableControllers=</varname> by itself with no controller name present resets
1504 the disabled controller list.</para>
1505
1506 <para>It may not be possible to disable a controller after units have been started, if the unit or
1507 any child of the unit in question delegates controllers to its children, as any delegated subtree
1508 of the cgroup hierarchy is unmanaged by systemd.</para>
1509
1510 <xi:include href="supported-controllers.xml" xpointer="controllers-text" />
1511
1512 <xi:include href="version-info.xml" xpointer="v240"/>
1513 </listitem>
1514 </varlistentry>
1515
1516 </variablelist>
1517
1518 </refsect2><refsect2><title>Memory Pressure Control</title>
1519
1520 <variablelist class='unit-directives'>
1521
1522 <varlistentry>
1523 <term><varname>ManagedOOMSwap=auto|kill</varname></term>
1524 <term><varname>ManagedOOMMemoryPressure=auto|kill</varname></term>
1525
1526 <listitem>
1527 <para>Specifies how
1528 <citerefentry><refentrytitle>systemd-oomd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
1529 will act on this unit's cgroups. Defaults to <option>auto</option>.</para>
1530
1531 <para>When set to <option>kill</option>, the unit becomes a candidate for monitoring by
1532 <command>systemd-oomd</command>. If the cgroup passes the limits set by
1533 <citerefentry><refentrytitle>oomd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> or
1534 the unit configuration, <command>systemd-oomd</command> will select a descendant cgroup and send
1535 <constant>SIGKILL</constant> to all of the processes under it. You can find more details on
1536 candidates and kill behavior at
1537 <citerefentry><refentrytitle>systemd-oomd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
1538 and
1539 <citerefentry><refentrytitle>oomd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
1540
1541 <para>Setting either of these properties to <option>kill</option> will also result in
1542 <varname>After=</varname> and <varname>Wants=</varname> dependencies on
1543 <filename>systemd-oomd.service</filename> unless <varname>DefaultDependencies=no</varname>.</para>
1544
1545 <para>When set to <option>auto</option>, <command>systemd-oomd</command> will not actively use this
1546 cgroup's data for monitoring and detection. However, if an ancestor cgroup has one of these
1547 properties set to <option>kill</option>, a unit with <option>auto</option> can still be a candidate
1548 for <command>systemd-oomd</command> to terminate.</para>
1549
1550 <xi:include href="version-info.xml" xpointer="v247"/>
1551 </listitem>
1552 </varlistentry>
1553
1554 <varlistentry>
1555 <term><varname>ManagedOOMMemoryPressureLimit=</varname></term>
1556
1557 <listitem>
1558 <para>Overrides the default memory pressure limit set by
1559 <citerefentry><refentrytitle>oomd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
1560 the cgroup of this unit. Takes a percentage value between 0% and 100%, inclusive. Defaults to 0%,
1561 which means to use the default set by
1562 <citerefentry><refentrytitle>oomd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
1563 This property is ignored unless <varname>ManagedOOMMemoryPressure=</varname><option>kill</option>.
1564 </para>
1565
1566 <xi:include href="version-info.xml" xpointer="v247"/>
1567 </listitem>
1568 </varlistentry>
1569
1570 <varlistentry>
1571 <term><varname>ManagedOOMMemoryPressureDurationSec=</varname></term>
1572
1573 <listitem>
1574 <para>Overrides the default memory pressure duration set by
1575 <citerefentry><refentrytitle>oomd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
1576 the cgroup of this unit. The specified value supports a time unit such as <literal>ms</literal> or
1577 <literal>μs</literal>, see
1578 <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>
1579 for details on the permitted syntax. Must be set to either empty or a value of at least 1s. Defaults
1580 to empty, which means to use the default set by
1581 <citerefentry><refentrytitle>oomd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
1582 This property is ignored unless <varname>ManagedOOMMemoryPressure=</varname><option>kill</option>.
1583 </para>
1584
1585 <xi:include href="version-info.xml" xpointer="v257"/>
1586 </listitem>
1587 </varlistentry>
1588
1589 <varlistentry>
1590 <term><varname>ManagedOOMPreference=none|avoid|omit</varname></term>
1591
1592 <listitem>
1593 <para>Allows deprioritizing or omitting this unit's cgroup as a candidate when
1594 <command>systemd-oomd</command> needs to act. Requires support for extended attributes (see
1595 <citerefentry project='man-pages'><refentrytitle>xattr</refentrytitle><manvolnum>7</manvolnum></citerefentry>)
1596 in order to use <option>avoid</option> or <option>omit</option>.</para>
1597
1598 <para>When calculating candidates to relieve swap usage, <command>systemd-oomd</command> will
1599 only respect these extended attributes if the unit's cgroup is owned by root.</para>
1600
1601 <para>When calculating candidates to relieve memory pressure, <command>systemd-oomd</command>
1602 will only respect these extended attributes if the unit's cgroup is owned by root, or if the
1603 unit's cgroup owner, and the owner of the monitored ancestor cgroup are the same. For example,
1604 if <command>systemd-oomd</command> is calculating candidates for <filename>-.slice</filename>,
1605 then extended attributes set on descendants of <filename>/user.slice/user-1000.slice/[email protected]/</filename>
1606 will be ignored because the descendants are owned by UID 1000, and <filename>-.slice</filename>
1607 is owned by UID 0. But, if calculating candidates for
1608 <filename>/user.slice/user-1000.slice/[email protected]/</filename>, then extended attributes set
1609 on the descendants would be respected.</para>
1610
1611 <para>If this property is set to <option>avoid</option>, the service manager will convey this to
1612 <command>systemd-oomd</command>, which will only select this cgroup if there are no other viable
1613 candidates.</para>
1614
1615 <para>If this property is set to <option>omit</option>, the service manager will convey this to
1616 <command>systemd-oomd</command>, which will ignore this cgroup as a candidate and will not perform
1617 any actions on it.</para>
1618
1619 <para>It is recommended to use <option>avoid</option> and <option>omit</option> sparingly, as it
1620 can adversely affect <command>systemd-oomd</command>'s kill behavior. Also note that these extended
1621 attributes are not applied recursively to cgroups under this unit's cgroup.</para>
1622
1623 <para>Defaults to <option>none</option> which means <command>systemd-oomd</command> will rank this
1624 unit's cgroup as defined in
1625 <citerefentry><refentrytitle>systemd-oomd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
1626 and <citerefentry><refentrytitle>oomd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
1627 </para>
1628
1629 <xi:include href="version-info.xml" xpointer="v248"/>
1630 </listitem>
1631 </varlistentry>
1632
1633 <varlistentry>
1634 <term><varname>OOMRules=</varname></term>
1635
1636 <listitem>
1637 <para>Takes a space-separated list of OOM ruleset names. The rulesets are defined in
1638 <filename>.oomrule</filename> files placed in
1639 <filename>/etc/systemd/oomd/rules.d/</filename>,
1640 <filename>/run/systemd/oomd/rules.d/</filename>,
1641 <filename>/usr/local/lib/systemd/oomd/rules.d/</filename>, or
1642 <filename>/usr/lib/systemd/oomd/rules.d/</filename>. When set,
1643 <citerefentry><refentrytitle>systemd-oomd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
1644 will monitor this unit's cgroup and evaluate the specified rulesets against it.
1645 Each ruleset defines conditions (such as memory pressure or swap usage thresholds) and an action
1646 to take when those conditions are met. See
1647 <citerefentry><refentrytitle>oomd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
1648 details on the available ruleset options.</para>
1649
1650 <para>Setting this property will also result in <varname>After=</varname> and
1651 <varname>Wants=</varname> dependencies on <filename>systemd-oomd.service</filename> unless
1652 <varname>DefaultDependencies=no</varname>.</para>
1653
1654 <para>Defaults to an empty list, which means no rulesets are applied. Note that each monitored
1655 cgroup incurs a per-interval walk of its descendant cgroup tree, so monitoring very large numbers of
1656 cgroups via <varname>OOMRules=</varname> may have a measurable performance impact.</para>
1657
1658 <xi:include href="version-info.xml" xpointer="v261"/>
1659 </listitem>
1660 </varlistentry>
1661
1662 <varlistentry>
1663 <term><varname>MemoryPressureWatch=</varname></term>
1664
1665 <listitem><para>Controls memory pressure monitoring for invoked processes. Takes a boolean or one of
1666 <literal>auto</literal> and <literal>skip</literal>. If <literal>no</literal>, tells the service not
1667 to watch for memory pressure events, by setting the <varname>$MEMORY_PRESSURE_WATCH</varname>
1668 environment variable to the literal string <filename>/dev/null</filename>. If <literal>yes</literal>,
1669 tells the service to watch for memory pressure events. This enables memory accounting for the
1670 service, and ensures the <filename>memory.pressure</filename> cgroup attribute file is accessible for
1671 reading and writing by the service's user. It then sets the <varname>$MEMORY_PRESSURE_WATCH</varname>
1672 environment variable for processes invoked by the unit to the file system path to this file. The
1673 threshold information configured with <varname>MemoryPressureThresholdSec=</varname> is encoded in
1674 the <varname>$MEMORY_PRESSURE_WRITE</varname> environment variable. If the <literal>auto</literal>
1675 value is set the protocol is enabled if memory accounting is anyway enabled for the unit, and
1676 disabled otherwise. If set to <literal>skip</literal> the logic is neither enabled, nor disabled and
1677 the two environment variables are not set.</para>
1678
1679 <para>Note that services are free to use the two environment variables, but it is unproblematic if
1680 they ignore them. Memory pressure handling must be implemented individually in each service, and
1681 usually means different things for different software. For further details on memory pressure
1682 handling see <ulink url="https://systemd.io/PRESSURE">Resource Pressure Handling in
1683 systemd</ulink>.</para>
1684
1685 <para>Services implemented using
1686 <citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry> may use
1687 <citerefentry><refentrytitle>sd_event_add_memory_pressure</refentrytitle><manvolnum>3</manvolnum></citerefentry>
1688 to watch for and handle memory pressure events.</para>
1689
1690 <para>If not explicit set, defaults to the <varname>DefaultMemoryPressureWatch=</varname> setting in
1691 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
1692
1693 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
1694 </varlistentry>
1695
1696 <varlistentry>
1697 <term><varname>MemoryPressureThresholdSec=</varname></term>
1698
1699 <listitem><para>Sets the memory pressure threshold time for memory pressure monitor as configured via
1700 <varname>MemoryPressureWatch=</varname>. Specifies the maximum allocation latency before a memory
1701 pressure event is signalled to the service, per 2s window. If not specified, defaults to the
1702 <varname>DefaultMemoryPressureThresholdSec=</varname> setting in
1703 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
1704 (which in turn defaults to 200ms). The specified value expects a time unit such as
1705 <literal>ms</literal> or <literal>μs</literal>, see
1706 <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry> for
1707 details on the permitted syntax.</para>
1708
1709 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
1710 </varlistentry>
1711
1712 <varlistentry>
1713 <term><varname>CPUPressureWatch=</varname></term>
1714
1715 <listitem><para>Controls CPU pressure monitoring for invoked processes. Takes a boolean or one of
1716 <literal>auto</literal> and <literal>skip</literal>. If <literal>no</literal>, tells the service not
1717 to watch for CPU pressure events, by setting the <varname>$CPU_PRESSURE_WATCH</varname>
1718 environment variable to the literal string <filename>/dev/null</filename>. If <literal>yes</literal>,
1719 tells the service to watch for CPU pressure events. This ensures the
1720 <filename>cpu.pressure</filename> cgroup attribute file is accessible for
1721 reading and writing by the service's user. It then sets the <varname>$CPU_PRESSURE_WATCH</varname>
1722 environment variable for processes invoked by the unit to the file system path to this file. The
1723 threshold information configured with <varname>CPUPressureThresholdSec=</varname> is encoded in
1724 the <varname>$CPU_PRESSURE_WRITE</varname> environment variable. If the <literal>auto</literal>
1725 value is set the protocol is enabled if CPU resource controls are configured for the unit (e.g. because
1726 <varname>CPUWeight=</varname> or <varname>CPUQuota=</varname> is set), and
1727 disabled otherwise. If set to <literal>skip</literal> the logic is neither enabled, nor disabled and
1728 the two environment variables are not set.</para>
1729
1730 <para>Note that services are free to use the two environment variables, but it is unproblematic if
1731 they ignore them. CPU pressure handling must be implemented individually in each service, and
1732 usually means different things for different software.</para>
1733
1734 <para>Services implemented using
1735 <citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry> may use
1736 <citerefentry><refentrytitle>sd_event_add_cpu_pressure</refentrytitle><manvolnum>3</manvolnum></citerefentry>
1737 to watch for and handle CPU pressure events.</para>
1738
1739 <para>If not explicitly set, defaults to the <varname>DefaultCPUPressureWatch=</varname> setting in
1740 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
1741
1742 <xi:include href="version-info.xml" xpointer="v261"/></listitem>
1743 </varlistentry>
1744
1745 <varlistentry>
1746 <term><varname>CPUPressureThresholdSec=</varname></term>
1747
1748 <listitem><para>Sets the CPU pressure threshold time for CPU pressure monitor as configured via
1749 <varname>CPUPressureWatch=</varname>. Specifies the maximum CPU stall time before a CPU
1750 pressure event is signalled to the service, per 2s window. If not specified, defaults to the
1751 <varname>DefaultCPUPressureThresholdSec=</varname> setting in
1752 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
1753 (which in turn defaults to 200ms). The specified value expects a time unit such as
1754 <literal>ms</literal> or <literal>μs</literal>, see
1755 <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry> for
1756 details on the permitted syntax.</para>
1757
1758 <xi:include href="version-info.xml" xpointer="v261"/></listitem>
1759 </varlistentry>
1760
1761 <varlistentry>
1762 <term><varname>IOPressureWatch=</varname></term>
1763
1764 <listitem><para>Controls IO pressure monitoring for invoked processes. Takes a boolean or one of
1765 <literal>auto</literal> and <literal>skip</literal>. If <literal>no</literal>, tells the service not
1766 to watch for IO pressure events, by setting the <varname>$IO_PRESSURE_WATCH</varname>
1767 environment variable to the literal string <filename>/dev/null</filename>. If <literal>yes</literal>,
1768 tells the service to watch for IO pressure events. This enables IO accounting for the
1769 service, and ensures the <filename>io.pressure</filename> cgroup attribute file is accessible for
1770 reading and writing by the service's user. It then sets the <varname>$IO_PRESSURE_WATCH</varname>
1771 environment variable for processes invoked by the unit to the file system path to this file. The
1772 threshold information configured with <varname>IOPressureThresholdSec=</varname> is encoded in
1773 the <varname>$IO_PRESSURE_WRITE</varname> environment variable. If the <literal>auto</literal>
1774 value is set the protocol is enabled if IO accounting is anyway enabled for the unit (e.g. because
1775 <varname>IOWeight=</varname> or <varname>IODeviceWeight=</varname> is set), and
1776 disabled otherwise. If set to <literal>skip</literal> the logic is neither enabled, nor disabled and
1777 the two environment variables are not set.</para>
1778
1779 <para>Note that services are free to use the two environment variables, but it is unproblematic if
1780 they ignore them. IO pressure handling must be implemented individually in each service, and
1781 usually means different things for different software.</para>
1782
1783 <para>Services implemented using
1784 <citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry> may use
1785 <citerefentry><refentrytitle>sd_event_add_io_pressure</refentrytitle><manvolnum>3</manvolnum></citerefentry>
1786 to watch for and handle IO pressure events.</para>
1787
1788 <para>If not explicitly set, defaults to the <varname>DefaultIOPressureWatch=</varname> setting in
1789 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
1790
1791 <xi:include href="version-info.xml" xpointer="v261"/></listitem>
1792 </varlistentry>
1793
1794 <varlistentry>
1795 <term><varname>IOPressureThresholdSec=</varname></term>
1796
1797 <listitem><para>Sets the IO pressure threshold time for IO pressure monitor as configured via
1798 <varname>IOPressureWatch=</varname>. Specifies the maximum IO stall time before an IO
1799 pressure event is signalled to the service, per 2s window. If not specified, defaults to the
1800 <varname>DefaultIOPressureThresholdSec=</varname> setting in
1801 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
1802 (which in turn defaults to 200ms). The specified value expects a time unit such as
1803 <literal>ms</literal> or <literal>μs</literal>, see
1804 <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry> for
1805 details on the permitted syntax.</para>
1806
1807 <xi:include href="version-info.xml" xpointer="v261"/></listitem>
1808 </varlistentry>
1809 </variablelist>
1810
1811 </refsect2><refsect2><title>Coredump Control</title>
1812
1813 <variablelist class='unit-directives'>
1814
1815 <varlistentry>
1816 <term><varname>CoredumpReceive=</varname></term>
1817
1818 <listitem><para>Takes a boolean argument. This setting is used to enable coredump forwarding for containers
1819 that belong to this unit's cgroup. Units with <varname>CoredumpReceive=yes</varname> must also be configured
1820 with <varname>Delegate=yes</varname>. Defaults to false.</para>
1821
1822 <para>When <command>systemd-coredump</command> is handling a coredump for a process from a container,
1823 if the container's leader process is a descendant of a cgroup with <varname>CoredumpReceive=yes</varname>
1824 and <varname>Delegate=yes</varname>, then <command>systemd-coredump</command> will attempt to forward
1825 the coredump to <command>systemd-coredump</command> within the container. See also
1826 <citerefentry><refentrytitle>systemd-coredump</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
1827
1828 <xi:include href="version-info.xml" xpointer="v255"/></listitem>
1829 </varlistentry>
1830
1831 </variablelist>
1832 </refsect2>
1833 </refsect1>
1834
1835 <refsect1>
1836 <title>History</title>
1837
1838 <variablelist>
1839 <varlistentry>
1840 <term>systemd 252</term>
1841
1842 <listitem><para>Options for controlling the Legacy Control Group Hierarchy (<ulink
1843 url="https://docs.kernel.org/admin-guide/cgroup-v1/index.html">Control Groups version 1</ulink>)
1844 are now fully deprecated:
1845 <varname>CPUShares=<replaceable>weight</replaceable></varname>,
1846 <varname>StartupCPUShares=<replaceable>weight</replaceable></varname>,
1847 <varname>MemoryLimit=<replaceable>bytes</replaceable></varname>,
1848 <varname>BlockIOAccounting=</varname>,
1849 <varname>BlockIOWeight=<replaceable>weight</replaceable></varname>,
1850 <varname>StartupBlockIOWeight=<replaceable>weight</replaceable></varname>,
1851 <varname>BlockIODeviceWeight=<replaceable>device</replaceable>
1852 <replaceable>weight</replaceable></varname>,
1853 <varname>BlockIOReadBandwidth=<replaceable>device</replaceable>
1854 <replaceable>bytes</replaceable></varname>,
1855 <varname>BlockIOWriteBandwidth=<replaceable>device</replaceable> <replaceable>bytes</replaceable></varname>.
1856 Please switch to the unified cgroup hierarchy.</para></listitem>
1857 </varlistentry>
1858 </variablelist>
1859
1860 <variablelist>
1861 <varlistentry>
1862 <term>systemd 258</term>
1863
1864 <listitem><para><varname>CPUAccounting=</varname> setting is deprecated, because it is always available
1865 on the unified cgroup hierarchy and such setting has no effect.</para></listitem>
1866 </varlistentry>
1867 </variablelist>
1868 </refsect1>
1869
1870 <refsect1>
1871 <title>See Also</title>
1872 <para><simplelist type="inline">
1873 <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
1874 <member><citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
1875 <member><citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
1876 <member><citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
1877 <member><citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
1878 <member><citerefentry><refentrytitle>systemd.scope</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
1879 <member><citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
1880 <member><citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
1881 <member><citerefentry><refentrytitle>systemd.swap</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
1882 <member><citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
1883 <member><citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry></member>
1884 <member><citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry></member>
1885 <member><citerefentry><refentrytitle>systemd-oomd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
1886 <member>The documentation for control groups and specific controllers in the Linux kernel:
1887 <ulink url="https://docs.kernel.org/admin-guide/cgroup-v2.html">Control Groups v2</ulink></member>
1888 </simplelist></para>
1889 </refsect1>
1890 </refentry>