1 <?xml version='
1.0'
?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
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+
8 This file is part of systemd.
10 Copyright 2013 Zbigniew Jędrzejewski-Szmek
12 systemd is free software; you can redistribute it and/or modify it
13 under the terms of the GNU Lesser General Public License as published by
14 the Free Software Foundation; either version 2.1 of the License, or
15 (at your option) any later version.
17 systemd is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 Lesser General Public License for more details.
22 You should have received a copy of the GNU Lesser General Public License
23 along with systemd; If not, see <http://www.gnu.org/licenses/>.
26 <refentry id=
"systemd.slice">
28 <title>systemd.slice
</title>
29 <productname>systemd
</productname>
33 <contrib>Developer
</contrib>
34 <firstname>Lennart
</firstname>
35 <surname>Poettering
</surname>
36 <email>lennart@poettering.net
</email>
42 <refentrytitle>systemd.slice
</refentrytitle>
43 <manvolnum>5</manvolnum>
47 <refname>systemd.slice
</refname>
48 <refpurpose>Slice unit configuration
</refpurpose>
52 <para><filename><replaceable>slice
</replaceable>.slice
</filename></para>
56 <title>Description
</title>
58 <para>A unit configuration file whose name ends in
<literal>.slice
</literal> encodes information about a slice
59 unit. A slice unit is a concept for hierarchically managing resources of a group of processes. This management is
60 performed by creating a node in the Linux Control Group (cgroup) tree. Units that manage processes (primarily scope
61 and service units) may be assigned to a specific slice. For each slice, certain resource limits may be set that
62 apply to all processes of all units contained in that slice. Slices are organized hierarchically in a tree. The
63 name of the slice encodes the location in the tree. The name consists of a dash-separated series of names, which
64 describes the path to the slice from the root slice. The root slice is named
<filename>-.slice
</filename>. Example:
65 <filename>foo-bar.slice
</filename> is a slice that is located within
<filename>foo.slice
</filename>, which in turn
66 is located in the root slice
<filename>-.slice
</filename>.
69 <para>Note that slice units cannot be templated, nor is possible to add multiple names to a slice unit by creating
70 additional symlinks to its unit file.
</para>
72 <para>By default, service and scope units are placed in
73 <filename>system.slice
</filename>, virtual machines and containers
75 <citerefentry><refentrytitle>systemd-machined
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
76 are found in
<filename>machine.slice
</filename>, and user sessions
78 <citerefentry><refentrytitle>systemd-logind
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
79 in
<filename>user.slice
</filename>. See
80 <citerefentry><refentrytitle>systemd.special
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
81 for more information.
</para>
84 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
85 for the common options of all unit configuration
86 files. The common configuration items are configured
87 in the generic [Unit] and [Install] sections. The
88 slice specific configuration options are configured in
89 the [Slice] section. Currently, only generic resource control settings
91 <citerefentry><refentrytitle>systemd.resource-control
</refentrytitle><manvolnum>5</manvolnum></citerefentry> are allowed.
95 url=
"https://www.freedesktop.org/wiki/Software/systemd/ControlGroupInterface/">New
96 Control Group Interfaces
</ulink> for an introduction on how to make
97 use of slice units from programs.
</para>
101 <title>Implicit Dependencies
</title>
103 <para>The following dependencies are implicitly added:
</para>
106 <listitem><para>Slice units automatically gain dependencies of type
107 <varname>After=
</varname> and
<varname>Requires=
</varname> on
108 their immediate parent slice unit.
</para></listitem>
113 <title>Default Dependencies
</title>
115 <para>The following dependencies are added unless
<varname>DefaultDependencies=no
</varname> is set:
</para>
118 <listitem><para>Slice units will automatically have dependencies of type
<varname>Conflicts=
</varname> and
119 <varname>Before=
</varname> on
120 <filename>shutdown.target
</filename>. These ensure that slice units are removed prior to system shutdown.
121 Only slice units involved with late system shutdown should disable
122 <varname>DefaultDependencies=
</varname> option.
</para></listitem>
127 <title>See Also
</title>
129 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
130 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
131 <citerefentry><refentrytitle>systemd.resource-control
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
132 <citerefentry><refentrytitle>systemd.service
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
133 <citerefentry><refentrytitle>systemd.scope
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
134 <citerefentry><refentrytitle>systemd.special
</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
135 <citerefentry><refentrytitle>systemd.directives
</refentrytitle><manvolnum>7</manvolnum></citerefentry>