Lennart Poettering | e0cabd4 | 2010-07-02 01:33:54 +0200 | [diff] [blame] | 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 |
Lennart Poettering | 5430f7f | 2012-04-12 00:20:58 +0200 | [diff] [blame^] | 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 |
Lennart Poettering | e0cabd4 | 2010-07-02 01:33:54 +0200 | [diff] [blame] | 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 |
Lennart Poettering | 5430f7f | 2012-04-12 00:20:58 +0200 | [diff] [blame^] | 19 | Lesser General Public License for more details. |
Lennart Poettering | e0cabd4 | 2010-07-02 01:33:54 +0200 | [diff] [blame] | 20 | |
Lennart Poettering | 5430f7f | 2012-04-12 00:20:58 +0200 | [diff] [blame^] | 21 | You should have received a copy of the GNU Lesser General Public License |
Lennart Poettering | e0cabd4 | 2010-07-02 01:33:54 +0200 | [diff] [blame] | 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 | |
Lennart Poettering | f927685 | 2011-03-28 21:36:13 +0200 | [diff] [blame] | 71 | <para>Swap units must be named after the devices |
| 72 | (resp. files) they control. Example: the swap device |
Lennart Poettering | e0cabd4 | 2010-07-02 01:33:54 +0200 | [diff] [blame] | 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> |
Lennart Poettering | f927685 | 2011-03-28 21:36:13 +0200 | [diff] [blame] | 78 | |
| 79 | <para>All swap units automatically get the appropriate |
| 80 | dependencies on the devices (resp. on the mount points |
Ville Skyttä | 9f7dad7 | 2011-06-18 16:40:20 +0300 | [diff] [blame] | 81 | of the files) they are activated from.</para> |
Lennart Poettering | f927685 | 2011-03-28 21:36:13 +0200 | [diff] [blame] | 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> |
Lennart Poettering | e0cabd4 | 2010-07-02 01:33:54 +0200 | [diff] [blame] | 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).</para> |
| 97 | |
| 98 | <para>If a swap device or file is configured in both |
| 99 | <filename>/etc/fstab</filename> and a unit file the |
| 100 | configuration in the latter takes precedence.</para> |
Lennart Poettering | f927685 | 2011-03-28 21:36:13 +0200 | [diff] [blame] | 101 | |
| 102 | <para>Unless the <option>noauto</option> option is set |
| 103 | for them all swap units configured in |
| 104 | <filename>/etc/fstab</filename> are also added as |
| 105 | requirements to <filename>swap.target</filename>, so |
| 106 | that they are waited for and activated during |
| 107 | boot.</para> |
Lennart Poettering | e0cabd4 | 2010-07-02 01:33:54 +0200 | [diff] [blame] | 108 | </refsect1> |
| 109 | |
| 110 | <refsect1> |
| 111 | <title>Options</title> |
| 112 | |
| 113 | <para>Swap files must include a [Swap] section, which |
| 114 | carries information about the swap device it |
Lennart Poettering | 2292707 | 2011-01-18 00:40:10 +0100 | [diff] [blame] | 115 | supervises. A number of options that may be used in |
| 116 | this section are shared with other unit types. These |
| 117 | options are documented in |
| 118 | <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>. The |
| 119 | options specific to the [Swap] section of swap units |
| 120 | are the following:</para> |
Lennart Poettering | e0cabd4 | 2010-07-02 01:33:54 +0200 | [diff] [blame] | 121 | |
| 122 | <variablelist> |
| 123 | |
| 124 | <varlistentry> |
| 125 | <term><varname>What=</varname></term> |
| 126 | <listitem><para>Takes an absolute path |
| 127 | of a device node or file to use for |
| 128 | paging. See |
| 129 | <citerefentry><refentrytitle>swapon</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
| 130 | for details. If this refers to a |
Kay Sievers | b439c6e | 2010-07-02 09:51:25 +0200 | [diff] [blame] | 131 | device node, a dependency on the |
Lennart Poettering | e0cabd4 | 2010-07-02 01:33:54 +0200 | [diff] [blame] | 132 | respective device unit is |
| 133 | automatically created. (See |
| 134 | <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
| 135 | for more information.) If this refers |
Kay Sievers | b439c6e | 2010-07-02 09:51:25 +0200 | [diff] [blame] | 136 | to a file, a dependency on the |
Lennart Poettering | e0cabd4 | 2010-07-02 01:33:54 +0200 | [diff] [blame] | 137 | respective mount unit is automatically |
| 138 | created. (See |
| 139 | <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
| 140 | for more information.) This option is |
| 141 | mandatory.</para></listitem> |
| 142 | </varlistentry> |
| 143 | |
| 144 | <varlistentry> |
| 145 | <term><varname>Priority=</varname></term> |
| 146 | |
| 147 | <listitem><para>Swap priority to use |
| 148 | when activating the swap device or |
| 149 | file. This takes an integer. This |
| 150 | setting is optional.</para></listitem> |
| 151 | </varlistentry> |
Lennart Poettering | 2292707 | 2011-01-18 00:40:10 +0100 | [diff] [blame] | 152 | |
| 153 | <varlistentry> |
| 154 | <term><varname>TimeoutSec=</varname></term> |
| 155 | <listitem><para>Configures the time to |
| 156 | wait for the swapon command to |
| 157 | finish. If a command does not exit |
| 158 | within the configured time the swap |
| 159 | will be considered failed and be shut |
| 160 | down again. All commands still running |
| 161 | will be terminated forcibly via |
| 162 | SIGTERM, and after another delay of |
| 163 | this time with SIGKILL. (See |
| 164 | <option>KillMode=</option> below.) |
| 165 | Takes a unit-less value in seconds, or |
| 166 | a time span value such as "5min |
| 167 | 20s". Pass 0 to disable the timeout |
| 168 | logic. Defaults to |
Lennart Poettering | ecb963c | 2011-04-27 22:29:29 +0200 | [diff] [blame] | 169 | 90s.</para></listitem> |
Lennart Poettering | 2292707 | 2011-01-18 00:40:10 +0100 | [diff] [blame] | 170 | </varlistentry> |
| 171 | |
| 172 | <varlistentry> |
| 173 | <term><varname>KillMode=</varname></term> |
| 174 | <listitem><para>Specifies how |
| 175 | processes of this swap shall be |
| 176 | killed. One of |
| 177 | <option>control-group</option>, |
Lennart Poettering | 2292707 | 2011-01-18 00:40:10 +0100 | [diff] [blame] | 178 | <option>process</option>, |
| 179 | <option>none</option>.</para> |
| 180 | |
| 181 | <para>This option is mostly equivalent |
| 182 | to the <option>KillMode=</option> |
| 183 | option of service files. See |
| 184 | <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
| 185 | for details.</para></listitem> |
| 186 | </varlistentry> |
| 187 | |
| 188 | <varlistentry> |
| 189 | <term><varname>KillSignal=</varname></term> |
| 190 | <listitem><para>Specifies which signal |
| 191 | to use when killing a process of this |
| 192 | swap. Defaults to SIGTERM. |
| 193 | </para></listitem> |
| 194 | </varlistentry> |
Lennart Poettering | ba035df | 2011-01-18 22:55:54 +0100 | [diff] [blame] | 195 | |
| 196 | <varlistentry> |
| 197 | <term><varname>SendSIGKILL=</varname></term> |
| 198 | <listitem><para>Specifies whether to |
| 199 | send SIGKILL to remaining processes |
| 200 | after a timeout, if the normal |
| 201 | shutdown procedure left processes of |
| 202 | the swap around. Takes a boolean |
| 203 | value. Defaults to "yes". |
| 204 | </para></listitem> |
| 205 | </varlistentry> |
Lennart Poettering | e0cabd4 | 2010-07-02 01:33:54 +0200 | [diff] [blame] | 206 | </variablelist> |
| 207 | </refsect1> |
| 208 | |
| 209 | <refsect1> |
| 210 | <title>See Also</title> |
| 211 | <para> |
Lennart Poettering | f3e219a | 2010-07-07 01:38:56 +0200 | [diff] [blame] | 212 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
Lennart Poettering | e0cabd4 | 2010-07-02 01:33:54 +0200 | [diff] [blame] | 213 | <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
| 214 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
Lennart Poettering | 2292707 | 2011-01-18 00:40:10 +0100 | [diff] [blame] | 215 | <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
Lennart Poettering | e0cabd4 | 2010-07-02 01:33:54 +0200 | [diff] [blame] | 216 | <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
| 217 | <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
| 218 | <citerefentry><refentrytitle>swapon</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
| 219 | </para> |
| 220 | </refsect1> |
| 221 | |
| 222 | </refentry> |