On Wed, Sep 12, 2018 at 08:58:46AM -0500, mcatanzaro(a)gnome.org wrote:
On Wed, Sep 12, 2018 at 8:44 AM, Matthias Clasen
<mclasen(a)redhat.com> wrote:
>If it works, why should we make it configurable ? I don't think
>anybody wants their battery drained...
>What corner cases are you thinking of ?
Kamil is surely worried that the system will attempt to hibernate
and fail, leading to data loss. Historically, we have not exposed
hibernate to users precisely because we expect it to fail. (We are
even recently discussed getting rid of the swap partition!)
It looks like that would be a systemd or kernel bug, because we ask
systemd if hibernate is supported, and do not attempt to hibernate
at all if it's not. Hopefully systemd is right about that in
practice....
Systemd checks if there's a swap device and if there's enough space
on it to fit current RSS. If systemd returns true from
org.freedesktop.login1.Manager.CanHibernate or
org.freedesktop.login1.Manager.CanSuspendThenHibernate when those
conditions are not satisfied, that would be a bug.
It also has some other heuristics, e.g. hibernation should be disabled
after a kernel upgrade. But systemd does not check if resume= is set.
I'm sure that are other ways in which this detection is faulty.
In recent times hibernation support in systemd hasn't been getting
much testing, so if it's to be used by default in gnome, more testing
(and reports of bugs) would be very welcome.
It is possible to disable any suspend/hibernation mode using
'systemctl mask suspend.target/hibnerate.target/suspend-then-hibernate.target'.
Zbyszek