]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd-sleep.conf.xml
verify: use manager_load_startable_unit_or_warn() to load units for verification
[thirdparty/systemd.git] / man / systemd-sleep.conf.xml
1 <?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5 <!--
6 SPDX-License-Identifier: LGPL-2.1+
7
8 This file is part of systemd.
9
10 Copyright 2013 Zbigniew Jędrzejewski-Szmek
11
12 systemd is free software; you can redistribute it and/or modify it
13 under the terms of the GNU Lesser General Public License as published by
14 the Free Software Foundation; either version 2.1 of the License, or
15 (at your option) any later version.
16
17 systemd is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 Lesser General Public License for more details.
21
22 You should have received a copy of the GNU Lesser General Public License
23 along with systemd; If not, see <http://www.gnu.org/licenses/>.
24 -->
25
26 <refentry id="systemd-sleep.conf"
27 xmlns:xi="http://www.w3.org/2001/XInclude">
28 <refentryinfo>
29 <title>systemd-sleep.conf</title>
30 <productname>systemd</productname>
31
32 <authorgroup>
33 <author>
34 <contrib>Developer</contrib>
35 <firstname>Zbigniew</firstname>
36 <surname>Jędrzejewski-Szmek</surname>
37 <email>zbyszek@in.waw.pl</email>
38 </author>
39 </authorgroup>
40 </refentryinfo>
41
42 <refmeta>
43 <refentrytitle>systemd-sleep.conf</refentrytitle>
44 <manvolnum>5</manvolnum>
45 </refmeta>
46
47 <refnamediv>
48 <refname>systemd-sleep.conf</refname>
49 <refname>sleep.conf.d</refname>
50 <refpurpose>Suspend and hibernation configuration file</refpurpose>
51 </refnamediv>
52
53 <refsynopsisdiv>
54 <para><filename>/etc/systemd/sleep.conf</filename></para>
55 <para><filename>/etc/systemd/sleep.conf.d/*.conf</filename></para>
56 <para><filename>/run/systemd/sleep.conf.d/*.conf</filename></para>
57 <para><filename>/usr/lib/systemd/sleep.conf.d/*.conf</filename></para>
58 </refsynopsisdiv>
59
60 <refsect1>
61 <title>Description</title>
62
63 <para><command>systemd</command> supports four general
64 power-saving modes:</para>
65
66 <variablelist>
67 <varlistentry>
68 <term>suspend</term>
69
70 <listitem><para>a low-power state
71 where execution of the OS is paused,
72 and complete power loss might result
73 in lost data, and which is fast to
74 enter and exit. This corresponds to
75 suspend, standby, or freeze states as
76 understood by the kernel.
77 </para></listitem>
78 </varlistentry>
79
80 <varlistentry>
81 <term>hibernate</term>
82
83 <listitem><para>a low-power state
84 where execution of the OS is paused,
85 and complete power loss does not
86 result in lost data, and which might
87 be slow to enter and exit. This
88 corresponds to the hibernation as
89 understood by the kernel.
90 </para></listitem>
91 </varlistentry>
92
93 <varlistentry>
94 <term>hybrid-sleep</term>
95
96 <listitem><para>a low-power state
97 where execution of the OS is paused,
98 which might be slow to enter, and on
99 complete power loss does not result in
100 lost data but might be slower to exit
101 in that case. This mode is called
102 suspend-to-both by the kernel.
103 </para></listitem>
104 </varlistentry>
105
106 <varlistentry>
107 <term>suspend-then-hibernate</term>
108
109 <listitem><para>A low power state where the system is initially suspended
110 (the state is stored in RAM). If not interrupted within the delay specified by
111 <command>HibernateDelaySec=</command>, the system will be woken using an RTC
112 alarm and hibernated (the state is then stored on disk).
113 </para></listitem>
114 </varlistentry>
115
116 </variablelist>
117
118 <para>Settings in these files determine what strings
119 will be written to
120 <filename>/sys/power/disk</filename> and
121 <filename>/sys/power/state</filename> by
122 <citerefentry><refentrytitle>systemd-sleep</refentrytitle><manvolnum>8</manvolnum></citerefentry>
123 when
124 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
125 attempts to suspend or hibernate the machine.</para>
126 </refsect1>
127
128 <xi:include href="standard-conf.xml" xpointer="main-conf" />
129
130 <refsect1>
131 <title>Options</title>
132
133 <para>The following options can be configured in the
134 <literal>[Sleep]</literal> section of
135 <filename>/etc/systemd/sleep.conf</filename> or a
136 <filename>sleep.conf.d</filename> file:</para>
137
138 <variablelist class='systemd-directives'>
139 <varlistentry>
140 <term><varname>SuspendMode=</varname></term>
141 <term><varname>HibernateMode=</varname></term>
142 <term><varname>HybridSleepMode=</varname></term>
143
144 <listitem><para>The string to be written to
145 <filename>/sys/power/disk</filename> by,
146 respectively,
147 <citerefentry><refentrytitle>systemd-suspend.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
148 <citerefentry><refentrytitle>systemd-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
149 <citerefentry><refentrytitle>systemd-hybrid-sleep.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, or
150 <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
151 More than one value can be specified by separating
152 multiple values with whitespace. They will be tried
153 in turn, until one is written without error. If
154 neither succeeds, the operation will be aborted.
155 </para></listitem>
156 </varlistentry>
157
158 <varlistentry>
159 <term><varname>SuspendState=</varname></term>
160 <term><varname>HibernateState=</varname></term>
161 <term><varname>HybridSleepState=</varname></term>
162
163 <listitem><para>The string to be written to
164 <filename>/sys/power/state</filename> by,
165 respectively,
166 <citerefentry><refentrytitle>systemd-suspend.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
167 <citerefentry><refentrytitle>systemd-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
168 <citerefentry><refentrytitle>systemd-hybrid-sleep.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, or
169 <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
170 More than one value can be specified by separating
171 multiple values with whitespace. They will be tried
172 in turn, until one is written without error. If
173 neither succeeds, the operation will be aborted.
174 </para></listitem>
175 </varlistentry>
176 <varlistentry>
177 <term><varname>HibernateDelaySec=</varname></term>
178
179 <listitem><para>The amount of time in seconds
180 that will pass before the system is automatically
181 put into hibernate when using
182 <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
183 </para></listitem>
184 </varlistentry>
185 </variablelist>
186 </refsect1>
187
188 <refsect1>
189 <title>Example: freeze</title>
190
191 <para>Example: to exploit the <quote>freeze</quote> mode added
192 in Linux 3.9, one can use <command>systemctl suspend</command>
193 with
194 <programlisting>[Sleep]
195 SuspendState=freeze</programlisting></para>
196 </refsect1>
197
198 <refsect1>
199 <title>See Also</title>
200 <para>
201 <citerefentry><refentrytitle>systemd-sleep</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
202 <citerefentry><refentrytitle>systemd-suspend.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
203 <citerefentry><refentrytitle>systemd-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
204 <citerefentry><refentrytitle>systemd-hybrid-sleep.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
205 <citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
206 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
207 <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>
208 </para>
209 </refsect1>
210
211 </refentry>