Page 1 of 1

laptop will not suspend

PostPosted: Jun 10th, '18, 17:41
by daniewicz
Fully updated Mageia 6 with KDE. Suspend after closing the laptop lid was functional until an update over the last few months. Now closing the lid and reopening results in a system which can only be restarted with a cold boot.

Code: Select all
systemctl suspend
results in the correct behavior. System suspends and then comes back with a keystroke.

Any thoughts?

Re: laptop will not suspend

PostPosted: Jun 11th, '18, 10:37
by morgano
How does the menu choice for suspending work?

Re: laptop will not suspend

PostPosted: Jun 11th, '18, 15:38
by daniewicz
Menu choices for reboot and shutdown also do not work,

Re: laptop will not suspend

PostPosted: Jun 11th, '18, 19:33
by doktor5000
I also see that sometimes since kde5 was introduced, sometimes with a message that ksmserver crashed, sometimes like you described, the reboot/logout/shutdown buttons in start menu simply do nothing.

Pretty hard to debug, as you need to consider quite a few things
- are the relevant KDE services/modules loaded, like powerdevil (can be queried as regular user via qdbus org.kde.kded5 /kded loadedModules )
- if upower is running correctly
- is your dbus session working ( the above command should tell you )
- test if you can manually suspend via command
Code: Select all
qdbus org.kde.Solid.PowerManagement /org/freedesktop/PowerManagement Suspend

- if there are any other systemd inhibitors that might interfere ( systemd-inhibit --list )
- what does journal log say, if you run it as root via journalctl --follow and then wait until no new output appears, then trigger your action and see what is being added

Re: laptop will not suspend

PostPosted: Jun 11th, '18, 22:15
by daniewicz
Code: Select all
$ qdbus org.kde.kded5 /kded loadedModules
kded_accounts
remotenotifier
networkmanagement
kscreen
keyboard
baloosearchmodule
dnssdwatcher
appmenu
khotkeys
proxyscout
solidautoeject
colorcorrectlocationupdater
touchpad
kded_kmixd
statusnotifierwatcher
networkstatus
device_automounter
desktopnotifier


Code: Select all
# systemd-inhibit --list
     Who: PowerDevil (UID 1000/steved, PID 4751/org_kde_powerde)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch
     Why: KDE handles power events
    Mode: block

     Who: NetworkManager (UID 0/root, PID 915/NetworkManager)
    What: sleep
     Why: NetworkManager needs to turn off networks                                                                         
    Mode: delay

     Who: Screen Locker (UID 1000/steved, PID 4677/ksmserver)
    What: sleep
     Why: Ensuring that the screen gets locked before going to sleep
    Mode: delay

     Who: ModemManager (UID 0/root, PID 929/ModemManager)
    What: sleep
     Why: ModemManager needs to reset devices
    Mode: delay

4 inhibitors listed.


Code: Select all
# qdbus org.kde.Solid.PowerManagement /org/freedesktop/PowerManagement Suspend
Could not connect to D-Bus server: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.



And lastly, from journalctl --follow

Code: Select all
Jun 11 14:57:05 localhost.localdomain systemd-logind[927]: Lid closed.
Jun 11 14:57:05 localhost.localdomain org_kde_powerdevil[4751]: powerdevil: Suspend session triggered with QMap(("Explicit", QVariant(bool, true))("Type", QVariant(uint, 1)))
Jun 11 14:57:05 localhost.localdomain org_kde_powerdevil[4751]: powerdevil: Suspend session triggered with QMap(("Explicit", QVariant(bool, true))("SkipFade", QVariant(bool, true))("Type", QVariant(uint, 1)))
Jun 11 14:57:05 localhost.localdomain org_kde_powerdevil[4751]: powerdevil: Starting Login1 suspend job
Jun 11 14:57:05 localhost.localdomain NetworkManager[915]: <info>  [1528747025.6694] manager: sleep requested (sleeping: no  enabled: yes)
Jun 11 14:57:05 localhost.localdomain NetworkManager[915]: <info>  [1528747025.6694] manager: sleeping...
Jun 11 14:57:05 localhost.localdomain NetworkManager[915]: <info>  [1528747025.6695] device (enp0s10): state change: unavailable -> unmanaged (reason 'sleeping', internal state 'managed')
Jun 11 14:57:05 localhost.localdomain org_kde_powerdevil[4751]: powerdevil: Pausing all media players before suspending
Jun 11 14:57:05 localhost.localdomain NetworkManager[915]: <info>  [1528747025.6730] manager: NetworkManager state is now ASLEEP

Re: laptop will not suspend

PostPosted: Jun 12th, '18, 00:36
by doktor5000
daniewicz wrote:
Code: Select all
$ qdbus org.kde.kded5 /kded loadedModules

powerdevil seems missing there, but from what I read it may not be a kded module anymore, but standalone binary. Best query via
Code: Select all
ps auxwww|grep -v grep|grep -i power

which should also show upower.
And also check in systemsettings under https://userbase.kde.org/System_Setting ... ce_Manager whether power management / powerdevil is shown as running, maybe try stopping and starting it.


daniewicz wrote:
Code: Select all
# qdbus org.kde.Solid.PowerManagement /org/freedesktop/PowerManagement Suspend
Could not connect to D-Bus server: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.


Did you run that as root or regular user? # seems like run as root, where this would be normal. If that is the result as regular user, that's your problem.
Might be a dbus problem, or because powerdevil or whatever it is now is not running, see above.


daniewicz wrote:And lastly, from journalctl --follow
Code: Select all
Jun 11 14:57:05 localhost.localdomain systemd-logind[927]: Lid closed.
Jun 11 14:57:05 localhost.localdomain org_kde_powerdevil[4751]: powerdevil: Suspend session triggered with QMap(("Explicit", QVariant(bool, true))("Type", QVariant(uint, 1)))
Jun 11 14:57:05 localhost.localdomain org_kde_powerdevil[4751]: powerdevil: Suspend session triggered with QMap(("Explicit", QVariant(bool, true))("SkipFade", QVariant(bool, true))("Type", QVariant(uint, 1)))
Jun 11 14:57:05 localhost.localdomain org_kde_powerdevil[4751]: powerdevil: Starting Login1 suspend job
Jun 11 14:57:05 localhost.localdomain NetworkManager[915]: <info>  [1528747025.6694] manager: sleep requested (sleeping: no  enabled: yes)
Jun 11 14:57:05 localhost.localdomain NetworkManager[915]: <info>  [1528747025.6694] manager: sleeping...
Jun 11 14:57:05 localhost.localdomain NetworkManager[915]: <info>  [1528747025.6695] device (enp0s10): state change: unavailable -> unmanaged (reason 'sleeping', internal state 'managed')
Jun 11 14:57:05 localhost.localdomain org_kde_powerdevil[4751]: powerdevil: Pausing all media players before suspending
Jun 11 14:57:05 localhost.localdomain NetworkManager[915]: <info>  [1528747025.6730] manager: NetworkManager state is now ASLEEP


Hmm, powerdevil seems to be doing something ...

Re: laptop will not suspend

PostPosted: Jun 12th, '18, 20:35
by daniewicz
Code: Select all
$ ps auxwww|grep -v grep|grep -i power
root       900  0.0  0.2 293988  8560 ?        Ssl  13:08   0:00 /usr/libexec/upowerd
steved    4834  0.1  1.6 689100 63332 ?        Sl   13:09   0:00 /usr/libexec/org_kde_powerdevil



this was run as root in my previous post
Code: Select all
# qdbus org.kde.Solid.PowerManagement /org/freedesktop/PowerManagement Suspend


I did not see a power management and or powerdevil service under startup services within System Settings

Re: laptop will not suspend

PostPosted: Jun 12th, '18, 23:39
by doktor5000
daniewicz wrote:this was run as root in my previous post
Code: Select all
# qdbus org.kde.Solid.PowerManagement /org/freedesktop/PowerManagement Suspend


As mentioned, you need to run this as your regular user as it connects to your session dbus.

Re: laptop will not suspend

PostPosted: Jun 13th, '18, 16:14
by daniewicz
When this is run as a regular user the laptop suspends correctly and can be awaken with a keystroke.

Code: Select all
qdbus org.kde.Solid.PowerManagement /org/freedesktop/PowerManagement Suspend

Re: laptop will not suspend

PostPosted: Jun 13th, '18, 22:58
by doktor5000
Then feel free to use that command for a starter on the desktop and use that instead of the one inside the start menu, for the time being.

And you should report that as a bug in our bugzilla, mention that it does not work from start menu, but the mentioned command works, and ask for further instructions how to debug that.

Re: laptop will not suspend

PostPosted: Jun 18th, '18, 17:45
by daniewicz
After using the command line to initiate a suspend for a few days, it has become apparent that this approach will not work intermittently. Sometimes this will work properly, other times it will not.

Re: laptop will not suspend

PostPosted: Jun 18th, '18, 23:25
by doktor5000
And there's no output when it does not work when you run it manually in a terminal?

Re: laptop will not suspend

PostPosted: Jun 18th, '18, 23:29
by daniewicz
None.

Re: laptop will not suspend

PostPosted: Jun 19th, '18, 17:50
by doktor5000
Then you will need to monitor all dbus messages, via e.g. dbus-monitor

Re: laptop will not suspend

PostPosted: Aug 30th, '19, 19:03
by jeevanism
daniewicz wrote:Fully updated Mageia 6 with KDE. Suspend after closing the laptop lid was functional until an update over the last few months. Now closing the lid and reopening results in a system which can only be restarted with a cold boot.

Code: Select all
systemctl suspend
results in the correct behavior. System suspends and then comes back with a keystroke.

Any thoughts?


I have the same issue with Mageia 7.1
Code: Select all
[root@localhost jeevanism]# uname -a
Linux localhost.localdomain 5.2.7-desktop-1.mga7 #1 SMP Wed Aug 7 10:32:19 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

plasmashell 5.15.4