Debian Codegraph @

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

raw
1 '\" t
2 .TH "SYSTEMD\-SLEEP\&.CONF" "5" "" "systemd 261~rc3" "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, low\-battery alarms (ACPI _BTP) are tried first for detecting battery percentage and wake up the system for hibernation\&. If
80 \fIHibernateDelaySec=\fR
81 is also set, an additional timer is configured so that the system hibernates on whichever comes first: low battery or the configured delay\&. If ACPI _BTP is not available, 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,
82 \fISuspendEstimationSec=\fR
83 is used as last resort\&.
84 .sp
85 Added in version 239\&.
86 .RE
87 .PP
88 Settings in these files determine what strings will be written to
89 /sys/power/disk
90 and
91 /sys/power/state
92 by
93 \fBsystemd-sleep\fR(8)
94 when
95 \fBsystemd\fR(1)
96 attempts to suspend or hibernate the machine\&. See
97 \fBsystemd.syntax\fR(7)
98 for a general description of the syntax\&.
99 .SH "CONFIGURATION DIRECTORIES AND PRECEDENCE"
100 .PP
101 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:
102 /etc/systemd/,
103 /run/systemd/,
104 /usr/local/lib/systemd/
105 \&\s-2\u[1]\d\s+2,
106 /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
107 /etc/
108 if it is shipped under
109 /usr/), however using drop\-ins for local configuration is recommended over modifications to the main configuration file\&.
110 .PP
111 In addition to the main configuration file, drop\-in configuration snippets are read from
112 /usr/lib/systemd/*\&.conf\&.d/,
113 /usr/local/lib/systemd/*\&.conf\&.d/, and
114 /etc/systemd/*\&.conf\&.d/\&. Those drop\-ins have higher precedence and override the main configuration file\&. Files in the
115 *\&.conf\&.d/
116 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\&.
117 .PP
118 When packages need to customize the configuration, they can install drop\-ins under
119 /usr/\&. Files in
120 /etc/
121 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
122 /usr/
123 and the range 60\-90 for drop\-ins in
124 /etc/
125 and
126 /run/, to make sure that local and transient drop\-ins take priority over drop\-ins shipped by the OS vendor\&.
127 .PP
128 To disable a configuration file supplied by the vendor, the recommended way is to place a symlink to
129 /dev/null
130 in the configuration directory in
131 /etc/, with the same filename as the vendor configuration file\&.
132 .SH "OPTIONS"
133 .PP
134 The following options can be configured in the [Sleep] section of
135 /etc/systemd/sleep\&.conf
136 or a
137 sleep\&.conf\&.d
138 file:
139 .PP
140 \fIAllowSuspend=\fR, \fIAllowHibernation=\fR, \fIAllowHybridSleep=\fR, \fIAllowSuspendThenHibernate=\fR
141 .RS 4
142 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\&.
143 .sp
144 If
145 \fIAllowHibernation=no\fR
146 or
147 \fIAllowSuspend=no\fR
148 is used, this implies
149 \fIAllowSuspendThenHibernate=no\fR
150 and
151 \fIAllowHybridSleep=no\fR, since those methods use both suspend and hibernation internally\&.
152 \fIAllowSuspendThenHibernate=yes\fR
153 and
154 \fIAllowHybridSleep=yes\fR
155 can be used to override and enable those specific modes\&.
156 .sp
157 Added in version 240\&.
158 .RE
159 .PP
160 \fISuspendState=\fR
161 .RS 4
162 The string to be written to
163 /sys/power/state
164 by
165 \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\&.
166 .sp
167 The allowed set of values is determined by the kernel and is shown in the file itself (use
168 \fBcat /sys/power/state\fR
169 to display)\&. See
170 \m[blue]\fBBasic sysfs Interfaces for System Suspend and Hibernation\fR\m[]\&\s-2\u[2]\d\s+2
171 for more details\&.
172 .sp
173 \fBsystemd-suspend-then-hibernate.service\fR(8)
174 uses this value when suspending\&.
175 .sp
176 Added in version 203\&.
177 .RE
178 .PP
179 \fIHibernateMode=\fR
180 .RS 4
181 The string to be written to
182 /sys/power/disk
183 by
184 \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\&.
185 .sp
186 The allowed set of values is determined by the kernel and is shown in the file itself (use
187 \fBcat /sys/power/disk\fR
188 to display)\&. See the kernel documentation page
189 \m[blue]\fBBasic sysfs Interfaces for System Suspend and Hibernation\fR\m[]\&\s-2\u[2]\d\s+2
190 for more details\&.
191 .sp
192 \fBsystemd-suspend-then-hibernate.service\fR(8)
193 uses the value of
194 \fIHibernateMode=\fR
195 when hibernating\&.
196 .sp
197 Added in version 203\&.
198 .RE
199 .PP
200 \fIMemorySleepMode=\fR
201 .RS 4
202 The string to be written to
203 /sys/power/mem_sleep
204 when
205 \fBSuspendState=mem\fR
206 or
207 \fBhybrid\-sleep\fR
208 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
209 \fImem_sleep_default=\fR
210 is respected\&.
211 .sp
212 The allowed set of values is determined by the kernel and is shown in the file itself (use
213 \fBcat /sys/power/mem_sleep\fR
214 to display)\&. See the kernel documentation page
215 \m[blue]\fBBasic sysfs Interfaces for System Suspend and Hibernation\fR\m[]\&\s-2\u[2]\d\s+2
216 for more details\&.
217 .sp
218 Added in version 256\&.
219 .RE
220 .PP
221 \fIHibernateDelaySec=\fR
222 .RS 4
223 The amount of time the system spends in suspend mode before the system is automatically put into hibernate mode\&. Only used by
224 \fBsystemd-suspend-then-hibernate.service\fR(8)\&. Refer to
225 \fBsuspend\-then\-hibernate\fR
226 for details on how this option interacts with other options/system battery state\&.
227 .sp
228 Added in version 239\&.
229 .RE
230 .PP
231 \fIHibernateOnACPower=\fR
232 .RS 4
233 Whether to allow hibernation when the system has AC power\&. Only used by
234 \fBsystemd-suspend-then-hibernate.service\fR(8)
235 when
236 \fIHibernateDelaySec=\fR
237 is set\&.
238 .sp
239 If this option is disabled, the countdown of
240 \fIHibernateDelaySec=\fR
241 starts only after AC power is disconnected, keeping the system in the suspend state otherwise\&.
242 .sp
243 This option is only effective on systems with a battery\&.
244 .sp
245 Added in version 257\&.
246 .RE
247 .PP
248 \fISuspendEstimationSec=\fR
249 .RS 4
250 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
251 \fBsystemd-suspend-then-hibernate.service\fR(8)\&. Refer to
252 \fBsuspend\-then\-hibernate\fR
253 for details on how this option interacts with other options/system battery state\&.
254 .sp
255 Added in version 253\&.
256 .RE
257 .SH "EXAMPLE: FREEZE"
258 .PP
259 Example: to exploit the
260 \(lqfreeze\(rq
261 mode added in Linux 3\&.9, one can use
262 \fBsystemctl suspend\fR
263 with
264 .sp
265 .if n \{\
266 .RS 4
267 .\}
268 .nf
269 [Sleep]
270 SuspendState=freeze
271 .fi
272 .if n \{\
273 .RE
274 .\}
275 .SH "SEE ALSO"
276 .PP
277 \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)
278 .SH "NOTES"
279 .IP " 1." 4
280 💣💥🧨💥💥💣 Please note that those configuration files must be available at all times. If
281 /usr/local/
282 is a separate partition, it may not be available during early boot, and must not be used for configuration.
283 .IP " 2." 4
284 Basic sysfs Interfaces for System Suspend and Hibernation
285 .RS 4
286 \%https://docs.kernel.org/admin-guide/pm/sleep-states.html#basic-sysfs-interfaces-for-system-suspend-and-hibernation
287 .RE