]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd-sleep.conf.xml
Merge pull request #11827 from keszybz/pkgconfig-variables
[thirdparty/systemd.git] / man / systemd-sleep.conf.xml
CommitLineData
514094f9 1<?xml version='1.0'?>
19adb8a3 2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
12b42c76 3"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
19adb8a3
ZJS
4
5<!--
572eb058 6 SPDX-License-Identifier: LGPL-2.1+
19adb8a3
ZJS
7-->
8
778b6a3f
JT
9<refentry id="systemd-sleep.conf"
10 xmlns:xi="http://www.w3.org/2001/XInclude">
19adb8a3
ZJS
11 <refentryinfo>
12 <title>systemd-sleep.conf</title>
13 <productname>systemd</productname>
19adb8a3
ZJS
14 </refentryinfo>
15
16 <refmeta>
17 <refentrytitle>systemd-sleep.conf</refentrytitle>
18 <manvolnum>5</manvolnum>
19 </refmeta>
20
21 <refnamediv>
22 <refname>systemd-sleep.conf</refname>
778b6a3f 23 <refname>sleep.conf.d</refname>
19adb8a3
ZJS
24 <refpurpose>Suspend and hibernation configuration file</refpurpose>
25 </refnamediv>
26
27 <refsynopsisdiv>
12b42c76
TG
28 <para><filename>/etc/systemd/sleep.conf</filename></para>
29 <para><filename>/etc/systemd/sleep.conf.d/*.conf</filename></para>
778b6a3f 30 <para><filename>/run/systemd/sleep.conf.d/*.conf</filename></para>
12b42c76 31 <para><filename>/usr/lib/systemd/sleep.conf.d/*.conf</filename></para>
19adb8a3
ZJS
32 </refsynopsisdiv>
33
34 <refsect1>
35 <title>Description</title>
36
c58493c0 37 <para><command>systemd</command> supports four general
19adb8a3
ZJS
38 power-saving modes:</para>
39
40 <variablelist>
41 <varlistentry>
42 <term>suspend</term>
43
44 <listitem><para>a low-power state
45 where execution of the OS is paused,
46 and complete power loss might result
47 in lost data, and which is fast to
48 enter and exit. This corresponds to
49 suspend, standby, or freeze states as
50 understood by the kernel.
51 </para></listitem>
52 </varlistentry>
53
54 <varlistentry>
55 <term>hibernate</term>
56
57 <listitem><para>a low-power state
58 where execution of the OS is paused,
59 and complete power loss does not
60 result in lost data, and which might
61 be slow to enter and exit. This
62 corresponds to the hibernation as
63 understood by the kernel.
64 </para></listitem>
65 </varlistentry>
66
67 <varlistentry>
68 <term>hybrid-sleep</term>
69
70 <listitem><para>a low-power state
71 where execution of the OS is paused,
72 which might be slow to enter, and on
73 complete power loss does not result in
74 lost data but might be slower to exit
75 in that case. This mode is called
76 suspend-to-both by the kernel.
77 </para></listitem>
78 </varlistentry>
c58493c0
ML
79
80 <varlistentry>
e68c79db 81 <term>suspend-then-hibernate</term>
c58493c0
ML
82
83 <listitem><para>A low power state where the system is initially suspended
84 (the state is stored in RAM). If not interrupted within the delay specified by
85 <command>HibernateDelaySec=</command>, the system will be woken using an RTC
86 alarm and hibernated (the state is then stored on disk).
87 </para></listitem>
88 </varlistentry>
89
19adb8a3
ZJS
90 </variablelist>
91
778b6a3f 92 <para>Settings in these files determine what strings
19adb8a3
ZJS
93 will be written to
94 <filename>/sys/power/disk</filename> and
95 <filename>/sys/power/state</filename> by
96 <citerefentry><refentrytitle>systemd-sleep</refentrytitle><manvolnum>8</manvolnum></citerefentry>
97 when
98 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
0f943ae4
ZJS
99 attempts to suspend or hibernate the machine.
100 See
101 <citerefentry><refentrytitle>systemd.syntax</refentrytitle><manvolnum>5</manvolnum></citerefentry>
102 for a general description of the syntax.</para>
19adb8a3
ZJS
103 </refsect1>
104
e93549ef 105 <xi:include href="standard-conf.xml" xpointer="main-conf" />
778b6a3f 106
19adb8a3
ZJS
107 <refsect1>
108 <title>Options</title>
109
110 <para>The following options can be configured in the
111 <literal>[Sleep]</literal> section of
12b42c76 112 <filename>/etc/systemd/sleep.conf</filename> or a
778b6a3f 113 <filename>sleep.conf.d</filename> file:</para>
19adb8a3 114
d2acdcc6 115 <variablelist class='config-directives'>
e8f1d00d
ZJS
116 <varlistentry>
117 <term><varname>AllowSuspend=</varname></term>
118 <term><varname>AllowHibernation=</varname></term>
119 <term><varname>AllowSuspendThenHibernate=</varname></term>
120 <term><varname>AllowHybridSleep=</varname></term>
121
122 <listitem><para>By default any power-saving mode is advertised if possible (i.e.
123 the kernel supports that mode, the necessary resources are available). Those
124 switches can be used to disable specific modes.</para>
125
126 <para>If <varname>AllowHibernation=no</varname> or <varname>AllowSuspend=no</varname> is
127 used, this implies <varname>AllowSuspendThenHibernate=no</varname> and
128 <varname>AllowHybridSleep=no</varname>, since those methods use both suspend and hibernation
129 internally. <varname>AllowSuspendThenHibernate=yes</varname> and
130 <varname>AllowHybridSleep=yes</varname> can be used to override and enable those specific
131 modes.</para></listitem>
132 </varlistentry>
133
19adb8a3
ZJS
134 <varlistentry>
135 <term><varname>SuspendMode=</varname></term>
136 <term><varname>HibernateMode=</varname></term>
137 <term><varname>HybridSleepMode=</varname></term>
138
139 <listitem><para>The string to be written to
140 <filename>/sys/power/disk</filename> by,
141 respectively,
142 <citerefentry><refentrytitle>systemd-suspend.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
c58493c0
ML
143 <citerefentry><refentrytitle>systemd-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
144 <citerefentry><refentrytitle>systemd-hybrid-sleep.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, or
e68c79db 145 <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
0c722554 146 More than one value can be specified by separating
252094eb 147 multiple values with whitespace. They will be tried
19adb8a3 148 in turn, until one is written without error. If
0c722554 149 neither succeeds, the operation will be aborted.
19adb8a3
ZJS
150 </para></listitem>
151 </varlistentry>
152
153 <varlistentry>
154 <term><varname>SuspendState=</varname></term>
155 <term><varname>HibernateState=</varname></term>
156 <term><varname>HybridSleepState=</varname></term>
157
158 <listitem><para>The string to be written to
159 <filename>/sys/power/state</filename> by,
160 respectively,
161 <citerefentry><refentrytitle>systemd-suspend.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
c58493c0
ML
162 <citerefentry><refentrytitle>systemd-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
163 <citerefentry><refentrytitle>systemd-hybrid-sleep.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, or
e68c79db 164 <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
0c722554 165 More than one value can be specified by separating
252094eb 166 multiple values with whitespace. They will be tried
19adb8a3 167 in turn, until one is written without error. If
0c722554 168 neither succeeds, the operation will be aborted.
19adb8a3
ZJS
169 </para></listitem>
170 </varlistentry>
c58493c0
ML
171 <varlistentry>
172 <term><varname>HibernateDelaySec=</varname></term>
173
174 <listitem><para>The amount of time in seconds
175 that will pass before the system is automatically
176 put into hibernate when using
e68c79db 177 <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
c58493c0
ML
178 </para></listitem>
179 </varlistentry>
19adb8a3
ZJS
180 </variablelist>
181 </refsect1>
182
183 <refsect1>
184 <title>Example: freeze</title>
185
186 <para>Example: to exploit the <quote>freeze</quote> mode added
187 in Linux 3.9, one can use <command>systemctl suspend</command>
188 with
9fccdb0f
LP
189 <programlisting>[Sleep]
190SuspendState=freeze</programlisting></para>
19adb8a3
ZJS
191 </refsect1>
192
193 <refsect1>
194 <title>See Also</title>
195 <para>
196 <citerefentry><refentrytitle>systemd-sleep</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
197 <citerefentry><refentrytitle>systemd-suspend.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
198 <citerefentry><refentrytitle>systemd-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
199 <citerefentry><refentrytitle>systemd-hybrid-sleep.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
e68c79db 200 <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
19adb8a3
ZJS
201 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
202 <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>
203 </para>
204 </refsect1>
205
206</refentry>