chiark / gitweb /
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)
committerSven Eden <yamakuzure@gmx.net>
Mon, 25 Sep 2017 12:34:49 +0000 (14:34 +0200)
commit0bd783770a0b8216a99a78146f83c942e9042233
tree93a4b40be216ac6f19b611d0a81289cb10bcef86
parent121b6e868e29da661885f7a8100b603fc7212046
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