You are not logged in.

#1 2013-02-05 13:18:59

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

[SOLVED] Systemd does not suspend laptop using the lid switch

Hi,

To my understanding, systemd should suspend the laptop itself when I tell powerdevil (KDE 4.9.5) to ignore the lid switch. This is my logind.conf:

[ericd@vaiopro13 ~]$ cat /etc/systemd/logind.conf 
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# See logind.conf(5) for details

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#Controllers=
#ResetControllers=cpu
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#IdleAction=ignore
#IdleActionSec=30min

However, this is not the case. When I close the lid of the laptop, nothing happens except the screen switches off.
I'd like to hand over the suspend stuff to systemd, because I think suspending will go much faster and I hope I will get rid of the "double suspend" issue.

The systemd journal tells me:

feb 05 14:00:45 vaiopro13 systemd-logind[407]: Lid closed.
feb 05 14:00:56 vaiopro13 systemd-logind[407]: Lid opened.

What am I missing here?

EDIT: running

systemctl suspend

works fine, although on resume the screen is not locked, but I guess that is expected behaviour.

Last edited by LordChaos73 (2013-02-15 09:25:34)

Offline

#2 2013-02-05 13:27:17

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] Systemd does not suspend laptop using the lid switch

... everything in logind.conf is commented out.

Offline

#3 2013-02-05 13:30:57

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

Re: [SOLVED] Systemd does not suspend laptop using the lid switch

tomk wrote:

... everything in logind.conf is commented out.

Are those not just the default values?

Offline

#4 2013-02-05 16:15:58

doug piston
Member
From: Seattle
Registered: 2011-09-11
Posts: 387
Website

Re: [SOLVED] Systemd does not suspend laptop using the lid switch

Un-comment the one you'd like.

#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
HandleLidSwitch=suspend
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#IdleAction=ignore
#IdleActionSec=30min

Also read https://wiki.archlinux.org/index.php/Sy … management

Last edited by doug piston (2013-02-05 16:19:24)

Offline

#5 2013-02-06 20:44:19

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

Re: [SOLVED] Systemd does not suspend laptop using the lid switch

Uncommenting the following options:

HandleLidSwitch=suspend
LidSwitchIgnoreInhibited=yes

and restarting the logind service makes no difference at all.

[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   6460
sleep                 root                 inhibited            delay      0    389

2 inhibitors listed.

Maybe systemd isn't ignoring all inhibitors when the lid is closed although it is supposed to?

Offline

#6 2013-02-07 03:07:25

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: [SOLVED] Systemd does not suspend laptop using the lid switch

You're trying this with a fresh boot?

Offline

#7 2013-02-07 08:52:15

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

Re: [SOLVED] Systemd does not suspend laptop using the lid switch

ANOKNUSA wrote:

You're trying this with a fresh boot?

Yes, I've tried this after rebooting as well.

Offline

#8 2013-02-07 18:52:32

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

Re: [SOLVED] Systemd does not suspend laptop using the lid switch

i think i've read that in kde 4.10 powerdevil has much better support to systemd.. maybe just wait few hours and see if the kde upgrade will do well.
cheers

Offline

#9 2013-02-07 19:33:47

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

Re: [SOLVED] Systemd does not suspend laptop using the lid switch

josephk wrote:

i think i've read that in kde 4.10 powerdevil has much better support to systemd.. maybe just wait few hours and see if the kde upgrade will do well.
cheers

Do you think it will be in the stable repo's so soon?

Off topic, this seems like an annoying bug of which I hope they will fix soon:

https://bugs.kde.org/show_bug.cgi?id=314559

Last edited by LordChaos73 (2013-02-07 19:34:05)

Offline

#10 2013-02-11 11:51:41

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

Re: [SOLVED] Systemd does not suspend laptop using the lid switch

I've upgraded KDE, problem still persists. Also, I now get the double suspend even when the laptop is connected to AC. This wasn't the case when I was running KDE 4.9.x.

Offline

#11 2013-02-14 21:07:49

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

Re: [SOLVED] Systemd does not suspend laptop using the lid switch

Looks like the double suspend bug is fixed

Offline

#12 2013-02-14 21:46:56

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: [SOLVED] Systemd does not suspend laptop using the lid switch

LordChaos73 wrote:

Maybe systemd isn't ignoring all inhibitors when the lid is closed although it is supposed to?

If I understand it correctly, this will only ignore real inhibitors. The handle-... inhibitors are always working and stop systemd from responding. You'll have to use the app which requested the lock, in your case powerdevil.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#13 2013-02-14 22:15:39

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

Re: [SOLVED] Systemd does not suspend laptop using the lid switch

progandy wrote:
LordChaos73 wrote:

Maybe systemd isn't ignoring all inhibitors when the lid is closed although it is supposed to?

If I understand it correctly, this will only ignore real inhibitors. The handle-... inhibitors are always working and stop systemd from responding. You'll have to use the app which requested the lock, in your case powerdevil.

Thank you for clarifying!

Offline

#14 2015-11-10 22:35:34

Bladtman242
Member
Registered: 2012-02-14
Posts: 127

Re: [SOLVED] Systemd does not suspend laptop using the lid switch

How was this problem actually solved?

Offline

#15 2019-04-10 09:06:01

umbreon_qa
Member
Registered: 2019-04-10
Posts: 1

Re: [SOLVED] Systemd does not suspend laptop using the lid switch

It's part of the Power Management settings.

Go to the setting 'Energy Saving'. There's a bullet point 'Button events handling' where you'll find 'When laptop lid closed'. The options include [Hibernate, Suspend, Do nothing] etc. Set it to Do nothing and apply.

See also: KDE Power Management https://docs.kde.org/stable5/en/kde-wor … index.html

Offline

#16 2019-04-10 09:10:15

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,656

Re: [SOLVED] Systemd does not suspend laptop using the lid switch

Please look at the dates, the problem was originally solved already and it's quite likely that the OP has already noticed this. Don't necrobump 6 year old threads.

Closing.

Offline

Board footer

Powered by FluxBB