Jump to content
Read the Funtoo Newsletter: Summer 2023 ×
  • 0

kde-plasma - cannot suspend using upower2


pechy

Question

Hi,

I have strange issue with kde-plasma that I cannot suspend using standard KDE way (buttons in app launcher). Main problem for me is that it does not suspend after closing laptop lid...

Using pm-suspend it works, but I need standard KDE way in order to suspend after closing the lid.

I'm not sure if current problem is permission related or not.

 

If I try dbus-send to debug suspend, I get:

dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend
method return sender=:1.7 -> dest=:1.39 reply_serial=2

but it don't suspend computer. It only disconnects and reconnects network, it looks like it tries to suspend and wakes up again immediatelly.

I looked into .xsession-errors, but I don't see anything really suspicious (maybe except powerdevil: systemd powersave events handling inhibited, descriptor: 32, this is strange, I don't use systemd):

powerdevil: Suspend session triggered with QMap(("Explicit", QVariant(bool, true) ) ( "Type" ,  QVariant(uint, 1) ) )
powerdevil: Suspend session triggered with QMap(("Explicit", QVariant(bool, true) ) ( "SkipFade" ,  QVariant(bool, true) ) ( "Type" ,  QVariant(uint, 1) ) )
powerdevil: Starting UPower suspend job
lock called
kscreen.kded: System is going to suspend, won't be changing config (waited for  1001 ms)
Lock window Id:  31457307
CreateNotify: 31457307
CreateNotify: 58720258
CreateNotify: 58720260
CreateNotify: 58720264
CreateNotify: 58720266
Skipped method "moduleDeleted" : Pointers are not supported: KDEDModule*
kcm_keyboard: Fetched layout groups from X server:      layouts: ("cz", "us")   variants: ("", "")
kcm_keyboard: Fetched layout groups from X server:      layouts: ("cz", "us")   variants: ("", "")
CreateNotify: 58720267
MapNotify: 58720267
MapNotify: 31457307
CreateNotify: 58720271
Time engine Clock skew signaled
powerdevil: fd passing available: true
powerdevil: systemd powersave events handling inhibited, descriptor: 32
kscreen.kded: Resumed from suspend, checking for screen changes 
kscreen: Primary output changed from KScreen::Output(Id: 67 , Name: "eDP1" ) ( "eDP1" ) to KScreen::Output(Id: 67 , Name: "eDP1" ) ( "eDP1" )
Currrent active notifications: QHash()
Guessing partOf as: 0
 New Notification:  "DHCP" "Connection 'DHCP' deactivated." -1 & Part of: 0
CreateNotify: 40035819
MapNotify: 40035819
UnmapNotify: 41943088
Unknown toplevel for MapNotify
UnmapNotify: 40035819
Currrent active notifications: QHash()
Guessing partOf as: 0
 New Notification:  "DHCP" "Connection 'DHCP' activated." -1 & Part of: 0
CreateNotify: 40036339
MapNotify: 40036339
UnmapNotify: 58720267
UnmapNotify: 58720267
CreateNotify: 58720273
QXcbConnection: XCB error: 3 (BadWindow), sequence: 53270, resource id: 58720273, major code: 18 (ChangeProperty), minor code: 0
Grab Released

I'm even not sure, if that isn't permission issue, because in output of ck-session-list I have active=FALSE, but I cannot figure how to change it to TRUE. I use sddm-0.11.0 (I removed nox11 from /etc/pam.d/system-login to be registered by consolekit). sddm is started with xdm (DISPLAYMANAGER="sddm" in /etc/conf.d/xdm).

Session1:
        unix-user = '1000'
        realname = '(null)'
        seat = 'Seat1'
        session-type = ''
        active = FALSE
        x11-display = ':0'
        x11-display-device = '/dev/tty7'
        display-device = ''
        remote-host-name = ''
        is-local = FALSE
        on-since = '2015-09-29T13:36:12.785523Z'
        login-session-id = '1'

In order to be override polkit, I created polkit rule:

# cat /etc/polkit-1/rules.d/51-upower.rules     
polkit.addRule(function(action, subject) {
 var YES = polkit.Result.YES;
 var permission = {
   "org.freedesktop.UPower.Suspend": YES,
   "org.freedesktop.UPower.SuspendAllowed": YES,
   "org.freedesktop.UPower.AboutToSleep": YES,
   "org.freedesktop.UPower.Hibernate": YES,
   "org.freedesktop.UPower.HibernateAllowed": YES,
 };
 return permission[action.id];
});
Something works with that, I couldn't even use dbus-send... to debug suspend (I got Error org.freedesktop.UPower.GeneralError: not authorized), but suspend still don't work.

 

Thanks for any help.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi,

finally solved today, it was completely my fault.

 

Some time ago I created hook for pm-utils, but it returned error when not running directly by pm-suspend, but through the upower. Error in hook caused pm-utils to inhibit suspend.

 

So sorry for bothering with this. At least, there is no problems in packages, I hope that's a good news.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...