Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Desktop Environments
  • Search

[SOLVED] no suspend or hibernate menu in kmenu

Problems with GUI applications? Questions about X, KDE, Gnome, Fluxbox, etc.? Come on in. NOTE: For multimedia, go up one forum
Post Reply
Advanced search
12 posts • Page 1 of 1
Author
Message
devsk
Advocate
Advocate
User avatar
Posts: 3039
Joined: Fri Oct 24, 2003 1:16 am
Location: Bay Area, CA

[SOLVED] no suspend or hibernate menu in kmenu

  • Quote

Post by devsk » Sat Dec 07, 2013 8:34 pm

Since the time we got rid of consolekit and replaced stuff with upower/polkit/systemd, I have not been able to suspend my laptop when I close the lid through KDE. The reason is that somewhere suspend is disabled by upower and powerdevil code is not giving me the option to use suspend (or hibernate) when the lid is closed. I can use pm-utils to do either of these.

I have done a lot of things since this morning and gave up. And hence asking here. Here is what I tried:

1. Modify polkit rules

Code: Select all

# cat /etc/polkit-1/rules.d/01-default.rules 
polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.upower.suspend" ||
        action.id == "org.freedesktop.upower.hibernate") {
        return polkit.Result.YES;
    }
});
2. add localauthority files:

Code: Select all

# cat /etc/polkit-1/localauthority/50-local.d/org.freedesktop.upower.pkla 
[Local Users]
Identity=unix-group:wheel
Action=org.freedesktop.upower.*
ResultAny=yes
ResultInactive=no
ResultActive=yes
All users are part of the wheel group.

It doesn't make a difference if I replace "org.freedesktop.upower.suspend" with "org.freedesktop.login1.Manager".

Also, I get the following error, the code in powerdevil is poking the same values from dbus system bus, and hence concluding that suspend is not supported:

Code: Select all

# qdbus --system org.freedesktop.UPower /org/freedesktop/UPower SuspendAllowed
QIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv_open failed
QIconvCodec::convertToUnicode: using Latin-1 for conversion, iconv_open failed
Error: org.freedesktop.DBus.Error.AccessDenied
Rejected send message, 3 matched rules; type="method_call", sender=":1.47" (uid=0 pid=28705 comm="qdbus --system org.freedesktop.UPower /org/freedes") interface="(unset)" member="SuspendAllowed" error name="(unset)" requested_reply="0" destination="org.freedesktop.UPower" (uid=0 pid=27197 comm="/usr/lib/upower/upowerd ")
The strange thing is that I am calling this as root and it still shows error.AccessDenied. All methods show this error.

What the heck do I need to do to allow access to these methods in dbus?

<rant>
whoever did this disabling of suspend by default in dbus, did a great injustice to the public at large.
</rant>
Last edited by devsk on Mon Dec 09, 2013 4:05 am, edited 1 time in total.
Top
devsk
Advocate
Advocate
User avatar
Posts: 3039
Joined: Fri Oct 24, 2003 1:16 am
Location: Bay Area, CA

  • Quote

Post by devsk » Sat Dec 07, 2013 11:20 pm

Is it not possible to get the suspend/hibernate working with KDE without using systemd as the init system instead of openrc? Right now, systemd is in USE and consolekit is not. Basically, everything is built with systemd but I am still running the system with openrc. Is anybody else using their gentoo like this?
Top
devsk
Advocate
Advocate
User avatar
Posts: 3039
Joined: Fri Oct 24, 2003 1:16 am
Location: Bay Area, CA

  • Quote

Post by devsk » Sat Dec 07, 2013 11:33 pm

Created a group called 'power' and added both root and the user to it. Still the same.
Top
devsk
Advocate
Advocate
User avatar
Posts: 3039
Joined: Fri Oct 24, 2003 1:16 am
Location: Bay Area, CA

  • Quote

Post by devsk » Sun Dec 08, 2013 2:32 am

Somebody here knows about the evil designs of systemd, dbus, consolekit (completely removed from my system), upower, udisks, udev, polkit and the ilk....:D And their interplay with suspend to RAM and disk.

Speak up my friend. A longtime Gentoo user is dying alone here.
Top
franzf
Advocate
Advocate
User avatar
Posts: 4565
Joined: Tue Mar 29, 2005 9:06 am

  • Quote

Post by franzf » Sun Dec 08, 2013 9:11 am

3 bumps within 6 hours...Come one...

Concerning your problem: With USE="systemd -consolekit" and running openrc you miss one critical component for all that fancy features: session/user tracking. Either you have to enable USE="consolekit" or you must boot with systemd.
(BTW.: you also should not be able to mount your external drives through the device manager)
Top
devsk
Advocate
Advocate
User avatar
Posts: 3039
Joined: Fri Oct 24, 2003 1:16 am
Location: Bay Area, CA

  • Quote

Post by devsk » Sun Dec 08, 2013 5:10 pm

I thought we needed USE=systemd to get newer udev, and systemd and consolekit were exclusive. I did not think USE="systemd consolekit" was possible at the time when I was updating some time ago. Does that work?
Top
devsk
Advocate
Advocate
User avatar
Posts: 3039
Joined: Fri Oct 24, 2003 1:16 am
Location: Bay Area, CA

  • Quote

Post by devsk » Sun Dec 08, 2013 5:14 pm

franzf wrote:3 bumps within 6 hours...Come one...
well, I was frustrated with this mess, so may be I went overboard. Sorry about that. Never been frustrated with gentoo before this. Ever.
Top
devsk
Advocate
Advocate
User avatar
Posts: 3039
Joined: Fri Oct 24, 2003 1:16 am
Location: Bay Area, CA

  • Quote

Post by devsk » Sun Dec 08, 2013 5:35 pm

franzf wrote:Either you have to enable USE="consolekit" or you must boot with systemd.
Surprisingly, the system built with USE="systemd consolekit". I succinctly remember that it did not work earlier. Anyway, it built but still the same result.
franzf wrote:(BTW.: you also should not be able to mount your external drives through the device manager)
Yeah, but I did not care about that much. I did care about laptop going to S3 sleep on lid close and shutting down on 3% battery etc.
Top
franzf
Advocate
Advocate
User avatar
Posts: 4565
Joined: Tue Mar 29, 2005 9:06 am

  • Quote

Post by franzf » Sun Dec 08, 2013 6:14 pm

Did you start consolekit?

Code: Select all

/etc/init.d/consolekit start
Might also require a restart of kdm/lightdm/...
Top
devsk
Advocate
Advocate
User avatar
Posts: 3039
Joined: Fri Oct 24, 2003 1:16 am
Location: Bay Area, CA

  • Quote

Post by devsk » Sun Dec 08, 2013 7:35 pm

I actually rebooted after putting consolekit at default runlevel. Still no suspend/hibernate in powerdevil. The reason is that the powerdevil code is looking for either the presence of systemd version >= 195 and querying org.freedesktop.login1.Manager.CanSuspend from dbus or the presence of UPower API org.freedesktop.UPower.SuspendAllowed from system bus.

Now, the UPower API is deprecated:

Code: Select all

# qdbus --system org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.SuspendAllowed
Error: org.freedesktop.UPower.GeneralError
Method is deprecated, please port to org.freedesktop.login1.Manager.CanSuspend
and of course, org.freedesktop.login1.Manager.CanSuspend won't work in the absence of systemd and its logind daemon, which come into existence only when I use systemd as init. The API is giving me AccessDenied but I think its most likely not finding anything registering org.freedesktop.login1 from UPower. I would have thought that if UPower deprecated an API, it would implement the new API.

Code: Select all

# qdbus --system org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.login1.Manager.CanSuspend
Error: org.freedesktop.DBus.Error.AccessDenied
Rejected send message, 1 matched rules; type="method_call", sender=":1.40" (uid=0 pid=9732 comm="qdbus --system org.freedesktop.UPower /org/freedes") interface="org.freedesktop.login1.Manager" member="CanSuspend" error name="(unset)" requested_reply="0" destination="org.freedesktop.UPower" (uid=0 pid=9016 comm="/usr/lib/upower/upowerd ")
If I try to query from org.freedesktop.login1, I get:

Code: Select all

# qdbus --system org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.CanSuspend
Error: org.freedesktop.DBus.Error.Spawn.ChildExited
Launch helper exited with unknown return code 1
not sure what that means. It does not give me a path which its failing to spawn. You got some ideas what it might be spawning?
Top
devsk
Advocate
Advocate
User avatar
Posts: 3039
Joined: Fri Oct 24, 2003 1:16 am
Location: Bay Area, CA

  • Quote

Post by devsk » Sun Dec 08, 2013 10:51 pm

Finally, found the solution to my issues at https://bugzilla.redhat.com/show_bug.cgi?id=1005234

Wow! So many days wasted on this! All I needed to do was to build upower with -systemd (which passes --enable-deprecated to configure), add the polkit rules I added in post 1, made sure the perms on dir /etc/polkit-1 and /etc/polkit-1/rules.d were correct and it worked.
Top
devsk
Advocate
Advocate
User avatar
Posts: 3039
Joined: Fri Oct 24, 2003 1:16 am
Location: Bay Area, CA

  • Quote

Post by devsk » Mon Dec 09, 2013 4:03 am

While I was at it, I fixed the ability to mount and eject devices from the KDE's "Devices" icon in systray as well using a simple udisks2 policy kit rule file:

Code: Select all

# cat /etc/polkit-1/rules.d/00-udisks.rules 
polkit.addRule(function(action, subject) {
    if ((action.id == "org.freedesktop.udisks2.filesystem-mount" ||
        (action.id == "org.freedesktop.udisks2.eject-media")) &&
        subject.isInGroup("disk")) {
        return polkit.Result.YES;
    }
});
Top
Post Reply

12 posts • Page 1 of 1

Return to “Desktop Environments”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic