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.2/docbookx.dtd">
4<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
5
6<refentry id="systemd.slice">
7  <refentryinfo>
8    <title>systemd.slice</title>
9    <productname>systemd</productname>
10  </refentryinfo>
11
12  <refmeta>
13    <refentrytitle>systemd.slice</refentrytitle>
14    <manvolnum>5</manvolnum>
15  </refmeta>
16
17  <refnamediv>
18    <refname>systemd.slice</refname>
19    <refpurpose>Slice unit configuration</refpurpose>
20  </refnamediv>
21
22  <refsynopsisdiv>
23    <para><filename><replaceable>slice</replaceable>.slice</filename></para>
24  </refsynopsisdiv>
25
26  <refsect1>
27    <title>Description</title>
28
29    <para>A unit configuration file whose name ends in <literal>.slice</literal> encodes information about a slice
30    unit. A slice unit is a concept for hierarchically managing resources of a group of processes. This management is
31    performed by creating a node in the Linux Control Group (cgroup) tree. Units that manage processes (primarily scope
32    and service units) may be assigned to a specific slice. For each slice, certain resource limits may be set that
33    apply to all processes of all units contained in that slice. Slices are organized hierarchically in a tree. The
34    name of the slice encodes the location in the tree. The name consists of a dash-separated series of names, which
35    describes the path to the slice from the root slice. The root slice is named <filename>-.slice</filename>. Example:
36    <filename>foo-bar.slice</filename> is a slice that is located within <filename>foo.slice</filename>, which in turn
37    is located in the root slice <filename>-.slice</filename>.
38    </para>
39
40    <para>Note that slice units cannot be templated, nor is possible to add multiple names to a slice unit by creating
41    additional symlinks to its unit file.</para>
42
43    <para>By default, service and scope units are placed in
44    <filename>system.slice</filename>, virtual machines and containers
45    registered with
46    <citerefentry><refentrytitle>systemd-machined</refentrytitle><manvolnum>8</manvolnum></citerefentry>
47    are found in <filename>machine.slice</filename>, and user sessions
48    handled by
49    <citerefentry><refentrytitle>systemd-logind</refentrytitle><manvolnum>8</manvolnum></citerefentry>
50    in <filename>user.slice</filename>. See
51    <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>
52    for more information.</para>
53
54    <para>See
55    <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
56    for the common options of all unit configuration
57    files. The common configuration items are configured
58    in the generic [Unit] and [Install] sections. The
59    slice specific configuration options are configured in
60    the [Slice] section. Currently, only generic resource control settings
61    as described in
62    <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry> are allowed.
63    </para>
64
65    <para>See the <ulink
66    url="https://www.freedesktop.org/wiki/Software/systemd/ControlGroupInterface/">New
67    Control Group Interfaces</ulink> for an introduction on how to make
68    use of slice units from programs.</para>
69  </refsect1>
70
71  <refsect1>
72    <title>Automatic Dependencies</title>
73
74    <refsect2>
75      <title>Implicit Dependencies</title>
76
77      <para>The following dependencies are implicitly added:</para>
78
79      <itemizedlist>
80        <listitem><para>Slice units automatically gain dependencies of type
81        <varname>After=</varname> and <varname>Requires=</varname> on
82        their immediate parent slice unit.</para></listitem>
83      </itemizedlist>
84    </refsect2>
85
86    <refsect2>
87      <title>Default Dependencies</title>
88
89      <para>The following dependencies are added unless <varname>DefaultDependencies=no</varname> is set:</para>
90
91      <itemizedlist>
92        <listitem><para>Slice units will automatically have dependencies of type <varname>Conflicts=</varname> and
93        <varname>Before=</varname> on
94        <filename>shutdown.target</filename>. These ensure that slice units are removed prior to system shutdown.
95        Only slice units involved with late system shutdown should disable
96        <varname>DefaultDependencies=</varname> option.</para></listitem>
97      </itemizedlist>
98    </refsect2>
99  </refsect1>
100
101  <refsect1>
102    <title>Options</title>
103
104    <para>Slice unit files may include [Unit] and [Install] sections, which are described in
105    <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
106    No options specific to this file type are supported.</para>
107  </refsect1>
108
109  <refsect1>
110    <title>See Also</title>
111    <para>
112      <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
113      <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
114      <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
115      <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
116      <citerefentry><refentrytitle>systemd.scope</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
117      <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
118      <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>
119    </para>
120  </refsect1>
121
122</refentry>
123