Debian Codegraph @

upstream/debian-trixie/man5/systemd-sleep.conf.5

raw
1 '\" t
2 .TH "SYSTEMD\-SLEEP\&.CONF" "5" "" "systemd 257.13" "systemd-sleep.conf"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 systemd-sleep.conf, sleep.conf.d \- Suspend and hibernation configuration file
24 .SH "SYNOPSIS"
25 .PP
26 .RS 4
27 /etc/systemd/sleep\&.conf
28 .RE
29 .RS 4
30 /run/systemd/sleep\&.conf
31 .RE
32 .RS 4
33 /usr/lib/systemd/sleep\&.conf
34 .RE
35 .RS 4
36 /etc/systemd/sleep\&.conf\&.d/*\&.conf
37 .RE
38 .RS 4
39 /run/systemd/sleep\&.conf\&.d/*\&.conf
40 .RE
41 .RS 4
42 /usr/lib/systemd/sleep\&.conf\&.d/*\&.conf
43 .RE
44 .SH "DESCRIPTION"
45 .PP
46 \fBsystemd\fR
47 supports four general power\-saving modes:
48 .PP
49 suspend
50 .RS 4
51 a low\-power state where execution of the OS is paused, and complete power loss might result in lost data, and which is fast to enter and exit\&. This corresponds to suspend, standby, or freeze states as understood by the kernel\&.
52 .sp
53 Added in version 203\&.
54 .RE
55 .PP
56 hibernate
57 .RS 4
58 a low\-power state where execution of the OS is paused, and complete power loss does not result in lost data, and which might be slow to enter and exit\&. This corresponds to the hibernation as understood by the kernel\&.
59 .sp
60 Added in version 203\&.
61 .RE
62 .PP
63 hybrid\-sleep
64 .RS 4
65 a low\-power state where execution of the OS is paused, which might be slow to enter, and on complete power loss does not result in lost data but might be slower to exit in that case\&. This mode is called suspend\-to\-both by the kernel\&.
66 .sp
67 Added in version 203\&.
68 .RE
69 .PP
70 suspend\-then\-hibernate
71 .RS 4
72 A low power state where the system is initially suspended (the state is stored in RAM)\&. When the battery level is too low (less than 5%) or a certain timespan has passed, whichever happens first, the system is automatically woken up and then hibernated\&. This establishes a balance between speed and safety\&.
73 .sp
74 If the system has no battery, it would be hibernated after
75 \fIHibernateDelaySec=\fR
76 has passed\&. If not set, then defaults to
77 "2h"\&.
78 .sp
79 If the system has battery and
80 \fIHibernateDelaySec=\fR
81 is not set, low\-battery alarms (ACPI _BTP) are tried first for detecting battery percentage and wake up the system for hibernation\&. If not available, or
82 \fIHibernateDelaySec=\fR
83 is set, the system would regularly wake up to check the time and detect the battery percentage/discharging rate\&. The rate is used to schedule the next detection\&. If that is also not available,
84 \fISuspendEstimationSec=\fR
85 is used as last resort\&.
86 .sp
87 Added in version 239\&.
88 .RE
89 .PP
90 Settings in these files determine what strings will be written to
91 /sys/power/disk
92 and
93 /sys/power/state
94 by
95 \fBsystemd-sleep\fR(8)
96 when
97 \fBsystemd\fR(1)
98 attempts to suspend or hibernate the machine\&. See
99 \fBsystemd.syntax\fR(7)
100 for a general description of the syntax\&.
101 .SH "CONFIGURATION DIRECTORIES AND PRECEDENCE"
102 .PP
103 The default configuration is set during compilation, so configuration is only needed when it is necessary to deviate from those defaults\&. The main configuration file is loaded from one of the listed directories in order of priority, only the first file found is used:
104 /etc/systemd/,
105 /run/systemd/,
106 /usr/local/lib/systemd/
107 \&\s-2\u[1]\d\s+2,
108 /usr/lib/systemd/\&. The vendor version of the file contains commented out entries showing the defaults as a guide to the administrator\&. Local overrides can also be created by creating drop\-ins, as described below\&. The main configuration file can also be edited for this purpose (or a copy in
109 /etc/
110 if it is shipped under
111 /usr/), however using drop\-ins for local configuration is recommended over modifications to the main configuration file\&.
112 .PP
113 In addition to the main configuration file, drop\-in configuration snippets are read from
114 /usr/lib/systemd/*\&.conf\&.d/,
115 /usr/local/lib/systemd/*\&.conf\&.d/, and
116 /etc/systemd/*\&.conf\&.d/\&. Those drop\-ins have higher precedence and override the main configuration file\&. Files in the
117 *\&.conf\&.d/
118 configuration subdirectories are sorted by their filename in lexicographic order, regardless of in which of the subdirectories they reside\&. When multiple files specify the same option, for options which accept just a single value, the entry in the file sorted last takes precedence, and for options which accept a list of values, entries are collected as they occur in the sorted files\&.
119 .PP
120 When packages need to customize the configuration, they can install drop\-ins under
121 /usr/\&. Files in
122 /etc/
123 are reserved for the local administrator, who may use this logic to override the configuration files installed by vendor packages\&. Drop\-ins have to be used to override package drop\-ins, since the main configuration file has lower precedence\&. It is recommended to prefix all filenames in those subdirectories with a two\-digit number and a dash, to simplify the ordering\&. This also defines a concept of drop\-in priorities to allow OS vendors to ship drop\-ins within a specific range lower than the range used by users\&. This should lower the risk of package drop\-ins overriding accidentally drop\-ins defined by users\&. It is recommended to use the range 10\-40 for drop\-ins in
124 /usr/
125 and the range 60\-90 for drop\-ins in
126 /etc/
127 and
128 /run/, to make sure that local and transient drop\-ins take priority over drop\-ins shipped by the OS vendor\&.
129 .PP
130 To disable a configuration file supplied by the vendor, the recommended way is to place a symlink to
131 /dev/null
132 in the configuration directory in
133 /etc/, with the same filename as the vendor configuration file\&.
134 .SH "OPTIONS"
135 .PP
136 The following options can be configured in the [Sleep] section of
137 /etc/systemd/sleep\&.conf
138 or a
139 sleep\&.conf\&.d
140 file:
141 .PP
142 \fIAllowSuspend=\fR, \fIAllowHibernation=\fR, \fIAllowHybridSleep=\fR, \fIAllowSuspendThenHibernate=\fR
143 .RS 4
144 By default, any power\-saving mode is advertised if possible (i\&.e\&. the kernel supports that mode, the necessary resources are available)\&. Those switches can be used to disable specific modes\&.
145 .sp
146 If
147 \fIAllowHibernation=no\fR
148 or
149 \fIAllowSuspend=no\fR
150 is used, this implies
151 \fIAllowSuspendThenHibernate=no\fR
152 and
153 \fIAllowHybridSleep=no\fR, since those methods use both suspend and hibernation internally\&.
154 \fIAllowSuspendThenHibernate=yes\fR
155 and
156 \fIAllowHybridSleep=yes\fR
157 can be used to override and enable those specific modes\&.
158 .sp
159 Added in version 240\&.
160 .RE
161 .PP
162 \fISuspendState=\fR
163 .RS 4
164 The string to be written to
165 /sys/power/state
166 by
167 \fBsystemd-suspend.service\fR(8)\&. More than one value can be specified by separating multiple values with whitespace\&. They will be tried in turn, until one is written without error\&. If none of the writes succeed, the operation will be aborted\&.
168 .sp
169 The allowed set of values is determined by the kernel and is shown in the file itself (use
170 \fBcat /sys/power/state\fR
171 to display)\&. See
172 \m[blue]\fBBasic sysfs Interfaces for System Suspend and Hibernation\fR\m[]\&\s-2\u[2]\d\s+2
173 for more details\&.
174 .sp
175 \fBsystemd-suspend-then-hibernate.service\fR(8)
176 uses this value when suspending\&.
177 .sp
178 Added in version 203\&.
179 .RE
180 .PP
181 \fIHibernateMode=\fR
182 .RS 4
183 The string to be written to
184 /sys/power/disk
185 by
186 \fBsystemd-hibernate.service\fR(8)\&. More than one value can be specified by separating multiple values with whitespace\&. They will be tried in turn, until one is written without error\&. If none of the writes succeed, the operation will be aborted\&.
187 .sp
188 The allowed set of values is determined by the kernel and is shown in the file itself (use
189 \fBcat /sys/power/disk\fR
190 to display)\&. See the kernel documentation page
191 \m[blue]\fBBasic sysfs Interfaces for System Suspend and Hibernation\fR\m[]\&\s-2\u[2]\d\s+2
192 for more details\&.
193 .sp
194 \fBsystemd-suspend-then-hibernate.service\fR(8)
195 uses the value of
196 \fIHibernateMode=\fR
197 when hibernating\&.
198 .sp
199 Added in version 203\&.
200 .RE
201 .PP
202 \fIMemorySleepMode=\fR
203 .RS 4
204 The string to be written to
205 /sys/power/mem_sleep
206 when
207 \fBSuspendState=mem\fR
208 or
209 \fBhybrid\-sleep\fR
210 is used\&. More than one value can be specified by separating multiple values with whitespace\&. They will be tried in turn, until one is written without error\&. If none of the writes succeed, the operation will be aborted\&. Defaults to empty, i\&.e\&. the kernel default or kernel command line option
211 \fImem_sleep_default=\fR
212 is respected\&.
213 .sp
214 The allowed set of values is determined by the kernel and is shown in the file itself (use
215 \fBcat /sys/power/mem_sleep\fR
216 to display)\&. See the kernel documentation page
217 \m[blue]\fBBasic sysfs Interfaces for System Suspend and Hibernation\fR\m[]\&\s-2\u[2]\d\s+2
218 for more details\&.
219 .sp
220 Added in version 256\&.
221 .RE
222 .PP
223 \fIHibernateDelaySec=\fR
224 .RS 4
225 The amount of time the system spends in suspend mode before the system is automatically put into hibernate mode\&. Only used by
226 \fBsystemd-suspend-then-hibernate.service\fR(8)\&. Refer to
227 \fBsuspend\-then\-hibernate\fR
228 for details on how this option interacts with other options/system battery state\&.
229 .sp
230 Added in version 239\&.
231 .RE
232 .PP
233 \fIHibernateOnACPower=\fR
234 .RS 4
235 Whether to allow hibernation when the system has AC power\&. Only used by
236 \fBsystemd-suspend-then-hibernate.service\fR(8)
237 when
238 \fIHibernateDelaySec=\fR
239 is set\&.
240 .sp
241 If this option is disabled, the countdown of
242 \fIHibernateDelaySec=\fR
243 starts only after AC power is disconnected, keeping the system in the suspend state otherwise\&.
244 .sp
245 This option is only effective on systems with a battery\&.
246 .sp
247 Added in version 257\&.
248 .RE
249 .PP
250 \fISuspendEstimationSec=\fR
251 .RS 4
252 The RTC alarm will wake the system after the specified timespan to measure the system battery capacity level and estimate battery discharging rate\&. Only used by
253 \fBsystemd-suspend-then-hibernate.service\fR(8)\&. Refer to
254 \fBsuspend\-then\-hibernate\fR
255 for details on how this option interacts with other options/system battery state\&.
256 .sp
257 Added in version 253\&.
258 .RE
259 .SH "EXAMPLE: FREEZE"
260 .PP
261 Example: to exploit the
262 \(lqfreeze\(rq
263 mode added in Linux 3\&.9, one can use
264 \fBsystemctl suspend\fR
265 with
266 .sp
267 .if n \{\
268 .RS 4
269 .\}
270 .nf
271 [Sleep]
272 SuspendState=freeze
273 .fi
274 .if n \{\
275 .RE
276 .\}
277 .SH "SEE ALSO"
278 .PP
279 \fBsystemd-sleep\fR(8), \fBsystemd-suspend.service\fR(8), \fBsystemd-hibernate.service\fR(8), \fBsystemd-hybrid-sleep.service\fR(8), \fBsystemd-suspend-then-hibernate.service\fR(8), \fBsystemd\fR(1), \fBsystemd.directives\fR(7)
280 .SH "NOTES"
281 .IP " 1." 4
282 💣💥🧨💥💥💣 Please note that those configuration files must be available at all times. If
283 /usr/local/
284 is a separate partition, it may not be available during early boot, and must not be used for configuration.
285 .IP " 2." 4
286 Basic sysfs Interfaces for System Suspend and Hibernation
287 .RS 4
288 \%https://docs.kernel.org/admin-guide/pm/sleep-states.html#basic-sysfs-interfaces-for-system-suspend-and-hibernation
289 .RE