Laptop suspends even after changing Power Management settings

As it says in the answer to the question How to make laptop not suspend when the lid is closed, I’ve changed the setting When the lid is closed to Do nothing on A/C power and battery power on Power Management. But the laptop is still suspending when I close the lid.

The laptop is a Thinkpad T480 and I want to use it through ssh without the need to keep the screen on, but when I close the lid it suspends and the ssh connection hangs.

The laptop isn’t connected to an external monitor.

On a similar question I’ve seen someone ask for the output of lsblk

❯ lsblk
nvme0n1     259:0    0 465.8G  0 disk
├─nvme0n1p1 259:1    0   300M  0 part /boot/efi
├─nvme0n1p2 259:2    0 448.5G  0 part /
└─nvme0n1p3 259:3    0  16.9G  0 part [SWAP]

Then please show your changes.

You mean to make a screenshot of the Power Management settings? I’ve written the setting that I’ve changed, that should be enough.

My bad… I ignored the solution and saw this:

Anyway… /etc/systemd/logind.conf is responsible for the action on lid close.

1 Like

I’ve added the line HandleLidSwitch=ignore to /etc/systemd/logind.conf and then I’ve done sudo systemctl restart systemd-logind.service.

Those changes will most likely be overwritten when you upgrade systemd
Better do your changes in a “drop-in”…

  • /etc/systemd/logind.conf.d/somename.conf
    Unless i’m wrong that should work… (ofcourse replaceing somename)

Any way of testing that? Could I uninstall and install systemd to try and see if it suspends again?

You can check if the drop-in is used by using:

systemd-analyze cat-config systemd/logind.conf

It should print the contents of all involved configurations after each other.
Ofcourse make sure your setting inside the drop-in is placed under a [Login] heading like in the original file :wink:

No need to re-install systemd, just undo your change in original file and check with above command and if all is ok, just reboot to test.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.