]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd.slice.xml
verify: use manager_load_startable_unit_or_warn() to load units for verification
[thirdparty/systemd.git] / man / systemd.slice.xml
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">
4
5 <!--
6 SPDX-License-Identifier: LGPL-2.1+
7
8 This file is part of systemd.
9
10 Copyright 2013 Zbigniew Jędrzejewski-Szmek
11
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.
16
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.
21
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/>.
24 -->
25
26 <refentry id="systemd.slice">
27 <refentryinfo>
28 <title>systemd.slice</title>
29 <productname>systemd</productname>
30
31 <authorgroup>
32 <author>
33 <contrib>Developer</contrib>
34 <firstname>Lennart</firstname>
35 <surname>Poettering</surname>
36 <email>lennart@poettering.net</email>
37 </author>
38 </authorgroup>
39 </refentryinfo>
40
41 <refmeta>
42 <refentrytitle>systemd.slice</refentrytitle>
43 <manvolnum>5</manvolnum>
44 </refmeta>
45
46 <refnamediv>
47 <refname>systemd.slice</refname>
48 <refpurpose>Slice unit configuration</refpurpose>
49 </refnamediv>
50
51 <refsynopsisdiv>
52 <para><filename><replaceable>slice</replaceable>.slice</filename></para>
53 </refsynopsisdiv>
54
55 <refsect1>
56 <title>Description</title>
57
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>.
67 </para>
68
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>
71
72 <para>By default, service and scope units are placed in
73 <filename>system.slice</filename>, virtual machines and containers
74 registered with
75 <citerefentry><refentrytitle>systemd-machined</refentrytitle><manvolnum>1</manvolnum></citerefentry>
76 are found in <filename>machine.slice</filename>, and user sessions
77 handled by
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>
82
83 <para>See
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
90 as described in
91 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry> are allowed.
92 </para>
93
94 <para>See the <ulink
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>
98 </refsect1>
99
100 <refsect1>
101 <title>Implicit Dependencies</title>
102
103 <para>The following dependencies are implicitly added:</para>
104
105 <itemizedlist>
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>
109 </itemizedlist>
110 </refsect1>
111
112 <refsect1>
113 <title>Default Dependencies</title>
114
115 <para>The following dependencies are added unless <varname>DefaultDependencies=no</varname> is set:</para>
116
117 <itemizedlist>
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>
123 </itemizedlist>
124 </refsect1>
125
126 <refsect1>
127 <title>See Also</title>
128 <para>
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>
136 </para>
137 </refsect1>
138
139 </refentry>