]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd-sleep.conf.xml
man: use meaningful titles for <ulink>s
[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 147 <term><varname>HibernateMode=</varname></term>
19adb8a3 148
828ad304
MY
149 <listitem><para>The string to be written to <filename>/sys/power/disk</filename> by <citerefentry>
150 <refentrytitle>systemd-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
2f76f1cf
ZJS
151 More than one value can be specified by separating multiple values with whitespace. They will be
152 tried in turn, until one is written without error. If none of the writes succeed, the operation will
153 be aborted.</para>
154
155 <para>The allowed set of values is determined by the kernel and is shown in the file itself (use
c8cd6d7b
ZJS
156 <command>cat /sys/power/disk</command> to display). See the kernel documentation page
157 <ulink url="https://www.kernel.org/doc/html/latest/admin-guide/pm/sleep-states.html#basic-sysfs-interfaces-for-system-suspend-and-hibernation">
158 Basic sysfs Interfaces for System Suspend and Hibernation</ulink> for more details.</para>
2f76f1cf
ZJS
159
160 <para>
161 <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
2c9fa8d3 162 uses the value of <varname>HibernateMode=</varname> when hibernating.</para>
ec07c3c8
AK
163
164 <xi:include href="version-info.xml" xpointer="v203"/></listitem>
19adb8a3
ZJS
165 </varlistentry>
166
167 <varlistentry>
168 <term><varname>SuspendState=</varname></term>
19adb8a3 169
1f82c21d
MY
170 <listitem><para>The string to be written to <filename>/sys/power/state</filename> by <citerefentry>
171 <refentrytitle>systemd-suspend.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
2f76f1cf
ZJS
172 More than one value can be specified by separating multiple values with whitespace. They will be
173 tried in turn, until one is written without error. If none of the writes succeed, the operation will
1f82c21d 174 be aborted.</para>
67828e08 175
2f76f1cf
ZJS
176 <para>The allowed set of values is determined by the kernel and is shown in the file itself (use
177 <command>cat /sys/power/state</command> to display). See <ulink
c8cd6d7b
ZJS
178 url="https://www.kernel.org/doc/html/latest/admin-guide/pm/sleep-states.html#basic-sysfs-interfaces-for-system-suspend-and-hibernation">
179 Basic sysfs Interfaces for System Suspend and Hibernation</ulink> for more details.</para>
2f76f1cf
ZJS
180
181 <para>
182 <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
1f82c21d 183 uses this value when suspending.</para>
ec07c3c8
AK
184
185 <xi:include href="version-info.xml" xpointer="v203"/></listitem>
19adb8a3 186 </varlistentry>
4f58b656 187
c58493c0
ML
188 <varlistentry>
189 <term><varname>HibernateDelaySec=</varname></term>
4f58b656
YW
190
191 <listitem>
192 <para>The amount of time the system spends in suspend mode before the system is
193 automatically put into hibernate mode. Only used by
194 <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
195 If the system has a battery, then defaults to the estimated timespan until the system battery charge level goes down to 5%.
196 If the system has no battery, then defaults to 2h.</para>
ec07c3c8
AK
197
198 <xi:include href="version-info.xml" xpointer="v239"/>
4f58b656
YW
199 </listitem>
200 </varlistentry>
201
202 <varlistentry>
203 <term><varname>SuspendEstimationSec=</varname></term>
204
205 <listitem>
206 <para>The RTC alarm will wake the system after the specified timespan to measure the system battery
207 capacity level and estimate battery discharging rate, which is used for estimating timespan until the system battery charge
208 level goes down to 5%. Only used by
209 <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
ec07c3c8
AK
210 Defaults to 1h.</para>
211
212 <xi:include href="version-info.xml" xpointer="v253"/></listitem>
c58493c0 213 </varlistentry>
19adb8a3
ZJS
214 </variablelist>
215 </refsect1>
216
217 <refsect1>
218 <title>Example: freeze</title>
219
220 <para>Example: to exploit the <quote>freeze</quote> mode added
221 in Linux 3.9, one can use <command>systemctl suspend</command>
222 with
9fccdb0f
LP
223 <programlisting>[Sleep]
224SuspendState=freeze</programlisting></para>
19adb8a3
ZJS
225 </refsect1>
226
227 <refsect1>
228 <title>See Also</title>
229 <para>
230 <citerefentry><refentrytitle>systemd-sleep</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
231 <citerefentry><refentrytitle>systemd-suspend.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
232 <citerefentry><refentrytitle>systemd-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
233 <citerefentry><refentrytitle>systemd-hybrid-sleep.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
e68c79db 234 <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
19adb8a3
ZJS
235 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
236 <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>
237 </para>
238 </refsect1>
239
240</refentry>