]>
Commit | Line | Data |
---|---|---|
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. | |
48 | </para></listitem> | |
49 | </varlistentry> | |
50 | ||
51 | <varlistentry> | |
52 | <term>hibernate</term> | |
53 | ||
54 | <listitem><para>a low-power state | |
55 | where execution of the OS is paused, | |
56 | and complete power loss does not | |
57 | result in lost data, and which might | |
58 | be slow to enter and exit. This | |
59 | corresponds to the hibernation as | |
60 | understood by the kernel. | |
61 | </para></listitem> | |
62 | </varlistentry> | |
63 | ||
64 | <varlistentry> | |
65 | <term>hybrid-sleep</term> | |
66 | ||
67 | <listitem><para>a low-power state | |
68 | where execution of the OS is paused, | |
69 | which might be slow to enter, and on | |
70 | complete power loss does not result in | |
71 | lost data but might be slower to exit | |
72 | in that case. This mode is called | |
73 | suspend-to-both by the kernel. | |
74 | </para></listitem> | |
75 | </varlistentry> | |
c58493c0 ML |
76 | |
77 | <varlistentry> | |
e68c79db | 78 | <term>suspend-then-hibernate</term> |
c58493c0 | 79 | |
4f58b656 YW |
80 | <listitem> |
81 | <para>A low power state where the system is initially suspended (the state is stored in | |
82 | RAM). If the system supports low-battery alarms (ACPI _BTP), then the system will be woken up by | |
83 | the ACPI low-battery signal and hibernated (the state is then stored on disk). Also, if not | |
84 | interrupted within the timespan specified by <varname>HibernateDelaySec=</varname> or the estimated | |
85 | timespan until the system battery charge level goes down to 5%, then the system will be woken up by the | |
86 | RTC alarm and hibernated. The estimated timespan is calculated from the change of the battery | |
87 | capacity level after the time specified by <varname>SuspendEstimationSec=</varname> or when | |
88 | the system is woken up from the suspend.</para> | |
89 | </listitem> | |
c58493c0 ML |
90 | </varlistentry> |
91 | ||
19adb8a3 ZJS |
92 | </variablelist> |
93 | ||
778b6a3f | 94 | <para>Settings in these files determine what strings |
19adb8a3 ZJS |
95 | will be written to |
96 | <filename>/sys/power/disk</filename> and | |
97 | <filename>/sys/power/state</filename> by | |
98 | <citerefentry><refentrytitle>systemd-sleep</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
99 | when | |
100 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
0f943ae4 ZJS |
101 | attempts to suspend or hibernate the machine. |
102 | See | |
675fa6ea | 103 | <citerefentry><refentrytitle>systemd.syntax</refentrytitle><manvolnum>7</manvolnum></citerefentry> |
0f943ae4 | 104 | for a general description of the syntax.</para> |
19adb8a3 ZJS |
105 | </refsect1> |
106 | ||
e93549ef | 107 | <xi:include href="standard-conf.xml" xpointer="main-conf" /> |
778b6a3f | 108 | |
19adb8a3 ZJS |
109 | <refsect1> |
110 | <title>Options</title> | |
111 | ||
112 | <para>The following options can be configured in the | |
bdac5608 | 113 | [Sleep] section of |
12b42c76 | 114 | <filename>/etc/systemd/sleep.conf</filename> or a |
778b6a3f | 115 | <filename>sleep.conf.d</filename> file:</para> |
19adb8a3 | 116 | |
d2acdcc6 | 117 | <variablelist class='config-directives'> |
e8f1d00d ZJS |
118 | <varlistentry> |
119 | <term><varname>AllowSuspend=</varname></term> | |
120 | <term><varname>AllowHibernation=</varname></term> | |
121 | <term><varname>AllowSuspendThenHibernate=</varname></term> | |
122 | <term><varname>AllowHybridSleep=</varname></term> | |
123 | ||
124 | <listitem><para>By default any power-saving mode is advertised if possible (i.e. | |
125 | the kernel supports that mode, the necessary resources are available). Those | |
126 | switches can be used to disable specific modes.</para> | |
127 | ||
128 | <para>If <varname>AllowHibernation=no</varname> or <varname>AllowSuspend=no</varname> is | |
129 | used, this implies <varname>AllowSuspendThenHibernate=no</varname> and | |
130 | <varname>AllowHybridSleep=no</varname>, since those methods use both suspend and hibernation | |
131 | internally. <varname>AllowSuspendThenHibernate=yes</varname> and | |
132 | <varname>AllowHybridSleep=yes</varname> can be used to override and enable those specific | |
133 | modes.</para></listitem> | |
134 | </varlistentry> | |
135 | ||
19adb8a3 ZJS |
136 | <varlistentry> |
137 | <term><varname>SuspendMode=</varname></term> | |
138 | <term><varname>HibernateMode=</varname></term> | |
139 | <term><varname>HybridSleepMode=</varname></term> | |
140 | ||
2f76f1cf | 141 | <listitem><para>The string to be written to <filename>/sys/power/disk</filename> by, respectively, |
19adb8a3 | 142 | <citerefentry><refentrytitle>systemd-suspend.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
2f76f1cf ZJS |
143 | <citerefentry><refentrytitle>systemd-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
144 | or | |
33f899bd | 145 | <citerefentry><refentrytitle>systemd-hybrid-sleep.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. |
2f76f1cf ZJS |
146 | More than one value can be specified by separating multiple values with whitespace. They will be |
147 | tried in turn, until one is written without error. If none of the writes succeed, the operation will | |
148 | be aborted.</para> | |
149 | ||
150 | <para>The allowed set of values is determined by the kernel and is shown in the file itself (use | |
151 | <command>cat /sys/power/disk</command> to display). See <ulink | |
152 | url="https://www.kernel.org/doc/html/latest/admin-guide/pm/sleep-states.html#basic-sysfs-interfaces-for-system-suspend-and-hibernation">the | |
153 | kernel documentation</ulink> for more details.</para> | |
154 | ||
155 | <para> | |
156 | <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
157 | uses the value of <varname>SuspendMode=</varname> when suspending and the value of | |
158 | <varname>HibernateMode=</varname> when hibernating.</para></listitem> | |
19adb8a3 ZJS |
159 | </varlistentry> |
160 | ||
161 | <varlistentry> | |
162 | <term><varname>SuspendState=</varname></term> | |
163 | <term><varname>HibernateState=</varname></term> | |
164 | <term><varname>HybridSleepState=</varname></term> | |
165 | ||
2f76f1cf | 166 | <listitem><para>The string to be written to <filename>/sys/power/state</filename> by, respectively, |
19adb8a3 | 167 | <citerefentry><refentrytitle>systemd-suspend.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
2f76f1cf ZJS |
168 | <citerefentry><refentrytitle>systemd-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
169 | or | |
33f899bd | 170 | <citerefentry><refentrytitle>systemd-hybrid-sleep.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. |
2f76f1cf ZJS |
171 | More than one value can be specified by separating multiple values with whitespace. They will be |
172 | tried in turn, until one is written without error. If none of the writes succeed, the operation will | |
173 | be aborted. | |
33f899bd | 174 | </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 | |
178 | url="https://www.kernel.org/doc/html/latest/admin-guide/pm/sleep-states.html#basic-sysfs-interfaces-for-system-suspend-and-hibernation">the | |
179 | kernel documentation</ulink> for more details.</para> | |
180 | ||
181 | <para> | |
182 | <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
183 | uses the value of <varname>SuspendState=</varname> when suspending and the value of | |
184 | <varname>HibernateState=</varname> when hibernating.</para></listitem> | |
19adb8a3 | 185 | </varlistentry> |
4f58b656 | 186 | |
c58493c0 ML |
187 | <varlistentry> |
188 | <term><varname>HibernateDelaySec=</varname></term> | |
4f58b656 YW |
189 | |
190 | <listitem> | |
191 | <para>The amount of time the system spends in suspend mode before the system is | |
192 | automatically put into hibernate mode. Only used by | |
193 | <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. | |
194 | If the system has a battery, then defaults to the estimated timespan until the system battery charge level goes down to 5%. | |
195 | If the system has no battery, then defaults to 2h.</para> | |
196 | </listitem> | |
197 | </varlistentry> | |
198 | ||
199 | <varlistentry> | |
200 | <term><varname>SuspendEstimationSec=</varname></term> | |
201 | ||
202 | <listitem> | |
203 | <para>The RTC alarm will wake the system after the specified timespan to measure the system battery | |
204 | capacity level and estimate battery discharging rate, which is used for estimating timespan until the system battery charge | |
205 | level goes down to 5%. Only used by | |
206 | <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. | |
f05b4bb9 | 207 | Defaults to 1h.</para></listitem> |
c58493c0 | 208 | </varlistentry> |
19adb8a3 ZJS |
209 | </variablelist> |
210 | </refsect1> | |
211 | ||
212 | <refsect1> | |
213 | <title>Example: freeze</title> | |
214 | ||
215 | <para>Example: to exploit the <quote>freeze</quote> mode added | |
216 | in Linux 3.9, one can use <command>systemctl suspend</command> | |
217 | with | |
9fccdb0f LP |
218 | <programlisting>[Sleep] |
219 | SuspendState=freeze</programlisting></para> | |
19adb8a3 ZJS |
220 | </refsect1> |
221 | ||
222 | <refsect1> | |
223 | <title>See Also</title> | |
224 | <para> | |
225 | <citerefentry><refentrytitle>systemd-sleep</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
226 | <citerefentry><refentrytitle>systemd-suspend.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
227 | <citerefentry><refentrytitle>systemd-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
228 | <citerefentry><refentrytitle>systemd-hybrid-sleep.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
e68c79db | 229 | <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
19adb8a3 ZJS |
230 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
231 | <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry> | |
232 | </para> | |
233 | </refsect1> | |
234 | ||
235 | </refentry> |