Like it!

Join us on Facebook!

Like it!

No more hibernation when closing laptop lid in Ubuntu 14.04

Whenever I close the laptop lid, it goes to sleep mode. How can I disable such behavior?

I have a crappy HP netbook with Ubuntu Server 14.04 on it. Whenever I close the lid, hibernation mode kicks in. I definitely don't like that: during hibernation the machine stops working. The solution: tweak a parameter on a systemd configuration file. Systemd is a set of core tools that form a basic building block for Linux. In particular I am going to touch systemd-logind, a daemon responsible for login management.

In order to disable hibernation when the lid is closed, follow these steps:

  1. open /etc/systemd/logind.conf;
  2. find the key HandleLidSwitch=suspend and set it to HandleLidSwitch=ignore. Add it if it does not exist or uncomment it if its commented out (i.e. if there a hash at the beginning of the line);
  3. reboot.

That's it. To bring the original configuration back, switch that line to HandleLidSwitch=suspend, or simply comment the line.

comments