hardware actions disabled after first logout

Bug #1264838 reported by Yves-Alexis Perez
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
LightDM GTK Greeter
Fix Released
Undecided
Simon Steinbeiß
lightdm-gtk-greeter (Debian)
Confirmed
Unknown

Bug Description

Hi,

a Debian user reported a glitch in lightdm-gtk-greeter running on systemd/logind systems. It seems that a race condition happens when an user logs out, and that when the (second) lightdm-gtk-greeter starts and builds the hardware action menu, a logind session is still present for the old lightdm, and the various actions are marked as disabled.

Rebuilding the menu later seems to fix the problem. At tentative patch is present in the downstream bug report at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=732623 but it might not really be commitable in that state.

Changed in lightdm-gtk-greeter (Debian):
status: Unknown → Confirmed
Revision history for this message
Simon Steinbeiß (ochosi) wrote :

Salut Yves-Alexis,
I read through the long debian bugreport now. We know that the logind-policies are what is at fault partly (we contacted the systemd maintainers upstream and they changed the one related to reboot: http://cgit.freedesktop.org/systemd/systemd/commit/src/login/org.freedesktop.login1.policy.in?id=299404a19f26aa4f203042d8285ee0b7afa5bf40. FWIW, hibernate is still affected, because it is seemingly more "evil" than those other actions: https://bugs.freedesktop.org/show_bug.cgi?id=70237 I'm not sure how I lose more data when hibernating then when rebooting a running session...)

I read the patch and I understand what it's trying to do, but I currently see an issues here:
We never know when the user-session actually exits (finally), giving way to some of the power-actions (especially the multi-user ones, as set in the logind-policy). Could take 1sec, 5secs or up to 30secs (at least what I have heard of user reports). So even if the power-menu would check each time it gets clicked whether it is allowed to show some action, it might be that a few seconds later, more actions are available.

Anyway, with logind-policies changed to how they're now, ppl should be able to suspend/reboot or whatever from the greeter by default. So I think it is ok to only check the can_restart etc. stuff from lightdm once when the greeter is launched. What I plan to do though is to run a check once the shutdown/reboot dialogs are shown to see whether there is >=1 user logged in, and show a warning message that shutting down now may cause those users to lose data.

I do agree with the reporter of the upstream bug against the hibernate-policy of logind: why would you disallow hibernate (or restart or shutdown) on a computer where ppl have physical access when they can always pull the power-plug or hold down the power-button for >10secs (or even just press it once, in case logind's settings allow it to handle the power-button), etc...

Revision history for this message
Simon Steinbeiß (ochosi) wrote :

I pushed a rewritten version of the patch to trunk and it got released with 1.7.1, so I'm hoping to get positive feedback from you guys and then we can close this bugreport...
(At least I don't know what else to do on the greeter-side about these issues)

Changed in lightdm-gtk-greeter:
status: New → In Progress
assignee: nobody → Simon Steinbeiß (ochosi)
Changed in lightdm-gtk-greeter:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.