chiark / gitweb /
man: document preset files
[elogind.git] / man / systemd.swap.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
3 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
4         "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
5
6 <!--
7   This file is part of systemd.
8
9   Copyright 2010 Lennart Poettering
10
11   systemd is free software; you can redistribute it and/or modify it
12   under the terms of the GNU Lesser General Public License as published by
13   the Free Software Foundation; either version 2.1 of the License, or
14   (at your option) any later version.
15
16   systemd is distributed in the hope that it will be useful, but
17   WITHOUT ANY WARRANTY; without even the implied warranty of
18   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19   Lesser General Public License for more details.
20
21   You should have received a copy of the GNU Lesser General Public License
22   along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 -->
24
25 <refentry id="systemd.swap">
26         <refentryinfo>
27                 <title>systemd.swap</title>
28                 <productname>systemd</productname>
29
30                 <authorgroup>
31                         <author>
32                                 <contrib>Developer</contrib>
33                                 <firstname>Lennart</firstname>
34                                 <surname>Poettering</surname>
35                                 <email>lennart@poettering.net</email>
36                         </author>
37                 </authorgroup>
38         </refentryinfo>
39
40         <refmeta>
41                 <refentrytitle>systemd.swap</refentrytitle>
42                 <manvolnum>5</manvolnum>
43         </refmeta>
44
45         <refnamediv>
46                 <refname>systemd.swap</refname>
47                 <refpurpose>systemd swap configuration files</refpurpose>
48         </refnamediv>
49
50         <refsynopsisdiv>
51                 <para><filename>systemd.swap</filename></para>
52         </refsynopsisdiv>
53
54         <refsect1>
55                 <title>Description</title>
56
57                 <para>A unit configuration file whose name ends in
58                 <filename>.swap</filename> encodes information about a
59                 swap device or file for memory paging controlled and
60                 supervised by systemd.</para>
61
62                 <para>This man page lists the configuration options
63                 specific to this unit type. See
64                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
65                 for the common options of all unit configuration
66                 files. The common configuration items are configured
67                 in the generic [Unit] and [Install] sections. The swap
68                 specific configuration options are configured in the
69                 [Swap] section.</para>
70
71                 <para>Swap units must be named after the devices
72                 (resp. files) they control. Example: the swap device
73                 <filename>/dev/sda5</filename> must be configured in a
74                 unit file <filename>dev-sda5.swap</filename>. For
75                 details about the escaping logic used to convert a
76                 file system path to a unit name see
77                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
78
79                 <para>All swap units automatically get the appropriate
80                 dependencies on the devices (resp. on the mount points
81                 of the files) they are activated from.</para>
82
83                 <para>Swap units with
84                 <varname>DefaultDependencies=</varname> enabled
85                 implicitly acquire a conflicting dependency to
86                 <filename>umount.target</filename> so that they are
87                 deactivated at shutdown.</para>
88         </refsect1>
89
90         <refsect1>
91                 <title><filename>fstab</filename></title>
92
93                 <para>Swap units may either be configured via unit
94                 files, or via <filename>/etc/fstab</filename> (see
95                 <citerefentry><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>
96                 for details). Swaps listed in
97                 <filename>/etc/fstab</filename> will be converted into
98                 native units dynamically at boot and when the
99                 configuration of the system manager is
100                 reloaded. See
101                 <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>
102                 for details about the conversion.</para>
103
104                 <para>If a swap device or file is configured in both
105                 <filename>/etc/fstab</filename> and a unit file the
106                 configuration in the latter takes precedence.</para>
107
108                 <para>Unless the <option>noauto</option> option is set
109                 for them all swap units configured in
110                 <filename>/etc/fstab</filename> are also added as
111                 requirements to <filename>swap.target</filename>, so
112                 that they are waited for and activated during
113                 boot.</para>
114         </refsect1>
115
116         <refsect1>
117                 <title>Options</title>
118
119                 <para>Swap files must include a [Swap] section, which
120                 carries information about the swap device it
121                 supervises. A number of options that may be used in
122                 this section are shared with other unit types. These
123                 options are documented in
124                 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>. The
125                 options specific to the [Swap] section of swap units
126                 are the following:</para>
127
128                 <variablelist>
129
130                         <varlistentry>
131                                 <term><varname>What=</varname></term>
132                                 <listitem><para>Takes an absolute path
133                                 of a device node or file to use for
134                                 paging. See
135                                 <citerefentry><refentrytitle>swapon</refentrytitle><manvolnum>8</manvolnum></citerefentry>
136                                 for details. If this refers to a
137                                 device node, a dependency on the
138                                 respective device unit is
139                                 automatically created. (See
140                                 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>
141                                 for more information.) If this refers
142                                 to a file, a dependency on the
143                                 respective mount unit is automatically
144                                 created. (See
145                                 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
146                                 for more information.) This option is
147                                 mandatory.</para></listitem>
148                         </varlistentry>
149
150                         <varlistentry>
151                                 <term><varname>Priority=</varname></term>
152
153                                 <listitem><para>Swap priority to use
154                                 when activating the swap device or
155                                 file. This takes an integer. This
156                                 setting is optional.</para></listitem>
157                         </varlistentry>
158
159                         <varlistentry>
160                                 <term><varname>TimeoutSec=</varname></term>
161                                 <listitem><para>Configures the time to
162                                 wait for the swapon command to
163                                 finish. If a command does not exit
164                                 within the configured time the swap
165                                 will be considered failed and be shut
166                                 down again. All commands still running
167                                 will be terminated forcibly via
168                                 SIGTERM, and after another delay of
169                                 this time with SIGKILL. (See
170                                 <option>KillMode=</option> below.)
171                                 Takes a unit-less value in seconds, or
172                                 a time span value such as "5min
173                                 20s". Pass 0 to disable the timeout
174                                 logic. Defaults to
175                                 90s.</para></listitem>
176                         </varlistentry>
177
178                         <varlistentry>
179                                 <term><varname>KillMode=</varname></term>
180                                 <listitem><para>Specifies how
181                                 processes of this swap shall be
182                                 killed. One of
183                                 <option>control-group</option>,
184                                 <option>process</option>,
185                                 <option>none</option>.</para>
186
187                                 <para>This option is mostly equivalent
188                                 to the <option>KillMode=</option>
189                                 option of service files. See
190                                 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
191                                 for details.</para></listitem>
192                         </varlistentry>
193
194                         <varlistentry>
195                                 <term><varname>KillSignal=</varname></term>
196                                 <listitem><para>Specifies which signal
197                                 to use when killing a process of this
198                                 swap. Defaults to SIGTERM.
199                                 </para></listitem>
200                         </varlistentry>
201
202                         <varlistentry>
203                                 <term><varname>SendSIGKILL=</varname></term>
204                                 <listitem><para>Specifies whether to
205                                 send SIGKILL to remaining processes
206                                 after a timeout, if the normal
207                                 shutdown procedure left processes of
208                                 the swap around. Takes a boolean
209                                 value. Defaults to "yes".
210                                 </para></listitem>
211                         </varlistentry>
212                 </variablelist>
213         </refsect1>
214
215         <refsect1>
216                   <title>See Also</title>
217                   <para>
218                           <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
219                           <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
220                           <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
221                           <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
222                           <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
223                           <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
224                           <citerefentry><refentrytitle>swapon</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
225                           <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>
226                   </para>
227         </refsect1>
228
229 </refentry>