60

I recently upgraded to the latest version (13.10). I have it running on an old laptop. Since the upgrade, whenever I close the laptop lid, it goes to sleep mode.

Any idea on how to fix?

I've tried the solution here:

Keep Ubuntu Server running on a laptop with the lid closed?

After installing acpi-support I don't have the file: /etc/acpi/event/lidbtn to edit.

Your help is appreciated!

3

1 Answer 1

89

I've had the same problem and after a lot of reading, I realized that Ubuntu 13.10 uses systemd-logind and it handles the lid close event. To disable entering the sleep mode edit the /etc/systemd/logind.conf file and uncomment/modify/add the line:

HandleLidSwitch=ignore

Then execute sudo restart systemd-logind or simply reboot.

This has solved the problem on my PC.

Update for 15.04

I'm not sure if Ubuntu 15.04 already switched to systemd completely. If so, the new command for restarting the service is sudo systemctl restart systemd-logind.service.

10
  • 1
    I get Unknown job: systemd-logind...
    – Alex
    Nov 13, 2013 at 15:06
  • 1
    The "execute" bit isn't sudo restart systemd-logind, it's sudo service systemd-logind restart. Other than that, works like a charm :) Apr 7, 2015 at 13:25
  • 1
    @daniel - it still works with sudo restart systemd-logind on my 14.04.2 LTS. It is registered as an upstart service in /etc/init/systemd-logind.conf. I believe Ubuntu is configured to execute the same command after sudo service systemd-logind restart for compatibility reasons - it should be described in the man service page.
    – jeremija
    Apr 7, 2015 at 13:39
  • 1
    @jeremija Using 14.10 beta here; either it's broken in it, or they changed it. Sorry, should've thought of that :) Apr 14, 2015 at 17:06
  • 1
    Works well in Ubuntu server 16.04.1 LTS. sudo service systemd-logind restart worked for me.
    – Rutrus
    Oct 10, 2016 at 4:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .