Bug 700913

Summary: kdm doesn't provide power management (was: Thinkpad doesn't sleep when closed, if not logged in)
Product: [Fedora] Fedora Reporter: Tom Lane <tgl>
Component: kdebase-workspaceAssignee: Than Ngo <than>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: fedora, hhorak, jreznik, kevin, ltinkl, rdieter, rnovacek, ry, smparrish, than
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-04-30 20:51:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Tom Lane 2011-04-29 19:24:14 UTC
Description of problem:
Closing my ThinkPad T510 doesn't result in the machine going to sleep.

Version-Release number of selected component (if applicable):
kdebase-4.6.2-1.fc15.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Install F15 beta with KDE selected instead of GNOME.
2. Close laptop.
  
Actual results:
Machine is still fully awake (eg, I can ssh into it)

Expected results:
Low-power state

Additional info:
I've done a little bit of poking around and verified that /proc/acpi/button/lid/LID/state reports the correct "open" or "closed" state.  So it doesn't seem to be a hardware or kernel problem.  acpid's configuration files seem to not instruct it to do anything for lid open/close, so the onus is on whatever KDE uses for power management.  Not sure where that lives, so filing against kdebase.

Comment 1 Tom Lane 2011-04-30 18:52:22 UTC
With further experimentation, I found out that sleep-on-close *does* work, if I'm logged in.  If I log out and then close the lid, it doesn't work.  So the problem is not "it doesn't work at all", but "the settings used when no one is logged in on the console are insane".

Comment 2 Kevin Kofler 2011-04-30 19:10:47 UTC
Is that even KDE's territory at all? If nobody is logged in, no service is talking to upower, so the "lid close" event goes nowhere. Both PowerDevil and gnome-power-manager run only inside a KDE Plasma resp. GNOME session.

Comment 3 Kevin Kofler 2011-04-30 19:12:29 UTC
Hmmm, well, actually GDM runs an instance of gnome-power-manager and several other session services, so when you're not logged in, you're actually running a GDM session. KDM doesn't run any such services, it's a very minimal session and doesn't run PowerDevil or anything like that.

Comment 4 Tom Lane 2011-04-30 20:43:37 UTC
Yes, this case works fine when using GNOME, and people migrating from GNOME are going to be surprised that it doesn't work.

Comment 5 Kevin Kofler 2011-04-30 20:48:47 UTC
Unfortunately, this is not trivial to fix at all. :-( It's not really a bug that this doesn't work, power management inside KDM is simply not implemented at all at this time.

One workaround is to use GDM instead. KDE Plasma supports shutdown/restart and user switching with GDM, so it isn't that bad a solution. You'd just lose the nice pretty KDM theming. ;-(

Comment 6 Kevin Kofler 2011-04-30 20:51:19 UTC
This is the upstream wishlist item: https://bugs.kde.org/show_bug.cgi?id=209129

Comment 7 Tom Lane 2011-04-30 21:20:19 UTC
OK, so how would I arrange to use GDM instead?  Wondering whether it's worth the trouble ...

Comment 8 Rex Dieter 2011-04-30 21:34:56 UTC
just install gdm, it is preferred by default, unless /etc/sysconfig/desktop DISPLAYMANAGER setting says differently.

Comment 9 Kevin Kofler 2011-04-30 21:49:58 UTC
Please note that installations from the KDE live images install an /etc/sysconfig/desktop file defaulting to KDM.

Comment 10 Tom Lane 2011-05-05 17:57:55 UTC
Just for the record, installing gdm is *not* sufficient to make this work --- the machine still won't go to sleep when logged out and closed.

Comment 11 Rex Dieter 2011-05-05 18:12:45 UTC
Well, installing and actually using gdm, and perhaps gnome-power-manager too.  Not sure exactly. Point is : gdm supports powermanagement, kdm does not.