You are not logged in.

#1 2012-12-20 23:24:16

csslayer
Member
Registered: 2009-03-05
Posts: 85

KDE, Systemd, NM and double suspsend

So, first, don't get me wrong, it's not the same problem that happened when KDE doesn't support systemd inhibit.

Since NM 0.9.6.4, nm begin to add a new inhibit, seems to be used to track suspend status. But this seems cause double suspend for me again.
When I close the lid and suspend with KDE, and when I want to resume, I have to resume it for second time since it just suspends immediately again.

This is what I get.

$ systemd-inhibit --list
WHAT                  WHO                  WHY                  MODE     UID    PID
handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch PowerDevil           KDE handles p...ents block   1000   1068
sleep                 root                 inhibited            delay      0    359

Second one comes from NM.

And if I downgrade NM to 0.9.6.0, problem will be solved, so I'm partly sure it's is related to this NM "new feature".

I even drop a report on systemd but so far no reply: https://bugs.freedesktop.org/show_bug.cgi?id=58220

Does anyone also have this problem know how to resolve it? Thanks! Not a big deal, just annoying...

Offline

#2 2013-01-19 22:14:12

LordChaos73
Member
From: .nl
Registered: 2008-11-11
Posts: 183

Re: KDE, Systemd, NM and double suspsend

csslayer wrote:

Does anyone also have this problem know how to resolve it? Thanks! Not a big deal, just annoying...

Yes, I have the same issue, I'm using KDE as well. Unfortunately I don't know how to solve it.

[ericd@vaiopro13 ~]$ systemd-inhibit --list
WHAT                  WHO                  WHY                  MODE     UID    PID
handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch PowerDevil           KDE handles p...ents block   1000    512
sleep                 root                 inhibited            delay      0    310
root       310  0.0  0.1 247480  9060 ?        Ssl  19:14   0:02 /usr/sbin/NetworkManager --no-daemon

Offline

#3 2013-01-19 22:25:18

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: KDE, Systemd, NM and double suspsend

By default, systemd ignores inhibits for the lid. Did you edit /etc/systemd/logind.conf to change the default?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#4 2013-01-19 22:55:20

LordChaos73
Member
From: .nl
Registered: 2008-11-11
Posts: 183

Re: KDE, Systemd, NM and double suspsend

cfr wrote:

By default, systemd ignores inhibits for the lid. Did you edit /etc/systemd/logind.conf to change the default?

Yes, I tried serveral scenarios but this seems to be caused by a bug in KDE. Have a look here

Offline

#5 2013-01-20 03:41:47

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: KDE, Systemd, NM and double suspsend

Yes. It is interesting. I found that two.

What is confusing me a bit is that I get the machine suspending just the once. I have systemd set to respect the inhibit for the lid as well as the other things, and it all seems to work. (I'm sure it will stop now I've said that!)  As far as I know I am just using the KDE stuff to manage sleep on lid close and wake on lid open. So I'm confused about what is different in my set up than what appears to be the "standard" one.

To be clear: As I read that bug, the bug does not require NetworkManager - it is purely a matter of KDE/systemd/upower. I could quite understand why it works for me and not the people posting in this particular thread if NM is involved because I don't use NM.

Last edited by cfr (2013-01-20 03:43:57)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#6 2013-01-20 21:09:06

LordChaos73
Member
From: .nl
Registered: 2008-11-11
Posts: 183

Re: KDE, Systemd, NM and double suspsend

The really confusing thing is, it doesn't seem to happen every time the laptop resumes. I'm confused.

EDIT: apparently when the laptop is connected to AC and suspends, everything goes fine. When it's not however, I get the double suspend.

Last edited by LordChaos73 (2013-01-20 21:13:40)

Offline

#7 2013-01-21 19:53:04

csslayer
Member
Registered: 2009-03-05
Posts: 85

Re: KDE, Systemd, NM and double suspsend

I already apply the powerdevil patch from reviewboard, and I think there is nothing more can be done from KDE side.
currently I only experience this if I suspend by lid close

My wild guess, I think there is a race in systemd, when kde tell login1 to suspend on lid close, I notice the computer is being brought to tty very quickly and then suspend, in that case, systemd apply totally different policy strategy since we are no longer in X, and think lid close is still happen or delayed so another suspend happens.

Offline

#8 2013-01-21 19:58:22

csslayer
Member
Registered: 2009-03-05
Posts: 85

Re: KDE, Systemd, NM and double suspsend

And I feel my report https://bugs.freedesktop.org/show_bug.cgi?id=58220 is partly being ignored.

So, if anyone here suffering from this problem, please test
https://git.reviewboard.kde.org/r/108407/ this patch.

And test case:
1. suspend via battery plasmoid or kickoff, after patch -> no problem
2. suspend vid close lid -> suspend twice.

Offline

#9 2013-01-23 09:44:57

LordChaos73
Member
From: .nl
Registered: 2008-11-11
Posts: 183

Re: KDE, Systemd, NM and double suspsend

csslayer wrote:

And I feel my report https://bugs.freedesktop.org/show_bug.cgi?id=58220 is partly being ignored.

So, if anyone here suffering from this problem, please test
https://git.reviewboard.kde.org/r/108407/ this patch.

And test case:
1. suspend via battery plasmoid or kickoff, after patch -> no problem
2. suspend vid close lid -> suspend twice.

Do you also get the double suspend when closing the lid and the laptop is on AC?

Offline

#10 2013-01-23 18:59:57

csslayer
Member
Registered: 2009-03-05
Posts: 85

Re: KDE, Systemd, NM and double suspsend

LordChaos73 wrote:

Do you also get the double suspend when closing the lid and the laptop is on AC?

Yes, my problem have nothing to do with AC.

Offline

#11 2013-01-25 09:30:07

LordChaos73
Member
From: .nl
Registered: 2008-11-11
Posts: 183

Re: KDE, Systemd, NM and double suspsend

csslayer wrote:
LordChaos73 wrote:

Do you also get the double suspend when closing the lid and the laptop is on AC?

Yes, my problem have nothing to do with AC.

I only get the double suspend when manually closing the lid, not for instance when the laptop suspends itself after a few minutes. And when the laptop is connected to AC and I close the lid, the double suspend doesn't seem to occur.

Last edited by LordChaos73 (2013-01-25 09:30:20)

Offline

#12 2013-02-02 19:51:03

LordChaos73
Member
From: .nl
Registered: 2008-11-11
Posts: 183

Re: KDE, Systemd, NM and double suspsend

This is also interesting, when I disable the "Button event handling" altogether in powerdevil actually nothing happens when I close the lid. Systemd does not suspend the laptop and I was actually under the impression that it should.
I am currently using KDE 4.9.5 and the default systemd settings in /etc/systemd/logind.conf.

Offline

#13 2013-02-21 12:13:00

josephk
Member
Registered: 2011-01-09
Posts: 97
Website

Re: KDE, Systemd, NM and double suspsend

here, when I suspend closing the lid, opening the lid causes double suspend, whether I'm on AC or on battery.
every other scenario work as expected. have default settings, tried to tweak them in logind.conf or adding acpi vbetool but nothing changes.

Offline

#14 2013-02-21 12:15:52

LordChaos73
Member
From: .nl
Registered: 2008-11-11
Posts: 183

Re: KDE, Systemd, NM and double suspsend

Apparently, this will be fixed when KDE 4.10.1 lands.

Offline

#15 2013-02-21 12:26:49

josephk
Member
Registered: 2011-01-09
Posts: 97
Website

Re: KDE, Systemd, NM and double suspsend

HandleLidSwitch=ignore in logind.conf solved the problem
this is a kde bug since it should support logind

Offline

#16 2013-02-22 20:56:41

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: KDE, Systemd, NM and double suspsend

I configure suspend on lid close in KDE settings and haven't needed to set HandleLidSwitch=ignore. However, I have set

LidSwitchIgnoreInhibited=no

This tells systemd not to ignore the inhibitor which KDE sets i.e. it respects that inhibitor and does not also try to handle the lid switching when KDE is running. (But if I am using CLI only, it will handle it so the laptop still suspends.)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB