systemd.swap.xml revision cd25cce98f5cc930202212c3c9c13605c09698b4
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
12b42c76672a66c2d4ea7212c14f8f1b5a62b78dTom Gundersen<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen This file is part of systemd.
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen Copyright 2010 Lennart Poettering
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen systemd is free software; you can redistribute it and/or modify it
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen under the terms of the GNU General Public License as published by
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen the Free Software Foundation; either version 2 of the License, or
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen (at your option) any later version.
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen systemd is distributed in the hope that it will be useful, but
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen WITHOUT ANY WARRANTY; without even the implied warranty of
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen General Public License for more details.
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen You should have received a copy of the GNU General Public License
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen along with systemd; If not, see <http://www.gnu.org/licenses/>.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <email>lennart@poettering.net</email>
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen </authorgroup>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <refentrytitle>systemd.swap</refentrytitle>
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen <refpurpose>systemd swap configuration files</refpurpose>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <refsynopsisdiv>
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen <para><filename>systemd.swap</filename></para>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek </refsynopsisdiv>
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen <para>A unit configuration file whose name ends in
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <filename>.swap</filename> encodes information about a
12b42c76672a66c2d4ea7212c14f8f1b5a62b78dTom Gundersen swap device or file for memory paging controlled and
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek supervised by systemd.</para>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <para>This man page lists the configuration options
12b42c76672a66c2d4ea7212c14f8f1b5a62b78dTom Gundersen specific to this unit type. See
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek for the common options of all unit configuration
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek files. The common configuration items are configured
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek in the generic [Unit] and [Install] sections. The swap
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek specific configuration options are configured in the
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek [Swap] section.</para>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <para>Swap units must be named after the devices
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek (resp. files) they control. Example: the swap device
12b42c76672a66c2d4ea7212c14f8f1b5a62b78dTom Gundersen <filename>/dev/sda5</filename> must be configured in a
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek unit file <filename>dev-sda5.swap</filename>. For
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek details about the escaping logic used to convert a
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen file system path to a unit name see
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <para>All swap units automatically get the appropriate
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek dependencies on the devices (resp. on the mount points
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek of the files) they are actived from.</para>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <para>Swap units with
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <varname>DefaultDependencies=</varname> enabled
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek implicitly acquire a conflicting dependency to
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <filename>umount.target</filename> so that they are
102bd40e1ed71c7ab980a90435a1c23d4c786c63Lennart Poettering deactivated at shutdown.</para>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <title><filename>fstab</filename></title>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <para>Swap units may either be configured via unit
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen files, or via <filename>/etc/fstab</filename> (see
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek for details).</para>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <para>If a swap device or file is configured in both
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <filename>/etc/fstab</filename> and a unit file the
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek configuration in the latter takes precedence.</para>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <para>Unless the <option>noauto</option> option is set
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek for them all swap units configured in
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <filename>/etc/fstab</filename> are also added as
5256e00e8b9015dd1a976d647fc71dc7efbd8cf8Tom Gundersen requirements to <filename>swap.target</filename>, so
5256e00e8b9015dd1a976d647fc71dc7efbd8cf8Tom Gundersen that they are waited for and activated during
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <para>Swap files must include a [Swap] section, which
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek carries information about the swap device it
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek supervises. A number of options that may be used in
5256e00e8b9015dd1a976d647fc71dc7efbd8cf8Tom Gundersen this section are shared with other unit types. These
5256e00e8b9015dd1a976d647fc71dc7efbd8cf8Tom Gundersen options are documented in
5256e00e8b9015dd1a976d647fc71dc7efbd8cf8Tom Gundersen <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>. The
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek options specific to the [Swap] section of swap units
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek are the following:</para>
5256e00e8b9015dd1a976d647fc71dc7efbd8cf8Tom Gundersen <varlistentry>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <listitem><para>Takes an absolute path
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek of a device node or file to use for
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>swapon</refentrytitle><manvolnum>8</manvolnum></citerefentry>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek for details. If this refers to a
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek device node, a dependency on the
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek respective device unit is
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek automatically created. (See
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>
5256e00e8b9015dd1a976d647fc71dc7efbd8cf8Tom Gundersen for more information.) If this refers
5256e00e8b9015dd1a976d647fc71dc7efbd8cf8Tom Gundersen to a file, a dependency on the
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek respective mount unit is automatically
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek for more information.) This option is
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <term><varname>Priority=</varname></term>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <listitem><para>Swap priority to use
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek when activating the swap device or
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek file. This takes an integer. This
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek setting is optional.</para></listitem>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <term><varname>TimeoutSec=</varname></term>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <listitem><para>Configures the time to
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek wait for the swapon command to
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek finish. If a command does not exit
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek within the configured time the swap
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek will be considered failed and be shut
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek down again. All commands still running
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek will be terminated forcibly via
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek SIGTERM, and after another delay of
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek this time with SIGKILL. (See
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <option>KillMode=</option> below.)
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek Takes a unit-less value in seconds, or
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek a time span value such as "5min
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek 20s". Pass 0 to disable the timeout
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek logic. Defaults to
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <term><varname>KillMode=</varname></term>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek processes of this swap shall be
1ff28eaee33d9d0cee46bd176b6d6f8805c95036Tom Gundersen <para>This option is mostly equivalent
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek to the <option>KillMode=</option>
102bd40e1ed71c7ab980a90435a1c23d4c786c63Lennart Poettering option of service files. See
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
102bd40e1ed71c7ab980a90435a1c23d4c786c63Lennart Poettering </varlistentry>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <listitem><para>Specifies which signal
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek to use when killing a process of this
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek swap. Defaults to SIGTERM.
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <term><varname>SendSIGKILL=</varname></term>
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <listitem><para>Specifies whether to
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek send SIGKILL to remaining processes
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek after a timeout, if the normal
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek shutdown procedure left processes of
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek the swap around. Takes a boolean
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek value. Defaults to "yes".
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
798d3a524ea57aaf40cb53858aaa45ec702f012dZbigniew Jędrzejewski-Szmek <citerefentry><refentrytitle>swapon</refentrytitle><manvolnum>8</manvolnum></citerefentry>