Suspend to disk offered
Closed, ResolvedPublic

Description

Kickoff menu offers "Suspend To Disk" (Hibernate) in the Logout menu of live USB.

Needs to be investigated whether it should be offered or disabled.

broulik created this task.Apr 4 2018, 10:14 AM
sitter added a subscriber: sitter.Apr 4 2018, 10:15 AM
[12:13] <sitter> kbroulik: needs investigation. ubuntu disabled suspend to disk quite a while ago because it was way too unreliable and ofc requires swap
[12:14] <sitter> so, even if ubuntu changed their stance that'd still raise the question why the suspend option is available on the live system which has no swap so it couldn't suspend
[12:14] <kbroulik> I suspended to disk and resumed just fine on the USB stick though
[12:14] <kbroulik> mayyybe it used my local swap partition 
[12:15] <sitter> oh that could be
sitter added a comment.Apr 5 2018, 3:20 PM

It actually uses your swap partition for the hibernation.

It seems ubuntu no longer disables this in logind. It's probably no concern for them since both gnomeshell and unity lack the default UI ability for hibernation. So for all intents and purpose it doesn't exist.

In any case, neither suspend nor hibernate make much sense since the session is defunct after resume (or in hibernate's case you can't resume at all).

This does however raise a problem. How can we disable these two features in plasma?

I tried inhibiting sleep:idle in logind but since the user can sudo/is-admin it can override inhibitions meaning login1's dbus interface comes back CanSuspend==true and CanHibernate==true even though it is inhibited (albeit can be ignored because user is admin).

So, ideally I suppose we'd want to disable the features in plasma, but at a glance at least on a UI level there is no way to do that. Did I miss something?

If all fails we'd have to mangle the polkit xmls to disable inhibition ignoring, which is suuuuuuuuuper tricky because we basically have to do it in the session spin-up, which is basically a glorified initrd, which means we can't do much more than mess about with shell scripting 😢

the session is defunct after resume

I suspended to disk and woke up just fine on my laptop.
UX was somewhat poor, it didn't show progress while it was suspending (doesn't Plymouth even have a "hibernate" mode?) but other than that it worked surprisingly well.

there's peculiar things going on with plymouth, although I expect hibernate==shutdown as far as plymouth is concerned. perhaps my hibernate didn't resume because I was on UEFI. suspend definitely ended in a broken X for me though (may be problem with QXL driver).

in any event, I am not sure suspending and hibernating from the live session is a particularly useful feature to keep around, so I'd get rid of it. to be clear though: that'd be temporary for the live session, the final system would have the features available as supported by the hardware.

I am somewhat leaning towards ignoring this as a non-issue. Since it worked for broulik it's probably got no downsides other than UI clutter and marginal usefulness. Plasma lacks the ability to inhibit this in the UI, and we can't inhibit it via systemd unless we also edit the polkit profiles to disallow overriding inhibitions, which isn't the greatest thing since the profiles are XML, so we need to write a proper xmlparsing script to edit them (rather than a simple sed).

sitter added a subscriber: bshah.May 8 2018, 12:00 PM

Actually, @bshah what's your take on this? Should we care enough to disable hibernate and suspend for live sessions via a custom XML editing script?