Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 656286 - x11-misc/sddm poweroff restart buttons greyed out (using systemd)
Summary: x11-misc/sddm poweroff restart buttons greyed out (using systemd)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LxQt maintainers
URL: https://github.com/sddm/sddm/issues/978
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-22 16:38 UTC by Stephan Karacson
Modified: 2018-05-28 19:50 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Ensure shutdown buttons are available without systemd (sddm-0.13.0-Start-upowerd-D-bus-service.patch,1.04 KB, patch)
2018-05-28 19:50 UTC, Petr Pisar
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Karacson 2018-05-22 16:38:59 UTC
Starting my Gentoo-Laptop logging in kde-plasma I can shutdown as always.
If I don't log in and want to shutdown/restart immediately these buttons are greyed out.
If I log in and after work just log out these buttons are greyed out.
(only in sddm)

Reproducible: always.

Solution found on debian bugtracker, arch forum and on github of sddm.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866865
https://bbs.archlinux.org/viewtopic.php?id=234450
https://github.com/sddm/sddm/issues/978

In /lib/systemd/system/sddm.service in the line "After=..." add  systemd-logind.service at last.
Workaround always works.

Seems to be a race condition as Chris on debian suggested.
Could this be patched in gentoo so I have no need to manually edit files in /lib?

My system is a 3 years fast gaming Laptop with an ssd.
x11-misc/sddm-0.17.0-r2
sys-apps/systemd-238-r6
sys-apps/dbus-1.10.24
Comment 1 Matthew Schultz 2018-05-24 18:19:04 UTC
This is apparently not systemd specific.  The suspend, reboot and shutdown buttons on the initial login screen as well as through ctrl+alt+del are also not showing when using openrc as well.
Comment 2 Matthew Schultz 2018-05-24 20:19:50 UTC
This fixed the problem for me: https://forum.voidlinux.eu/t/sddm-and-consolekit-quick-fix/4264
Comment 3 Matthew Schultz 2018-05-24 20:22:46 UTC
Quoted from the url I just posted:

"Going straight to the point: after a fresh void linux install, sddm WILL have problems with consolekit, because it fails to start an active consolekit session. This indeed leads to a number of problems, like

    No shutdown / hibernate / restart […] icon
    Can’t mount any filesystem
    Can’t edit NetworkManager or Sddm settings (from the applet or from systemsettings5)

The only fix needed is to remove nox11 from /etc/pam.d/system-login (should be on the pam_ck_connector line)

I’m too busy procrastinating and my brain is too small to somehow implement this in the xbps kde thingy github, i’ll just leave this here and thanks for reading that through! Void is the coolest distro i’ve ever tried."
Comment 4 Andreas Sturmlechner gentoo-dev 2018-05-24 21:12:18 UTC
@Matthew: Thanks, but your consolekit tricks are completely useless to a systemd user. Take a second to understand the problem before entering a comment.
Comment 5 Larry the Git Cow gentoo-dev 2018-05-27 21:34:33 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc186212892ef0c9872c16b73f55f79a96f0198e

commit dc186212892ef0c9872c16b73f55f79a96f0198e
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2018-05-27 20:26:08 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2018-05-27 21:34:11 +0000

    x11-misc/sddm: Upstream adj. to sddm.service to fix logind race cond.
    
    Closes: https://bugs.gentoo.org/656286
    Package-Manager: Portage-2.3.40, Repoman-2.3.9

 x11-misc/sddm/files/sddm-0.17.0-logind-race.patch | 26 +++++++
 x11-misc/sddm/sddm-0.17.0-r3.ebuild               | 83 +++++++++++++++++++++++
 2 files changed, 109 insertions(+)
Comment 6 Joakim Tjernlund 2018-05-28 12:43:50 UTC
(In reply to Andreas Sturmlechner from comment #4)
> @Matthew: Thanks, but your consolekit tricks are completely useless to a
> systemd user. Take a second to understand the problem before entering a
> comment.

hmm, if you delay systemd startup to fix this problem, maybe one could do
the same for openrc users?
Comment 7 Stephan Karacson 2018-05-28 16:41:11 UTC
Thank you for the fast solution. sddm-0.17.0-r3 fixes it on my systemd machine.

@openrc: might be the same symptom, but the same issue?
(might need another solution in the forum or a deeper/different bugreport, considering your workaround url) I can't reproduce it on another openrc machine.
Comment 8 Petr Pisar 2018-05-28 19:50:39 UTC
Created attachment 533842 [details, diff]
Ensure shutdown buttons are available without systemd

This patch used to be applied in Gentoo ebuild, but dropped later for unknown reason. It fixes the availability of shutdown icons with OpenRC.

I have OpenRC and sddm built with only pam use flag. Ebuild requires sys-power/upower to be installed on OpenRC systems. That's because sddm falls back to upowerd for discovering and performing a shutdown. The code this patch edits erroneously uses upowerd only if it's already been running.

But that's not guaranteed because /etc/init.d/xdm does not declare a dependency on upowerd. The patch unconditionally calls upowerd and letting D-Bus to start it automatically if not yet running.