Bug#747749: systemd: closing lid suddenly suspends the machine

Martin Pitt mpitt at debian.org
Mon May 12 06:24:05 BST 2014


Hello all,

Julian Wollrath [2014-05-11 16:17 +0200]:
> I switched from sysvinit to systemd and now, if I close the lid, my machine
> suddenly suspends. For me this means, that the data of my current session is
> lost, since there are some problems with suspend with my machine.
> 
> This is unspected behaviour, that at least I would not expect from just
> changing the init system, since the init system should not have to do anything
> with events like closing the lid.

It's not immediately connected to the init system, but that's logind.
You'll get the same if you use systemd-shim and sysvinit or upstart.

I strongly advise to keep the current behaviour as a default. If you
are logged into a desktop session (GNOME, KDE, etc.), then they
usually handle the power button and lid switch so that you can
configure them in a more fine-grained manner with a GUI. But if nobody
is logged in, or you switched to a text console, then without logind
then these keys ought to be handled as well. In the past we had more
than one bug report about people closing their laptop, putting it into
the bag, and find it burned as it didn't sleep, just because they
realized that they weren't in a desktop session at that time.

It also mirrors what acpi-support does: It handles the power button to
shut down the machine (like logind) and on *some* models handles the
lid switch (but that's not very reliable). Logind's lid switch
handling uses the current kernel mechanisms which are fairly good.

I claim that the number of users which expect their laptop to sleep
when they close the lid greatly outnumbers the number of users for
which sleep isn't working.

> I was able to restore the old behaviour (doing nothing) by editing the
> HandleLidSwitch entry in /etc/systemd/logind.conf

Right, that would be the place to change it if you don't want this
behaviour outside of desktop sessions. The better fix would of course
be to fix sleep on your machine -- what's going wrong there?

> Therefore, please consider changing the default to doing nothing when doing
> this actions, so that others do not get this unexpected behaviour and
> experience data loss like I did.

Pretty much all OSes send the computer to sleep when you close the
lid, I think that should count as "expected behaviour" these days.

Thanks,

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)




More information about the Pkg-systemd-maintainers mailing list