summaryrefslogtreecommitdiffstats
path: root/man/systemd-sleep.conf.xml
diff options
context:
space:
mode:
authorSonali Srivastava <srivastava.sonali1@gmail.com>2022-07-20 11:17:04 +0200
committerSonali Srivastava <srivastava.sonali1@gmail.com>2022-07-20 14:09:07 +0200
commit91ea7ebcdfac18137a1f3d1e89d99917ad66d87f (patch)
tree696d22a49f7ccad2cf14321da2f50c821854f92d /man/systemd-sleep.conf.xml
parentsleep: use current charge level to decide suspension (diff)
downloadsystemd-91ea7ebcdfac18137a1f3d1e89d99917ad66d87f.tar.xz
systemd-91ea7ebcdfac18137a1f3d1e89d99917ad66d87f.zip
sleep: store battery discharge rate/hour with hash
Estimated battery discharge rate per hour is stored in : /var/lib/systemd/sleep/battery_discharge_percentage_rate_per_hour This value is used to determine the initial suspend interval. In case this file is not available or value is invalid, HibernateDelaySec interval is used. After wakeup from initial suspend, this value is again estimated and written to file if value is in range of 1-199. Logs for reference : HibernateDelaySec=15min - Updated in /etc/systemd/sleep.conf Jul 14 19:17:58 localhost systemd-sleep[567]: Current battery charge percentage: 100% Jul 14 19:17:58 localhost systemd-sleep[567]: Failed to read discharge rate from /var/lib/systemd/sleep/batt ery_discharge_percentage_rate_per_hour: No such file or directory Jul 14 19:17:58 localhost systemd-sleep[567]: Set timerfd wake alarm for 15min Jul 14 19:33:00 localhost systemd-sleep[567]: Current battery charge percentage after wakeup: 90% Jul 14 19:33:00 localhost systemd-sleep[567]: Attempting to estimate battery discharge rate after wakeup from 15min sleep Jul 14 19:33:00 localhost systemd-sleep[567]: product_id does not exist: No such file or directory Jul 14 19:33:00 localhost systemd-sleep[567]: Estimated discharge rate 39 successfully updated to /var/lib/systemd/sleep/battery_discharge_percentage_rate_per_hour Jul 14 19:33:00 localhost systemd-sleep[567]: Current battery charge percentage: 90% Jul 14 19:33:00 localhost systemd-sleep[567]: product_id does not exist: No such file or directory Jul 14 19:33:00 localhost systemd-sleep[567]: Set timerfd wake alarm for 1h 48min 27s Jul 14 21:21:30 localhost systemd-sleep[567]: Current battery charge percentage after wakeup: 90% Jul 14 21:21:30 localhost systemd-sleep[567]: Battery was not discharged during suspension
Diffstat (limited to 'man/systemd-sleep.conf.xml')
-rw-r--r--man/systemd-sleep.conf.xml23
1 files changed, 17 insertions, 6 deletions
diff --git a/man/systemd-sleep.conf.xml b/man/systemd-sleep.conf.xml
index 0c01ecf3ff..2f04ce84a1 100644
--- a/man/systemd-sleep.conf.xml
+++ b/man/systemd-sleep.conf.xml
@@ -78,9 +78,20 @@
<term>suspend-then-hibernate</term>
<listitem><para>A low power state where the system is initially suspended
- (the state is stored in RAM). If not interrupted within the delay specified by
- <command>HibernateDelaySec=</command>, the system will be woken using an RTC
- alarm and hibernated (the state is then stored on disk).
+ (the state is stored in RAM) and then hibernated based on battery percentage
+ capacity. If the current battery capacity is higher than 5%, the system goes
+ back to suspend for interval calculated using battery disharge rate per hour.
+ Battery discharge rate per hour is stored in a file which is created after
+ initial suspend-resume cycle. The value is calculated using battery decreasing
+ charge level a timespan. In case of manual wakeup before RTC alarm, the timespan
+ is the duration for which system was suspended. If the file does not exist or
+ has invalid value, initial suspend duration is set to
+ <command>HibernateDelaySec=</command>.
+ After wakeup via an RTC alarm, the battery discharge rate per hour is again
+ estimated. If the current battery charge level is equal to or less than 5%,
+ the system will be hibernated (the state is then stored on disk) else the
+ system goes back to suspend for the amount of time it would take to fully
+ discharge the battery minus 30 minutes.
</para></listitem>
</varlistentry>
@@ -173,9 +184,9 @@
</varlistentry>
<varlistentry>
<term><varname>HibernateDelaySec=</varname></term>
-
- <listitem><para>The amount of time the system spends in suspend mode before the system is
- automatically put into hibernate mode, when using
+ <listitem><para>The amount of time the system spends in suspend mode
+ before the RTC alarm wakes the system, before the battery discharge rate
+ can be estimated and used instead to calculate the suspension interval.
<citerefentry><refentrytitle>systemd-suspend-then-hibernate.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. Defaults
to 2h.</para></listitem>
</varlistentry>