5

I'm running Ubuntu 12.04 server on a laptop, and I'm pinging it from another machine. Whenever I close the lid, the pings stop getting responses, and when I open it again, they resume receiving them.

I'd like to make it so that shutting the lid on the laptop has no effect on its operation except for making the screen blank.

How can one achieve this? Thanks.

2
  • You could try here askubuntu.com/q/157629/93232 – Kiwy Mar 25 '14 at 8:37
  • 1
    what laptop model is this? You may find all the ACPI settings you need in the BIOS. In the past I have cut off the pin the senses the lid was shut but of course that left the screen on until the OS turned off the screen from lack of use. – rob Mar 25 '14 at 8:47
1

Edit /etc/UPower/UPower.conf and change IgnoreLid=false to IgnoreLid=true.

0
1

That is really dependent on your laptop.

Many of them you can ignore the "lid button" or "lid closed" events and that will work. Others you need to go into the BIOS and disable Power Management in some form (all together or may just the lid). An others you simply cant. My Mac Book for example can not function if you close the lid and there is no second monitor AND power supply plugged in.

Also be aware that even in the OS stack there are many things that could "do something" when the lid is closed. Gnome power manager was one that runs commands on lid closed.

Maybe give this question a try f you get stuck.

1

You can disable suspend mode in CentOS like below to achieve this.

Edit the following file :

[yoiuy@localhost ~]$ sudo vim /etc/systemd/logind.conf

and set or uncomment the following line :

HandleLidSwitch=ignore

then save and exit.

Now reload the logind.conf :

sudo systemctl restart systemd-logind
1
  • confirmed working in ubuntu 17.04 on a 2012 macbook pro. Note that while the network remains on, so does the LCD backlight. – trthfgh Jan 13 '18 at 4:11
0

When the lid is closed, the operating system receives an ACPI event. You can configure how Linux responds to this ACPI event: by default, in your setup, this triggers suspension, so you need to change that.

On Ubuntu, in the Gnome control center, you can configure what happens when the lid is closed in the “Power” tab. Change it from “Suspend” to “Do nothing”. This only affects what happens when you're logged in on the console.

To change the system default, you can edit the file /etc/acpi/lid.sh. It should be enough to create a file /etc/acpi/local/lid.sh.pre and implement your desired behavior there — though looking at it on Ubuntu 12.04, I think that what you want is the default behavior when not logged in (I haven't tested). How to prevent screen locking when lid is closed? and How can I tell Ubuntu to do nothing when I close my laptop lid? may have useful complementary information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.