]>
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"> | |
0307f791 | 4 | <!-- SPDX-License-Identifier: LGPL-2.1+ --> |
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 ML |
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 | ||
19adb8a3 ZJS |
87 | </variablelist> |
88 | ||
778b6a3f | 89 | <para>Settings in these files determine what strings |
19adb8a3 ZJS |
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> | |
0f943ae4 ZJS |
96 | attempts to suspend or hibernate the machine. |
97 | See | |
675fa6ea | 98 | <citerefentry><refentrytitle>systemd.syntax</refentrytitle><manvolnum>7</manvolnum></citerefentry> |
0f943ae4 | 99 | for a general description of the syntax.</para> |
19adb8a3 ZJS |
100 | </refsect1> |
101 | ||
e93549ef | 102 | <xi:include href="standard-conf.xml" xpointer="main-conf" /> |
778b6a3f | 103 | |
19adb8a3 ZJS |
104 | <refsect1> |
105 | <title>Options</title> | |
106 | ||
107 | <para>The following options can be configured in the | |
bdac5608 | 108 | [Sleep] section of |
12b42c76 | 109 | <filename>/etc/systemd/sleep.conf</filename> or a |
778b6a3f | 110 | <filename>sleep.conf.d</filename> file:</para> |
19adb8a3 | 111 | |
d2acdcc6 | 112 | <variablelist class='config-directives'> |
e8f1d00d ZJS |
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 | ||
19adb8a3 ZJS |
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>, | |
c58493c0 ML |
140 | <citerefentry><refentrytitle>systemd-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
141 | <citerefentry><refentrytitle>systemd-hybrid-sleep.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, or | |
e68c79db | 142 | <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. |
0c722554 | 143 | More than one value can be specified by separating |
252094eb | 144 | multiple values with whitespace. They will be tried |
19adb8a3 | 145 | in turn, until one is written without error. If |
0c722554 | 146 | neither succeeds, the operation will be aborted. |
19adb8a3 ZJS |
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>, | |
c58493c0 ML |
159 | <citerefentry><refentrytitle>systemd-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
160 | <citerefentry><refentrytitle>systemd-hybrid-sleep.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, or | |
e68c79db | 161 | <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. |
0c722554 | 162 | More than one value can be specified by separating |
252094eb | 163 | multiple values with whitespace. They will be tried |
19adb8a3 | 164 | in turn, until one is written without error. If |
0c722554 | 165 | neither succeeds, the operation will be aborted. |
19adb8a3 ZJS |
166 | </para></listitem> |
167 | </varlistentry> | |
c58493c0 ML |
168 | <varlistentry> |
169 | <term><varname>HibernateDelaySec=</varname></term> | |
170 | ||
a077755a LP |
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> | |
c58493c0 | 175 | </varlistentry> |
19adb8a3 ZJS |
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 | |
9fccdb0f LP |
185 | <programlisting>[Sleep] |
186 | SuspendState=freeze</programlisting></para> | |
19adb8a3 ZJS |
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>, | |
e68c79db | 196 | <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
19adb8a3 ZJS |
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> |