You are not logged in.

#1 2014-07-22 06:55:44

bendavis78
Member
Registered: 2014-06-21
Posts: 41

Laptop won't suspend when lid closed

When I run "systemctl suspend", my computer suspends just fine. However it does not suspend when the lid is closed.

Contents of /etc/systemd/logind.conf

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

systemd-logind seems to work as expected

 $ journalctl -b -u systemd-logind
-- Logs begin at Sat 2014-06-21 01:33:35 CDT, end at Tue 2014-07-22 01:50:27 CDT. --
Jul 21 17:49:21 ben-laptop systemd-logind[346]: New seat seat0.
Jul 21 17:49:21 ben-laptop systemd-logind[346]: Watching system buttons on /dev/input/event7 (Power Button)
Jul 21 17:49:21 ben-laptop systemd-logind[346]: Watching system buttons on /dev/input/event13 (Video Bus)
Jul 21 17:49:21 ben-laptop systemd-logind[346]: Watching system buttons on /dev/input/event12 (Video Bus)
Jul 21 17:49:21 ben-laptop systemd-logind[346]: Watching system buttons on /dev/input/event5 (Power Button)
Jul 21 17:49:21 ben-laptop systemd-logind[346]: Watching system buttons on /dev/input/event4 (Lid Switch)
Jul 21 17:49:21 ben-laptop systemd-logind[346]: Watching system buttons on /dev/input/event6 (Sleep Button)
Jul 21 17:49:34 ben-laptop systemd-logind[346]: New session c1 of user ben.
Jul 21 18:00:34 ben-laptop systemd-logind[346]: Removed session c1.
Jul 21 18:00:35 ben-laptop systemd-logind[346]: New session c2 of user gdm.
Jul 21 18:00:47 ben-laptop systemd-logind[346]: New session c3 of user ben.
Jul 21 18:00:47 ben-laptop systemd-logind[346]: Removed session c2.
Jul 22 00:33:02 ben-laptop systemd-logind[346]: Lid closed.
Jul 22 00:35:40 ben-laptop systemd-logind[346]: Lid opened.
Jul 22 01:49:52 ben-laptop systemd-logind[346]: Lid closed.
Jul 22 01:50:02 ben-laptop systemd-logind[346]: Lid opened.

But it does not suspend when the lid is closed.

Offline

#2 2014-08-14 19:23:20

gray85
Member
Registered: 2010-11-27
Posts: 14

Re: Laptop won't suspend when lid closed

Please, take a look at my comment and power management article on wiki.

Offline

#3 2014-08-14 20:43:45

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Laptop won't suspend when lid closed

@gray85 that first reference would be XFCE specific though.

@bendavis78 This may be of interest to you.

Offline

#4 2014-08-14 20:49:56

abrouwers
Member
Registered: 2006-05-15
Posts: 6

Re: Laptop won't suspend when lid closed

There is also a timer in systemd, that inhibits the events within 3 minutes of booting, and 30 seconds of resuming from a previous suspend.  So, be sure you aren't in those areas (or, if you are, wait for the timer to be up and it should perform the action then).

Offline

#5 2014-08-14 21:50:23

bendavis78
Member
Registered: 2014-06-21
Posts: 41

Re: Laptop won't suspend when lid closed

@gray85: Thanks, I'm using gnome-shell though, and it doesn't seem to have any settings for the lid. I've read through the power management wiki. I can't seem to find a solution.

@emer: I might try acpid, but I'd rather figure out how to do it in systemd alone if at all possible (less moving parts, ideally). Systemd is detecting my lid close, and it's also able to suspend using systemctl suspend, but for some reason the event just isn't linking up.

@abrouwers: This isn't the problem as it happens any time, no matter how long I've had my computer on.

Offline

#6 2014-08-14 22:09:11

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Laptop won't suspend when lid closed

Udev should catch the lid button with 'udevadm monitor -p -u', you could write a rule that would start 'systemctl suspend' or use systemds own udev implementation.

Edit: Requesting additional information:

@abrouwers Could you name any [documentation] references for that information? I had trouble finding anything.

Last edited by emeres (2014-08-15 12:39:07)

Offline

Board footer

Powered by FluxBB