logind: add missing resume signal when we fail to initiate sleep/shutdown
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>
Thu, 24 Aug 2017 09:33:24 +0000 (10:33 +0100)
committerAlan Jenkins <alan.christopher.jenkins@gmail.com>
Thu, 24 Aug 2017 13:52:22 +0000 (14:52 +0100)
commit6d7f7fd49f8a094fc36e750de1e80afea80c8228
tree0932f42756221b6960816f2957f02dabaf654245
parentdf75a1a8aa5420335a56093077fa8cfcbfffac78
logind: add missing resume signal when we fail to initiate sleep/shutdown

This fixed https://bugzilla.redhat.com/show_bug.cgi?id=1476313
as much as I was able to reproduce it in a VM, at least.

E.g. this signal might wake the screen back up, providing a more visible
indicator of suspend failure.  In my VM testing, it was also required in
order to unblock keyboard input in gnome-shell after the failed suspend.

At the same time, fix the error handling for scheduled shutdowns.  This now
mirrors the behaviour of when you use `shutdown -k` - it sends all the
scary messages about shutting down, "but you'll have to do it [shut down
the system] yourself".  It also avoids the risk of locking out the admin
(nologin file), in case they logged out for some reason (and they use
`sudo` instead of root).

Not that I have any idea why you'd want to use `shutdown -k`, but the code
is easier to analyze if it rolls back on error (in the absence of any code
comment as to why that's not wanted).
src/login/logind-dbus.c