Unsolved

This post is more than 5 years old

1 Message

34273

May 25th, 2018 23:00

Stop laptop going to sleep when closing the lid (UBUNTU Server)

I have UBUNTU Server version 16.04.4 running on this laptop, so no GUI interface is available. How do I prevent the laptop to fall asleep when I close the lid to hide the laptop, running UBUNTU Server, MQTT Server, Node-RED, mySQL etc.? for Home Automation

1 Message

June 28th, 2018 08:00

I had the same issue with non-desktop Debian installation running on an Inspiron laptop. As soon as I shut the lid, the system would suspend/hibernate instead of continuing to run. After spending time going through all of the BIOS Setup settings and not finding an option to disable the "lid closed" event, the following Linux configuration change worked for me:

https://unix.stackexchange.com/questions/200125/debian-8-jessie-laptop-stops-working-after-closing-the-laptop-lid

 If you're not logged in as root, you'll need to add "sudo " to invoke the editor as in:

sudo nano /etc/systemd/logind.conf

In the file above, I changed only this line:

#HandleLidSwitch=suspend

to this:

HandleLidSwitch=ignore

After saving the file, I ran:

sudo systemctl restart systemd-logind

This immediately resolved the problem.

Here is some additional background on these configuration options:

https://unix.stackexchange.com/questions/52643/how-to-disable-auto-suspend-when-i-close-laptop-lid/52645#52645

I don't think the syntax above is different for Ubuntu but if you encounter any issues, review the following post:

https://askubuntu.com/questions/15520/how-can-i-tell-ubuntu-to-do-nothing-when-i-close-my-laptop-lid

I hope this helps.

 

April 26th, 2020 03:00

Thanks a lot, @bkize1 !

This totally solved the problem on my PackardBell DotSE running Debian-based OpenMediaVault.

No Events found!

Top