]>
Commit | Line | Data |
---|---|---|
1 | <?xml version='1.0'?> | |
2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" | |
3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> | |
4 | <!-- SPDX-License-Identifier: LGPL-2.1+ --> | |
5 | ||
6 | <refentry id="systemd-sleep.conf" | |
7 | xmlns:xi="http://www.w3.org/2001/XInclude"> | |
8 | <refentryinfo> | |
9 | <title>systemd-sleep.conf</title> | |
10 | <productname>systemd</productname> | |
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> | |
20 | <refname>sleep.conf.d</refname> | |
21 | <refpurpose>Suspend and hibernation configuration file</refpurpose> | |
22 | </refnamediv> | |
23 | ||
24 | <refsynopsisdiv> | |
25 | <para><filename>/etc/systemd/sleep.conf</filename></para> | |
26 | <para><filename>/etc/systemd/sleep.conf.d/*.conf</filename></para> | |
27 | <para><filename>/run/systemd/sleep.conf.d/*.conf</filename></para> | |
28 | <para><filename>/usr/lib/systemd/sleep.conf.d/*.conf</filename></para> | |
29 | </refsynopsisdiv> | |
30 | ||
31 | <refsect1> | |
32 | <title>Description</title> | |
33 | ||
34 | <para><command>systemd</command> supports four general | |
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> | |
76 | ||
77 | <varlistentry> | |
78 | <term>suspend-then-hibernate</term> | |
79 | ||
80 | <listitem><para>A low power state where the system is initially suspended | |
81 | (the state is stored in RAM). If not interrupted within the delay specified by | |
82 | <command>HibernateDelaySec=</command>, the system will be woken using an RTC | |
83 | alarm and hibernated (the state is then stored on disk). | |
84 | </para></listitem> | |
85 | </varlistentry> | |
86 | ||
87 | </variablelist> | |
88 | ||
89 | <para>Settings in these files determine what strings | |
90 | will be written to | |
91 | <filename>/sys/power/disk</filename> and | |
92 | <filename>/sys/power/state</filename> by | |
93 | <citerefentry><refentrytitle>systemd-sleep</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
94 | when | |
95 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
96 | attempts to suspend or hibernate the machine. | |
97 | See | |
98 | <citerefentry><refentrytitle>systemd.syntax</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
99 | for a general description of the syntax.</para> | |
100 | </refsect1> | |
101 | ||
102 | <xi:include href="standard-conf.xml" xpointer="main-conf" /> | |
103 | ||
104 | <refsect1> | |
105 | <title>Options</title> | |
106 | ||
107 | <para>The following options can be configured in the | |
108 | <literal>[Sleep]</literal> section of | |
109 | <filename>/etc/systemd/sleep.conf</filename> or a | |
110 | <filename>sleep.conf.d</filename> file:</para> | |
111 | ||
112 | <variablelist class='config-directives'> | |
113 | <varlistentry> | |
114 | <term><varname>AllowSuspend=</varname></term> | |
115 | <term><varname>AllowHibernation=</varname></term> | |
116 | <term><varname>AllowSuspendThenHibernate=</varname></term> | |
117 | <term><varname>AllowHybridSleep=</varname></term> | |
118 | ||
119 | <listitem><para>By default any power-saving mode is advertised if possible (i.e. | |
120 | the kernel supports that mode, the necessary resources are available). Those | |
121 | switches can be used to disable specific modes.</para> | |
122 | ||
123 | <para>If <varname>AllowHibernation=no</varname> or <varname>AllowSuspend=no</varname> is | |
124 | used, this implies <varname>AllowSuspendThenHibernate=no</varname> and | |
125 | <varname>AllowHybridSleep=no</varname>, since those methods use both suspend and hibernation | |
126 | internally. <varname>AllowSuspendThenHibernate=yes</varname> and | |
127 | <varname>AllowHybridSleep=yes</varname> can be used to override and enable those specific | |
128 | modes.</para></listitem> | |
129 | </varlistentry> | |
130 | ||
131 | <varlistentry> | |
132 | <term><varname>SuspendMode=</varname></term> | |
133 | <term><varname>HibernateMode=</varname></term> | |
134 | <term><varname>HybridSleepMode=</varname></term> | |
135 | ||
136 | <listitem><para>The string to be written to | |
137 | <filename>/sys/power/disk</filename> by, | |
138 | respectively, | |
139 | <citerefentry><refentrytitle>systemd-suspend.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
140 | <citerefentry><refentrytitle>systemd-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
141 | <citerefentry><refentrytitle>systemd-hybrid-sleep.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, or | |
142 | <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. | |
143 | More than one value can be specified by separating | |
144 | multiple values with whitespace. They will be tried | |
145 | in turn, until one is written without error. If | |
146 | neither succeeds, the operation will be aborted. | |
147 | </para></listitem> | |
148 | </varlistentry> | |
149 | ||
150 | <varlistentry> | |
151 | <term><varname>SuspendState=</varname></term> | |
152 | <term><varname>HibernateState=</varname></term> | |
153 | <term><varname>HybridSleepState=</varname></term> | |
154 | ||
155 | <listitem><para>The string to be written to | |
156 | <filename>/sys/power/state</filename> by, | |
157 | respectively, | |
158 | <citerefentry><refentrytitle>systemd-suspend.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
159 | <citerefentry><refentrytitle>systemd-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
160 | <citerefentry><refentrytitle>systemd-hybrid-sleep.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, or | |
161 | <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. | |
162 | More than one value can be specified by separating | |
163 | multiple values with whitespace. They will be tried | |
164 | in turn, until one is written without error. If | |
165 | neither succeeds, the operation will be aborted. | |
166 | </para></listitem> | |
167 | </varlistentry> | |
168 | <varlistentry> | |
169 | <term><varname>HibernateDelaySec=</varname></term> | |
170 | ||
171 | <listitem><para>The amount of time the system spends in suspend mode before the system is | |
172 | automatically put into hibernate mode, when using | |
173 | <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. Defaults | |
174 | to 2h.</para></listitem> | |
175 | </varlistentry> | |
176 | </variablelist> | |
177 | </refsect1> | |
178 | ||
179 | <refsect1> | |
180 | <title>Example: freeze</title> | |
181 | ||
182 | <para>Example: to exploit the <quote>freeze</quote> mode added | |
183 | in Linux 3.9, one can use <command>systemctl suspend</command> | |
184 | with | |
185 | <programlisting>[Sleep] | |
186 | SuspendState=freeze</programlisting></para> | |
187 | </refsect1> | |
188 | ||
189 | <refsect1> | |
190 | <title>See Also</title> | |
191 | <para> | |
192 | <citerefentry><refentrytitle>systemd-sleep</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
193 | <citerefentry><refentrytitle>systemd-suspend.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
194 | <citerefentry><refentrytitle>systemd-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
195 | <citerefentry><refentrytitle>systemd-hybrid-sleep.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
196 | <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
197 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
198 | <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry> | |
199 | </para> | |
200 | </refsect1> | |
201 | ||
202 | </refentry> |