]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd-sleep.conf.xml
Merge pull request #29601 from yuwata/mmap-check-overflow
[thirdparty/systemd.git] / man / systemd-sleep.conf.xml
CommitLineData
514094f9 1<?xml version='1.0'?>
3a54a157
ZJS
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
db9ecf05 4<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
19adb8a3 5
778b6a3f
JT
6<refentry id="systemd-sleep.conf"
7 xmlns:xi="http://www.w3.org/2001/XInclude">
19adb8a3
ZJS
8 <refentryinfo>
9 <title>systemd-sleep.conf</title>
10 <productname>systemd</productname>
19adb8a3
ZJS
11 </refentryinfo>
12
13 <refmeta>
14 <refentrytitle>systemd-sleep.conf</refentrytitle>
15 <manvolnum>5</manvolnum>
16 </refmeta>
17
18 <refnamediv>
19 <refname>systemd-sleep.conf</refname>
778b6a3f 20 <refname>sleep.conf.d</refname>
19adb8a3
ZJS
21 <refpurpose>Suspend and hibernation configuration file</refpurpose>
22 </refnamediv>
23
24 <refsynopsisdiv>
12b42c76
TG
25 <para><filename>/etc/systemd/sleep.conf</filename></para>
26 <para><filename>/etc/systemd/sleep.conf.d/*.conf</filename></para>
778b6a3f 27 <para><filename>/run/systemd/sleep.conf.d/*.conf</filename></para>
12b42c76 28 <para><filename>/usr/lib/systemd/sleep.conf.d/*.conf</filename></para>
19adb8a3
ZJS
29 </refsynopsisdiv>
30
31 <refsect1>
32 <title>Description</title>
33
c58493c0 34 <para><command>systemd</command> supports four general
19adb8a3
ZJS
35 power-saving modes:</para>
36
37 <variablelist>
38 <varlistentry>
39 <term>suspend</term>
40
41 <listitem><para>a low-power state
42 where execution of the OS is paused,
43 and complete power loss might result
44 in lost data, and which is fast to
45 enter and exit. This corresponds to
46 suspend, standby, or freeze states as
47 understood by the kernel.
ec07c3c8
AK
48 </para>
49
50 <xi:include href="version-info.xml" xpointer="v203"/></listitem>
19adb8a3
ZJS
51 </varlistentry>
52
53 <varlistentry>
54 <term>hibernate</term>
55
56 <listitem><para>a low-power state
57 where execution of the OS is paused,
58 and complete power loss does not
59 result in lost data, and which might
60 be slow to enter and exit. This
61 corresponds to the hibernation as
62 understood by the kernel.
ec07c3c8
AK
63 </para>
64
65 <xi:include href="version-info.xml" xpointer="v203"/></listitem>
19adb8a3
ZJS
66 </varlistentry>
67
68 <varlistentry>
69 <term>hybrid-sleep</term>
70
71 <listitem><para>a low-power state
72 where execution of the OS is paused,
73 which might be slow to enter, and on
74 complete power loss does not result in
75 lost data but might be slower to exit
76 in that case. This mode is called
77 suspend-to-both by the kernel.
ec07c3c8
AK
78 </para>
79
80 <xi:include href="version-info.xml" xpointer="v203"/></listitem>
19adb8a3 81 </varlistentry>
c58493c0
ML
82
83 <varlistentry>
e68c79db 84 <term>suspend-then-hibernate</term>
c58493c0 85
4f58b656
YW
86 <listitem>
87 <para>A low power state where the system is initially suspended (the state is stored in
88 RAM). If the system supports low-battery alarms (ACPI _BTP), then the system will be woken up by
89 the ACPI low-battery signal and hibernated (the state is then stored on disk). Also, if not
90 interrupted within the timespan specified by <varname>HibernateDelaySec=</varname> or the estimated
91 timespan until the system battery charge level goes down to 5%, then the system will be woken up by the
92 RTC alarm and hibernated. The estimated timespan is calculated from the change of the battery
93 capacity level after the time specified by <varname>SuspendEstimationSec=</varname> or when
94 the system is woken up from the suspend.</para>
ec07c3c8
AK
95
96 <xi:include href="version-info.xml" xpointer="v239"/>
4f58b656 97 </listitem>
c58493c0
ML
98 </varlistentry>
99
19adb8a3
ZJS
100 </variablelist>
101
778b6a3f 102 <para>Settings in these files determine what strings
19adb8a3
ZJS
103 will be written to
104 <filename>/sys/power/disk</filename> and
105 <filename>/sys/power/state</filename> by
106 <citerefentry><refentrytitle>systemd-sleep</refentrytitle><manvolnum>8</manvolnum></citerefentry>
107 when
108 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
0f943ae4
ZJS
109 attempts to suspend or hibernate the machine.
110 See
675fa6ea 111 <citerefentry><refentrytitle>systemd.syntax</refentrytitle><manvolnum>7</manvolnum></citerefentry>
0f943ae4 112 for a general description of the syntax.</para>
19adb8a3
ZJS
113 </refsect1>
114
e93549ef 115 <xi:include href="standard-conf.xml" xpointer="main-conf" />
778b6a3f 116
19adb8a3
ZJS
117 <refsect1>
118 <title>Options</title>
119
120 <para>The following options can be configured in the
bdac5608 121 [Sleep] section of
12b42c76 122 <filename>/etc/systemd/sleep.conf</filename> or a
778b6a3f 123 <filename>sleep.conf.d</filename> file:</para>
19adb8a3 124
d2acdcc6 125 <variablelist class='config-directives'>
e8f1d00d
ZJS
126 <varlistentry>
127 <term><varname>AllowSuspend=</varname></term>
128 <term><varname>AllowHibernation=</varname></term>
e8f1d00d 129 <term><varname>AllowHybridSleep=</varname></term>
1f82c21d 130 <term><varname>AllowSuspendThenHibernate=</varname></term>
e8f1d00d
ZJS
131
132 <listitem><para>By default any power-saving mode is advertised if possible (i.e.
133 the kernel supports that mode, the necessary resources are available). Those
134 switches can be used to disable specific modes.</para>
135
136 <para>If <varname>AllowHibernation=no</varname> or <varname>AllowSuspend=no</varname> is
137 used, this implies <varname>AllowSuspendThenHibernate=no</varname> and
138 <varname>AllowHybridSleep=no</varname>, since those methods use both suspend and hibernation
139 internally. <varname>AllowSuspendThenHibernate=yes</varname> and
140 <varname>AllowHybridSleep=yes</varname> can be used to override and enable those specific
ec07c3c8
AK
141 modes.</para>
142
143 <xi:include href="version-info.xml" xpointer="v240"/></listitem>
e8f1d00d
ZJS
144 </varlistentry>
145
19adb8a3 146 <varlistentry>
19adb8a3
ZJS
147 <term><varname>HibernateMode=</varname></term>
148 <term><varname>HybridSleepMode=</varname></term>
149
2f76f1cf 150 <listitem><para>The string to be written to <filename>/sys/power/disk</filename> by, respectively,
1f82c21d
MY
151 <citerefentry><refentrytitle>systemd-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
152 and
33f899bd 153 <citerefentry><refentrytitle>systemd-hybrid-sleep.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
2f76f1cf
ZJS
154 More than one value can be specified by separating multiple values with whitespace. They will be
155 tried in turn, until one is written without error. If none of the writes succeed, the operation will
156 be aborted.</para>
157
158 <para>The allowed set of values is determined by the kernel and is shown in the file itself (use
159 <command>cat /sys/power/disk</command> to display). See <ulink
160 url="https://www.kernel.org/doc/html/latest/admin-guide/pm/sleep-states.html#basic-sysfs-interfaces-for-system-suspend-and-hibernation">the
161 kernel documentation</ulink> for more details.</para>
162
1f82c21d
MY
163 <para>Note that hybrid sleep corresponds to the <literal>suspend</literal> disk mode. If <varname>HybridSleepMode=</varname>
164 is overridden, you might get plain hibernation instead.</para>
165
2f76f1cf
ZJS
166 <para>
167 <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
168 uses the value of <varname>SuspendMode=</varname> when suspending and the value of
ec07c3c8
AK
169 <varname>HibernateMode=</varname> when hibernating.</para>
170
171 <xi:include href="version-info.xml" xpointer="v203"/></listitem>
19adb8a3
ZJS
172 </varlistentry>
173
174 <varlistentry>
175 <term><varname>SuspendState=</varname></term>
19adb8a3 176
1f82c21d
MY
177 <listitem><para>The string to be written to <filename>/sys/power/state</filename> by <citerefentry>
178 <refentrytitle>systemd-suspend.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
2f76f1cf
ZJS
179 More than one value can be specified by separating multiple values with whitespace. They will be
180 tried in turn, until one is written without error. If none of the writes succeed, the operation will
1f82c21d 181 be aborted.</para>
67828e08 182
2f76f1cf
ZJS
183 <para>The allowed set of values is determined by the kernel and is shown in the file itself (use
184 <command>cat /sys/power/state</command> to display). See <ulink
185 url="https://www.kernel.org/doc/html/latest/admin-guide/pm/sleep-states.html#basic-sysfs-interfaces-for-system-suspend-and-hibernation">the
186 kernel documentation</ulink> for more details.</para>
187
188 <para>
189 <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
1f82c21d 190 uses this value when suspending.</para>
ec07c3c8
AK
191
192 <xi:include href="version-info.xml" xpointer="v203"/></listitem>
19adb8a3 193 </varlistentry>
4f58b656 194
c58493c0
ML
195 <varlistentry>
196 <term><varname>HibernateDelaySec=</varname></term>
4f58b656
YW
197
198 <listitem>
199 <para>The amount of time the system spends in suspend mode before the system is
200 automatically put into hibernate mode. Only used by
201 <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
202 If the system has a battery, then defaults to the estimated timespan until the system battery charge level goes down to 5%.
203 If the system has no battery, then defaults to 2h.</para>
ec07c3c8
AK
204
205 <xi:include href="version-info.xml" xpointer="v239"/>
4f58b656
YW
206 </listitem>
207 </varlistentry>
208
209 <varlistentry>
210 <term><varname>SuspendEstimationSec=</varname></term>
211
212 <listitem>
213 <para>The RTC alarm will wake the system after the specified timespan to measure the system battery
214 capacity level and estimate battery discharging rate, which is used for estimating timespan until the system battery charge
215 level goes down to 5%. Only used by
216 <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
ec07c3c8
AK
217 Defaults to 1h.</para>
218
219 <xi:include href="version-info.xml" xpointer="v253"/></listitem>
c58493c0 220 </varlistentry>
19adb8a3
ZJS
221 </variablelist>
222 </refsect1>
223
224 <refsect1>
225 <title>Example: freeze</title>
226
227 <para>Example: to exploit the <quote>freeze</quote> mode added
228 in Linux 3.9, one can use <command>systemctl suspend</command>
229 with
9fccdb0f
LP
230 <programlisting>[Sleep]
231SuspendState=freeze</programlisting></para>
19adb8a3
ZJS
232 </refsect1>
233
234 <refsect1>
235 <title>See Also</title>
236 <para>
237 <citerefentry><refentrytitle>systemd-sleep</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
238 <citerefentry><refentrytitle>systemd-suspend.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
239 <citerefentry><refentrytitle>systemd-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
240 <citerefentry><refentrytitle>systemd-hybrid-sleep.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
e68c79db 241 <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
19adb8a3
ZJS
242 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
243 <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>
244 </para>
245 </refsect1>
246
247</refentry>