5

There is an ubuntu 18.04 on my notebook. It was upgraded from 16.04.

The notebook's lid is closed and it is connected to a monitor. When I switch on the notebook and login to the system, half of the times it goes to suspend and in the other half times it logins correctly.

I found this answer, but I cannot accept it, because:

  1. it worked well with 16.04
  2. this setting IgnoreLid=true would mean that the lid of my notebook is broken which is not true.

My lid is not broken, it worked before the upgrade and it works half of the reboots. What is the explanation of this? Also, I want to keep this feature that I want my notebook to suspend when the lid is open and I close it.

For the record. My notebook is docked in a station, so the power button is always available for me. Means, I can switch it on or suspend it without opening the lid.

Any better idea how to fix this issue?

UPDATE: I can't test it anymore because I don't have a docking station to my new notebook. So I can accept one of the answer if multiple people say this or that is the working solution.

1
  • For my notebook, remote connections were kept last week, but are suspended this week on closing the lid. Maybe if we want a stable system we should avoid to change it twice a day with a new upgrade. Jul 19, 2019 at 20:39

2 Answers 2

6

For me, Sam's comment gave the working solution.

Edit the file /etc/systemd/logind.conf. You need to do this with root permission, so for example you can run this command:

sudoedit /etc/systemd/logind.conf

Just uncomment the line:

#HandleLidSwitchDocked=ignore

That is, change it to:

HandleLidSwitchDocked=ignore

Save and exit.

This allows the docked laptop run with the lid closed or open.

1
  • This answer arrived after when I replaced my notebook. The new one doesn't have docking station so I can't test whether it works. If more of you say it works then I accept this answer! Jun 15, 2021 at 9:40
3

Edit the file /etc/systemd/logind.conf

change the line:

#HandleLidSwitch=suspend

to:

HandleLidSwitch=ignore

Save the file and reboot.


After changes it should match my system:

$ grep -i lid /etc/systemd/logind.conf
HandleLidSwitch=ignore
#HandleLidSwitchDocked=ignore
#LidSwitchIgnoreInhibited=yes

Also check your Ubuntu power settings for what to do when lid is closed. For myself I have to open lid to access power button so the settings there are irrelevant. Since you can access power button with lid closed it may be significant.

2
  • okay, I will check it! For the record. My notebook is docked in a station, so the power button is always available for me. Means, I can switch it on or suspend it without opening the lid. When I travel it is a useful feature that I can suspend the notebook by closing the lid. Oct 15, 2018 at 8:28
  • 5
    Since you're using a docking station, I'd recommend changing the setting HandleLidSwitchDocked instead. That will only affect lid behaviour when your laptop is docked, meaning you can carry on suspending by closing the lid when you're not docked.
    – Sam
    Sep 18, 2019 at 8:41

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.