Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 605370 - >=x11-misc/lightdm-1.18.3: Suspend/Hibernate not available on login screen of non-systemd installations
Summary: >=x11-misc/lightdm-1.18.3: Suspend/Hibernate not available on login screen of...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Lars Wendler (Polynomial-C)
Depends on:
Reported: 2017-01-11 10:19 UTC by Fitzcarraldo
Modified: 2019-09-10 13:04 UTC (History)
1 user (show)

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

Patch to liblightdm-gobject/power.c to use ConsoleKit for Suspend/Hibernate (1.18.3-upower-fix.patch,8.57 KB, patch)
2017-01-11 10:19 UTC, Fitzcarraldo
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fitzcarraldo 2017-01-11 10:19:57 UTC
Created attachment 459582 [details, diff]
Patch to liblightdm-gobject/power.c to use ConsoleKit for Suspend/Hibernate

When using =>x11-misc/lightdm-1.18.3 it is not possible to select Suspend or Hibernate on the LightDM login screen of a Gentoo installation that does not use systemd. This is because x11-misc/lightdm uses systemd-logind for Suspend/Hibernate, with upower as the fallback. I am assuming that sys-power/upower, sys-power/pm-utils and sys-auth/consolekit are installed.

In an installation that does not use systemd the Suspend and Hibernate entries in the Power pull-down menu on the LightDM GTK Greeter (x11-misc/lightdm-gtk-greeter-2.0.1-r1) are greyed-out and unusable.

In an installation that does not use systemd, the Suspend button on the LightDM KDE Greeter (lightdm-kde- is greyed-out and unusable. (The Hibernate button is configured by default to be hidden, but would also be greyed-out were it configured to be visible.)

I have not tried the other LightDM greeters, but, due to the current coding in liblightdm-gobject/power.c, I cannot conceive that Suspend/Hibernate could be selectable from any of the greeters in an installation that does not use systemd.

The current code of liblightdm-gobject/power.c uses org.freedesktop.login1 for each of Suspend, Hibernate, Restart and Shutdown. The code falls back to org.freedesktop.UPower for Suspend/Hibernate, and falls back to org.freedesktop.ConsoleKit for Restart/Shutdown.

The attached patch to power.c replaces the use of UPower with ConsoleKit.

If I apply the attached patch, Suspend and Hibernate buttons on the GTK Greeter are no longer greyed-out and they can be used to Suspend/Hibernate the machine. (Unfortunately, the code of lightdm-kde- is several years old and only appears to cater for org.freedesktop.UPower, therefore, even with the attached patch applied to x11-misc/lightdm-1.18.3, Suspend/Hibernate are still inactive on the KDE Greeter.)
Comment 1 Fitzcarraldo 2017-01-12 12:07:00 UTC
I added a comment in LightDM Bug Report No. 1631707 about the lack of support for Suspend/Hibernate for non-systemd installations:

As a result, LightDM developer Robert Ancell has kindly pushed a modified version of my patch that also fixes support for KDE greeters into the LightDM trunk, 1.20, 1.18 and 1.10 branches. So hopefully upcoming LightDM versions 1.21.4, 1.20.1, 1.18.4 and 1.10.7 will include support for Suspend/Hibernate on the login screen for both non-systemd and systemd installations. His commit log explains the update as follows:
Use power management functions from ConsoleKit2 if available.

Suspend and hibernate functionality was removed from upower 0.99.0, so systems not using systemd had no suspend/hibernate functionality. Support for this was added into ConsoleKit2.

Most systems will either be systemd or ConsoleKit2 now, so we try the following:
1. Power management in logind
2. Power management in ConsoleKit
3. upower for suspend/resume (really only here to not break backwards

Based on a patch for Gentoo by Fitzcarraldo.
Comment 2 Lars Wendler (Polynomial-C) gentoo-dev 2019-09-10 13:04:26 UTC
His has long been implemented by upstream. Marking this bug as obsolete.

Thanks for your great work Fitzcarraldo and sorry this bug didn't get the attention it deserved.