1SYSTEMD.SWAP(5)                  systemd.swap                  SYSTEMD.SWAP(5)
2
3
4

NAME

6       systemd.swap - Swap unit configuration
7

SYNOPSIS

9       swap.swap
10

DESCRIPTION

12       A unit configuration file whose name ends in ".swap" encodes
13       information about a swap device or file for memory paging controlled
14       and supervised by systemd.
15
16       This man page lists the configuration options specific to this unit
17       type. See systemd.unit(5) for the common options of all unit
18       configuration files. The common configuration items are configured in
19       the generic [Unit] and [Install] sections. The swap specific
20       configuration options are configured in the [Swap] section.
21
22       Additional options are listed in systemd.exec(5), which define the
23       execution environment the swapon(8) program is executed in, in
24       systemd.kill(5), which define the way these processes are terminated,
25       and in systemd.resource-control(5), which configure resource control
26       settings for these processes of the unit.
27
28       Swap units must be named after the devices or files they control.
29       Example: the swap device /dev/sda5 must be configured in a unit file
30       dev-sda5.swap. For details about the escaping logic used to convert a
31       file system path to a unit name, see systemd.unit(5). Note that swap
32       units cannot be templated, nor is possible to add multiple names to a
33       swap unit by creating additional symlinks to it.
34

AUTOMATIC DEPENDENCIES

36   Implicit Dependencies
37       The following dependencies are implicitly added:
38
39       ·   All swap units automatically get the BindsTo= and After=
40           dependencies on the device units or the mount units of the files
41           they are activated from.
42
43       Additional implicit dependencies may be added as result of execution
44       and resource control parameters as documented in systemd.exec(5) and
45       systemd.resource-control(5).
46
47   Default Dependencies
48       The following dependencies are added unless DefaultDependencies=no is
49       set:
50
51       ·   Swap units automatically acquire a Conflicts= and a Before=
52           dependency on umount.target so that they are deactivated at
53           shutdown as well as a Before=swap.target dependency.
54

FSTAB

56       Swap units may either be configured via unit files, or via /etc/fstab
57       (see fstab(5) for details). Swaps listed in /etc/fstab will be
58       converted into native units dynamically at boot and when the
59       configuration of the system manager is reloaded. See systemd-fstab-
60       generator(8) for details about the conversion.
61
62       If a swap device or file is configured in both /etc/fstab and a unit
63       file, the configuration in the latter takes precedence.
64
65       When reading /etc/fstab, a few special options are understood by
66       systemd which influence how dependencies are created for swap units.
67
68       noauto, auto
69           With noauto, the swap unit will not be added as a dependency for
70           swap.target. This means that it will not be activated automatically
71           during boot, unless it is pulled in by some other unit. The auto
72           option has the opposite meaning and is the default.
73
74       nofail
75           With nofail, the swap unit will be only wanted, not required by
76           swap.target. This means that the boot will continue even if this
77           swap device is not activated successfully.
78

OPTIONS

80       Swap files must include a [Swap] section, which carries information
81       about the swap device it supervises. A number of options that may be
82       used in this section are shared with other unit types. These options
83       are documented in systemd.exec(5) and systemd.kill(5). The options
84       specific to the [Swap] section of swap units are the following:
85
86       What=
87           Takes an absolute path of a device node or file to use for paging.
88           See swapon(8) for details. If this refers to a device node, a
89           dependency on the respective device unit is automatically created.
90           (See systemd.device(5) for more information.) If this refers to a
91           file, a dependency on the respective mount unit is automatically
92           created. (See systemd.mount(5) for more information.) This option
93           is mandatory. Note that the usual specifier expansion is applied to
94           this setting, literal percent characters should hence be written as
95           "%%".
96
97       Priority=
98           Swap priority to use when activating the swap device or file. This
99           takes an integer. This setting is optional and ignored when the
100           priority is set by pri= in the Options= key.
101
102       Options=
103           May contain an option string for the swap device. This may be used
104           for controlling discard options among other functionality, if the
105           swap backing device supports the discard or trim operation. (See
106           swapon(8) for more information.) Note that the usual specifier
107           expansion is applied to this setting, literal percent characters
108           should hence be written as "%%".
109
110       TimeoutSec=
111           Configures the time to wait for the swapon command to finish. If a
112           command does not exit within the configured time, the swap will be
113           considered failed and be shut down again. All commands still
114           running will be terminated forcibly via SIGTERM, and after another
115           delay of this time with SIGKILL. (See KillMode= in
116           systemd.kill(5).) Takes a unit-less value in seconds, or a time
117           span value such as "5min 20s". Pass "0" to disable the timeout
118           logic. Defaults to DefaultTimeoutStartSec= from the manager
119           configuration file (see systemd-system.conf(5)).
120
121       Check systemd.exec(5) and systemd.kill(5) for more settings.
122

SEE ALSO

124       systemd(1), systemctl(1), systemd.unit(5), systemd.exec(5),
125       systemd.kill(5), systemd.resource-control(5), systemd.device(5),
126       systemd.mount(5), swapon(8), systemd-fstab-generator(8),
127       systemd.directives(7)
128
129
130
131systemd 239                                                    SYSTEMD.SWAP(5)
Impressum