| View previous topic :: View next topic |
| Author |
Message |
paraw n00b

Joined: 07 Jan 2005 Posts: 66 Location: Dresden (DE)
|
Posted: Mon May 09, 2011 2:24 pm Post subject: Sleep modes only work "manually" |
|
|
As per thread title, I seem to have a singular problem. I'm running KDE 4.4.5 on a Core i7 laptop. Sleep mode and hibernation work perfectly if I enter the modes manually, but not if I choose Leave/Sleep or Leave/Hibernate from the K menu.
In other words, I can open a root terminal and issue | Code: | | echo -n mem > /sys/power/state | or | Code: | | echo -n disk > /sys/power/state | and the machine will suspend to RAM or to disk, respectively, without any problems. Similarly, from a user terminal, I can issue | Code: | | dbus-send --system --dest=org.freedesktop.Hal --type=method_call --print-reply /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:0 | or | Code: | | dbus-send --system --dest=org.freedesktop.Hal --type=method_call --print-reply /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Hibernate | to the same effects as above. In fact, I bound those commands to two key shortcuts to enter sleep mode or hibernation, and they work without a glitch.
Yet, clicking on the sleep and hibernate options in the K menu has absolutely no effect. The same happens (or rather, fails to happen) if I click on the sleep and hibernate buttons in the battery monitor widget. This seems to be more than just a nuisance or a curiosity, as the system fails to hibernate if the battery level falls below a set threshold, presumably because KDE would try to enter the sleep modes in the same way as when I click on the above mentioned buttons.
Is there an explanation and/or a fix for this? |
|
| Back to top |
|
 |
depontius Veteran

Joined: 05 May 2004 Posts: 1925
|
Posted: Mon May 09, 2011 3:37 pm Post subject: |
|
|
I see that you're sending messages to HAL, but HAL has been recently deprecated. There have been several threads here about getting rid of HAL - I would suggest that you might start there. I suspect that you've still got HAL installed, but your KDE is set up to be post-HAL. So your KDE buttons try to do suspend/hibernate the post-HAL way, but the rest of the system is set up to do that the HAL way. _________________ .sigs waste space and bandwidth |
|
| Back to top |
|
 |
paraw n00b

Joined: 07 Jan 2005 Posts: 66 Location: Dresden (DE)
|
Posted: Mon May 09, 2011 4:03 pm Post subject: |
|
|
| Uhm... actually, I haven't yet updated to KDE 4.6, which, AFAIK, is the version that finally does not rely at all on HAL. Therefore, I do still have HAL installed. So, shouldn't it work anyway? |
|
| Back to top |
|
 |
paraw n00b

Joined: 07 Jan 2005 Posts: 66 Location: Dresden (DE)
|
Posted: Sun May 15, 2011 3:50 pm Post subject: |
|
|
So, here I am.
Now, I have KDE 4.6, without HAL, and everything seems to work fine (so far).
The only exception is still the sleep modes don't work, exactly as per the first post. Of course, now the HAL-based commands don't work either, as they were based on HAL, so the only way to put the laptop to sleep is by writing "mem" or "disk" in /sys/power/state.
Incidentally, something of the sort of | Code: | | qdbus org.freedesktop.PowerManagement /org/kde/Solid/PowerManagement suspendToRam | does not work either.
Any idea how to fix this? |
|
| Back to top |
|
 |
paraw n00b

Joined: 07 Jan 2005 Posts: 66 Location: Dresden (DE)
|
Posted: Sun May 15, 2011 4:03 pm Post subject: |
|
|
One more update. The commands | Code: | | dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend | and | Code: | | dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Hibernate | work properly in suspending and hibernating, respectively.
I guess at this point the question becomes how to map the sleep and hibernate buttons (and battery events!) to these two commands. |
|
| Back to top |
|
 |
depontius Veteran

Joined: 05 May 2004 Posts: 1925
|
Posted: Mon May 16, 2011 2:28 pm Post subject: |
|
|
Might this be something to do with ConsoleKit or PolicyKit?? I generally don't hibernate or suspend, and the one system I do regularly suspend is a dedicated mythfrontend, and it does so by lircd invoking a sudo script against hibernate-script. _________________ .sigs waste space and bandwidth |
|
| Back to top |
|
 |
paraw n00b

Joined: 07 Jan 2005 Posts: 66 Location: Dresden (DE)
|
Posted: Mon May 16, 2011 2:39 pm Post subject: |
|
|
Uhm... I guess it could be...
The consolekit daemon seems to be running fine, though... How would I go about and check that? |
|
| Back to top |
|
 |
lostpaperclips n00b

Joined: 19 Jun 2011 Posts: 1 Location: United States
|
Posted: Sun Jun 19, 2011 2:26 am Post subject: I was missing some policy information to solve this... |
|
|
Recently I upgraded from KDE 4.4 to 4.6 and lost the ability to sleep/hibernate. In my case, I needed to add/amend the org.freedesktop.upower.policy file in /usr/share/polkit-1/actions/.
| Code: | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
<policyconfig>
<vendor>The UPower Project</vendor>
<vendor_url>http://upower.freedesktop.org/</vendor_url>
<icon_name>system-suspend</icon_name>
<action id="org.freedesktop.upower.suspend">
<description>Suspend the system</description>
<message>Authentication is required to suspend the system</message>
<defaults>
<allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="org.freedesktop.upower.hibernate">
<description>Hibernate the system</description>
<message>Authentication is required to hibernate the system</message>
<defaults>
<allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
</policyconfig> |
|
|
| Back to top |
|
 |
|