1SYSTEMD-SLEEP.CONF(5) systemd-sleep.conf SYSTEMD-SLEEP.CONF(5)
2
3
4
6 systemd-sleep.conf, sleep.conf.d - Suspend and hibernation
7 configuration file
8
10 /etc/systemd/sleep.conf
11
12 /etc/systemd/sleep.conf.d/*.conf
13
14 /run/systemd/sleep.conf.d/*.conf
15
16 /usr/lib/systemd/sleep.conf.d/*.conf
17
19 systemd supports four general power-saving modes:
20
21 suspend
22 a low-power state where execution of the OS is paused, and complete
23 power loss might result in lost data, and which is fast to enter
24 and exit. This corresponds to suspend, standby, or freeze states as
25 understood by the kernel.
26
27 hibernate
28 a low-power state where execution of the OS is paused, and complete
29 power loss does not result in lost data, and which might be slow to
30 enter and exit. This corresponds to the hibernation as understood
31 by the kernel.
32
33 hybrid-sleep
34 a low-power state where execution of the OS is paused, which might
35 be slow to enter, and on complete power loss does not result in
36 lost data but might be slower to exit in that case. This mode is
37 called suspend-to-both by the kernel.
38
39 suspend-then-hibernate
40 A low power state where the system is initially suspended (the
41 state is stored in RAM). If the system supports low-battery alarms
42 (ACPI _BTP), then the system will be woken up by the ACPI
43 low-battery signal and hibernated (the state is then stored on
44 disk). Also, if not interrupted within the timespan specified by
45 HibernateDelaySec= or the estimated timespan until the system
46 battery charge level goes down to 5%, then the system will be woken
47 up by the RTC alarm and hibernated. The estimated timespan is
48 calculated from the change of the battery capacity level after the
49 time specified by SuspendEstimationSec= or when the system is woken
50 up from the suspend.
51
52 Settings in these files determine what strings will be written to
53 /sys/power/disk and /sys/power/state by systemd-sleep(8) when
54 systemd(1) attempts to suspend or hibernate the machine. See
55 systemd.syntax(7) for a general description of the syntax.
56
58 The default configuration is set during compilation, so configuration
59 is only needed when it is necessary to deviate from those defaults.
60 Initially, the main configuration file in /etc/systemd/ contains
61 commented out entries showing the defaults as a guide to the
62 administrator. Local overrides can be created by editing this file or
63 by creating drop-ins, as described below. Using drop-ins for local
64 configuration is recommended over modifications to the main
65 configuration file.
66
67 In addition to the "main" configuration file, drop-in configuration
68 snippets are read from /usr/lib/systemd/*.conf.d/,
69 /usr/local/lib/systemd/*.conf.d/, and /etc/systemd/*.conf.d/. Those
70 drop-ins have higher precedence and override the main configuration
71 file. Files in the *.conf.d/ configuration subdirectories are sorted by
72 their filename in lexicographic order, regardless of in which of the
73 subdirectories they reside. When multiple files specify the same
74 option, for options which accept just a single value, the entry in the
75 file sorted last takes precedence, and for options which accept a list
76 of values, entries are collected as they occur in the sorted files.
77
78 When packages need to customize the configuration, they can install
79 drop-ins under /usr/. Files in /etc/ are reserved for the local
80 administrator, who may use this logic to override the configuration
81 files installed by vendor packages. Drop-ins have to be used to
82 override package drop-ins, since the main configuration file has lower
83 precedence. It is recommended to prefix all filenames in those
84 subdirectories with a two-digit number and a dash, to simplify the
85 ordering of the files.
86
87 To disable a configuration file supplied by the vendor, the recommended
88 way is to place a symlink to /dev/null in the configuration directory
89 in /etc/, with the same filename as the vendor configuration file.
90
92 The following options can be configured in the [Sleep] section of
93 /etc/systemd/sleep.conf or a sleep.conf.d file:
94
95 AllowSuspend=, AllowHibernation=, AllowSuspendThenHibernate=,
96 AllowHybridSleep=
97 By default any power-saving mode is advertised if possible (i.e.
98 the kernel supports that mode, the necessary resources are
99 available). Those switches can be used to disable specific modes.
100
101 If AllowHibernation=no or AllowSuspend=no is used, this implies
102 AllowSuspendThenHibernate=no and AllowHybridSleep=no, since those
103 methods use both suspend and hibernation internally.
104 AllowSuspendThenHibernate=yes and AllowHybridSleep=yes can be used
105 to override and enable those specific modes.
106
107 SuspendMode=, HibernateMode=, HybridSleepMode=
108 The string to be written to /sys/power/disk by, respectively,
109 systemd-suspend.service(8), systemd-hibernate.service(8), or
110 systemd-hybrid-sleep.service(8). More than one value can be
111 specified by separating multiple values with whitespace. They will
112 be tried in turn, until one is written without error. If none of
113 the writes succeed, the operation will be aborted.
114
115 The allowed set of values is determined by the kernel and is shown
116 in the file itself (use cat /sys/power/disk to display). See the
117 kernel documentation[1] for more details.
118
119 systemd-suspend-then-hibernate.service(8) uses the value of
120 SuspendMode= when suspending and the value of HibernateMode= when
121 hibernating.
122
123 SuspendState=, HibernateState=, HybridSleepState=
124 The string to be written to /sys/power/state by, respectively,
125 systemd-suspend.service(8), systemd-hibernate.service(8), or
126 systemd-hybrid-sleep.service(8). More than one value can be
127 specified by separating multiple values with whitespace. They will
128 be tried in turn, until one is written without error. If none of
129 the writes succeed, the operation will be aborted.
130
131 The allowed set of values is determined by the kernel and is shown
132 in the file itself (use cat /sys/power/state to display). See the
133 kernel documentation[1] for more details.
134
135 systemd-suspend-then-hibernate.service(8) uses the value of
136 SuspendState= when suspending and the value of HibernateState= when
137 hibernating.
138
139 HibernateDelaySec=
140 The amount of time the system spends in suspend mode before the
141 system is automatically put into hibernate mode. Only used by
142 systemd-suspend-then-hibernate.service(8). If the system has a
143 battery, then defaults to the estimated timespan until the system
144 battery charge level goes down to 5%. If the system has no battery,
145 then defaults to 2h.
146
147 SuspendEstimationSec=
148 The RTC alarm will wake the system after the specified timespan to
149 measure the system battery capacity level and estimate battery
150 discharging rate, which is used for estimating timespan until the
151 system battery charge level goes down to 5%. Only used by systemd-
152 suspend-then-hibernate.service(8). Defaults to 1h.
153
155 Example: to exploit the “freeze” mode added in Linux 3.9, one can use
156 systemctl suspend with
157
158 [Sleep]
159 SuspendState=freeze
160
162 systemd-sleep(8), systemd-suspend.service(8), systemd-
163 hibernate.service(8), systemd-hybrid-sleep.service(8), systemd-suspend-
164 then-hibernate.service(8), systemd(1), systemd.directives(7)
165
167 1. the kernel documentation
168 https://www.kernel.org/doc/html/latest/admin-guide/pm/sleep-states.html#basic-sysfs-interfaces-for-system-suspend-and-hibernation
169
170
171
172systemd 253 SYSTEMD-SLEEP.CONF(5)