1

Since upgrading to 15.10, I am having suspend issue on my Thinkpad X1 Carbon (1st gen) which has been running five or six Ubuntu releases fine so far.

Upon lid close, no successful suspend happens right now: the machine stays on / immediately reverts to 'on'. When I first noticed that (about a month ago after upgrading) I simply reverted to booting into the older 3.* kernel. Following a reboot this week it turned out that under 3.50.* I had no wifi :-/ so the 3.* kernel is no viable option.

So back to 4.2.0-19, and after some research (and looking at existing bug reports) I found out that sudo pm-suspend; sudo pm-suspend works.

I tried to file a bug report but ubuntu-bug complains about third-party repositories so no luck. Happy to provide further details if it helps.

2 Answers2

1

There's an option in systemd that allows you to prevent your laptop to get into sleep mode when you close the lid.

Here are the steps to use that option:

  1. Open the file /etc/systemd/logind.conf with admin rights

  2. Add in a new line at the end of the file:

    HandleLidSwitch=ignore

Or, in one command in your terminal:

    echo "HandleLidSwitch=ignore" | sudo tee -a /etc/systemd/logind.conf

Here's what logind.conf manual says (source):

HandlePowerKey=, HandleSuspendKey=, HandleHibernateKey=, HandleLidSwitch=

       Controls whether logind shall handle the system power and sleep
       keys and the lid switch to trigger actions such as system power-off
       or suspend. Can be one of ignore, poweroff, reboot, halt, kexec,
       suspend, hibernate, hybrid-sleep and lock. If ignore logind will
       never handle these keys. If lock all running sessions will be
       screen locked. Otherwise the specified action will be taken in the
       respective event. Only input devices with the power-switch udev tag
       will be watched for key/lid switch events.  HandlePowerKey=
       defaults to poweroff.  HandleSuspendKey= and HandleLidSwitch=
       default to suspend.  HandleHibernateKey= defaults to hibernate.
MrVaykadji
  • 5,875
  • 2
  • 32
  • 55
  • Is this new? But even if so, why does a single sudo pm-suspend not work? In any even, I don;t want to ignore the lid closing---it had suspended well for years on this box. – Dirk Eddelbuettel Dec 11 '15 at 00:40
  • I've read your question again, and I understood your problem was that the lid closing triggered sleep: Upon lid close, so suspend happens. When I first noticed that (about a month ago after upgrading) I simply reverted to booting into the older 3.* kernel.

    Can you edit your question and clarify please? And about your question, no, it's not new, systemd has been around quite long now.

    – MrVaykadji Dec 11 '15 at 00:41
  • The lid-closing-triggering-suspend seems to correspond to sudo pm-suspend. After which my machine snaps back into life. By random luck I noticed that sudo pm-suspend; sudo pm-suspend works. So there is a race condition somewhere ... – Dirk Eddelbuettel Dec 11 '15 at 00:44
  • out of curiosity, would HandleLidSwitch=suspend work, manually added to logind.conf? – MrVaykadji Dec 11 '15 at 00:55
  • I didn;t need it before; I doubt it is needed now. The symptons of lid-closing are equivalent to a first (and unsuccessful, see above) call to pm-suspend. I don't think you and I are getting anywhere here. – Dirk Eddelbuettel Dec 11 '15 at 00:58
  • I'm just trying to help... – MrVaykadji Dec 11 '15 at 00:59
0

I also had this problem on Ubuntu 16.04

As detailed here for someone else, with a slightly different setup:

sh: echo: I/O error on pm-suspend Ubuntu 14.04

The problem was due to a constantly mounted USB stick. If I ensure the USB is unmounted prior to suspending it works perfectly.

user467257
  • 119
  • 3