]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd.swap.xml
Typo fixes
[thirdparty/systemd.git] / man / systemd.swap.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
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 This file is part of systemd.
7
8 Copyright 2010 Lennart Poettering
9
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 -->
23
24 <refentry id="systemd.swap">
25 <refentryinfo>
26 <title>systemd.swap</title>
27 <productname>systemd</productname>
28
29 <authorgroup>
30 <author>
31 <contrib>Developer</contrib>
32 <firstname>Lennart</firstname>
33 <surname>Poettering</surname>
34 <email>lennart@poettering.net</email>
35 </author>
36 </authorgroup>
37 </refentryinfo>
38
39 <refmeta>
40 <refentrytitle>systemd.swap</refentrytitle>
41 <manvolnum>5</manvolnum>
42 </refmeta>
43
44 <refnamediv>
45 <refname>systemd.swap</refname>
46 <refpurpose>Swap unit configuration</refpurpose>
47 </refnamediv>
48
49 <refsynopsisdiv>
50 <para><filename><replaceable>swap</replaceable>.swap</filename></para>
51 </refsynopsisdiv>
52
53 <refsect1>
54 <title>Description</title>
55
56 <para>A unit configuration file whose name ends in
57 <literal>.swap</literal> encodes information about a swap device
58 or file for memory paging controlled and supervised by
59 systemd.</para>
60
61 <para>This man page lists the configuration options specific to
62 this unit type. See
63 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
64 for the common options of all unit configuration files. The common
65 configuration items are configured in the generic [Unit] and
66 [Install] sections. The swap specific configuration options are
67 configured in the [Swap] section.</para>
68
69 <para>Additional options are listed in
70 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
71 which define the execution environment the <citerefentry
72 project='man-pages'><refentrytitle>swapon</refentrytitle><manvolnum>8</manvolnum></citerefentry>
73 binary is executed in, in
74 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
75 which define the way these processes are
76 terminated, and in
77 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
78 which configure resource control settings for these processes of the
79 unit.</para>
80
81 <para>Swap units must be named after the devices
82 or files they control. Example: the swap device
83 <filename noindex='true'>/dev/sda5</filename> must be configured in a
84 unit file <filename>dev-sda5.swap</filename>. For details about
85 the escaping logic used to convert a file system path to a unit
86 name, see
87 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
88 </refsect1>
89
90 <refsect1>
91 <title>Automatic Dependencies</title>
92
93 <para>All swap units automatically get the
94 <varname>BindsTo=</varname> and <varname>After=</varname>
95 dependencies on the device units or the mount units of the files
96 they are activated from.</para>
97
98 <para>Swap units with <varname>DefaultDependencies=</varname>
99 enabled implicitly acquire a <varname>Conflicts=</varname> and an
100 <varname>After=</varname> dependency on
101 <filename>umount.target</filename> so that they are deactivated at
102 shutdown, unless <varname>DefaultDependencies=no</varname> is
103 specified.</para>
104
105 <para>Additional implicit dependencies may be added as result of
106 execution and resource control parameters as documented in
107 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
108 and
109 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
110 </refsect1>
111
112 <refsect1>
113 <title><filename>fstab</filename></title>
114
115 <para>Swap units may either be configured via unit files, or via
116 <filename>/etc/fstab</filename> (see
117 <citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>
118 for details). Swaps listed in <filename>/etc/fstab</filename> will
119 be converted into native units dynamically at boot and when the
120 configuration of the system manager is reloaded. See
121 <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>
122 for details about the conversion.</para>
123
124 <para>If a swap device or file is configured in both
125 <filename>/etc/fstab</filename> and a unit file, the configuration
126 in the latter takes precedence.</para>
127
128 <para>When reading <filename>/etc/fstab</filename>, a few special
129 options are understood by systemd which influence how dependencies
130 are created for swap units.</para>
131
132 <variablelist class='fstab-options'>
133 <varlistentry>
134 <term><option>noauto</option></term>
135 <term><option>auto</option></term>
136
137 <listitem><para>With <option>noauto</option>, the swap unit
138 will not be added as a dependency for
139 <filename>swap.target</filename>. This means that it will not
140 be activated automatically during boot, unless it is pulled in
141 by some other unit. The <option>auto</option> option has the
142 opposite meaning and is the default.</para>
143 </listitem>
144 </varlistentry>
145
146 <varlistentry>
147 <term><option>nofail</option></term>
148
149 <listitem><para>With <option>nofail</option>, the swap unit
150 will be only wanted, not required by
151 <filename>swap.target</filename>. This means that the boot
152 will continue even if this swap device is not activated
153 successfully.</para>
154 </listitem>
155 </varlistentry>
156 </variablelist>
157 </refsect1>
158
159 <refsect1>
160 <title>Options</title>
161
162 <para>Swap files must include a [Swap] section, which carries
163 information about the swap device it supervises. A number of
164 options that may be used in this section are shared with other
165 unit types. These options are documented in
166 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
167 and
168 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
169 The options specific to the [Swap] section of swap units are the
170 following:</para>
171
172 <variablelist class='unit-directives'>
173
174 <varlistentry>
175 <term><varname>What=</varname></term>
176 <listitem><para>Takes an absolute path of a device node or
177 file to use for paging. See
178 <citerefentry project='man-pages'><refentrytitle>swapon</refentrytitle><manvolnum>8</manvolnum></citerefentry>
179 for details. If this refers to a device node, a dependency on
180 the respective device unit is automatically created. (See
181 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>
182 for more information.) If this refers to a file, a dependency
183 on the respective mount unit is automatically created. (See
184 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
185 for more information.) This option is
186 mandatory.</para></listitem>
187 </varlistentry>
188
189 <varlistentry>
190 <term><varname>Priority=</varname></term>
191
192 <listitem><para>Swap priority to use when activating the swap
193 device or file. This takes an integer. This setting is
194 optional and ignored when the priority is set by <option>pri=</option> in the
195 <varname>Options=</varname> key.</para></listitem>
196 </varlistentry>
197
198 <varlistentry>
199 <term><varname>Options=</varname></term>
200
201 <listitem><para>May contain an option string for the swap
202 device. This may be used for controlling discard options among
203 other functionality, if the swap backing device supports the
204 discard or trim operation. (See
205 <citerefentry project='man-pages'><refentrytitle>swapon</refentrytitle><manvolnum>8</manvolnum></citerefentry>
206 for more information.) </para></listitem>
207 </varlistentry>
208
209 <varlistentry>
210 <term><varname>TimeoutSec=</varname></term>
211 <listitem><para>Configures the time to wait for the swapon
212 command to finish. If a command does not exit within the
213 configured time, the swap will be considered failed and be
214 shut down again. All commands still running will be terminated
215 forcibly via <constant>SIGTERM</constant>, and after another
216 delay of this time with <constant>SIGKILL</constant>. (See
217 <option>KillMode=</option> in
218 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>.)
219 Takes a unit-less value in seconds, or a time span value such
220 as "5min 20s". Pass <literal>0</literal> to disable the
221 timeout logic. Defaults to
222 <varname>DefaultTimeoutStartSec=</varname> from the manager
223 configuration file (see
224 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
225 </para></listitem>
226 </varlistentry>
227 </variablelist>
228
229 <para>Check
230 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
231 and
232 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>
233 for more settings.</para>
234 </refsect1>
235
236 <refsect1>
237 <title>See Also</title>
238 <para>
239 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
240 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
241 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
242 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
243 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
244 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
245 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
246 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
247 <citerefentry project='man-pages'><refentrytitle>swapon</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
248 <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
249 <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>
250 </para>
251 </refsect1>
252
253 </refentry>