2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 SPDX-License-Identifier: LGPL-2.1+
9 <refentry id=
"systemd.slice">
11 <title>systemd.slice
</title>
12 <productname>systemd
</productname>
16 <refentrytitle>systemd.slice
</refentrytitle>
17 <manvolnum>5</manvolnum>
21 <refname>systemd.slice
</refname>
22 <refpurpose>Slice unit configuration
</refpurpose>
26 <para><filename><replaceable>slice
</replaceable>.slice
</filename></para>
30 <title>Description
</title>
32 <para>A unit configuration file whose name ends in
<literal>.slice
</literal> encodes information about a slice
33 unit. A slice unit is a concept for hierarchically managing resources of a group of processes. This management is
34 performed by creating a node in the Linux Control Group (cgroup) tree. Units that manage processes (primarily scope
35 and service units) may be assigned to a specific slice. For each slice, certain resource limits may be set that
36 apply to all processes of all units contained in that slice. Slices are organized hierarchically in a tree. The
37 name of the slice encodes the location in the tree. The name consists of a dash-separated series of names, which
38 describes the path to the slice from the root slice. The root slice is named
<filename>-.slice
</filename>. Example:
39 <filename>foo-bar.slice
</filename> is a slice that is located within
<filename>foo.slice
</filename>, which in turn
40 is located in the root slice
<filename>-.slice
</filename>.
43 <para>Note that slice units cannot be templated, nor is possible to add multiple names to a slice unit by creating
44 additional symlinks to its unit file.
</para>
46 <para>By default, service and scope units are placed in
47 <filename>system.slice
</filename>, virtual machines and containers
49 <citerefentry><refentrytitle>systemd-machined
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
50 are found in
<filename>machine.slice
</filename>, and user sessions
52 <citerefentry><refentrytitle>systemd-logind
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
53 in
<filename>user.slice
</filename>. See
54 <citerefentry><refentrytitle>systemd.special
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
55 for more information.
</para>
58 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
59 for the common options of all unit configuration
60 files. The common configuration items are configured
61 in the generic [Unit] and [Install] sections. The
62 slice specific configuration options are configured in
63 the [Slice] section. Currently, only generic resource control settings
65 <citerefentry><refentrytitle>systemd.resource-control
</refentrytitle><manvolnum>5</manvolnum></citerefentry> are allowed.
69 url=
"https://www.freedesktop.org/wiki/Software/systemd/ControlGroupInterface/">New
70 Control Group Interfaces
</ulink> for an introduction on how to make
71 use of slice units from programs.
</para>
75 <title>Automatic Dependencies
</title>
78 <title>Implicit Dependencies
</title>
80 <para>The following dependencies are implicitly added:
</para>
83 <listitem><para>Slice units automatically gain dependencies of type
84 <varname>After=
</varname> and
<varname>Requires=
</varname> on
85 their immediate parent slice unit.
</para></listitem>
90 <title>Default Dependencies
</title>
92 <para>The following dependencies are added unless
<varname>DefaultDependencies=no
</varname> is set:
</para>
95 <listitem><para>Slice units will automatically have dependencies of type
<varname>Conflicts=
</varname> and
96 <varname>Before=
</varname> on
97 <filename>shutdown.target
</filename>. These ensure that slice units are removed prior to system shutdown.
98 Only slice units involved with late system shutdown should disable
99 <varname>DefaultDependencies=
</varname> option.
</para></listitem>
105 <title>See Also
</title>
107 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
108 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
109 <citerefentry><refentrytitle>systemd.resource-control
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
110 <citerefentry><refentrytitle>systemd.service
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
111 <citerefentry><refentrytitle>systemd.scope
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
112 <citerefentry><refentrytitle>systemd.special
</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
113 <citerefentry><refentrytitle>systemd.directives
</refentrytitle><manvolnum>7</manvolnum></citerefentry>