Skip to content

Linux shutdown on laptop lid close

The challenge

Using a laptop as a baby server, it had the behaviour of going in to standby when the lid close. The Operating system in this case is Proxmox.

The solution

Using nano or equivalent, update

sudo nano /etc/systemd/logind.conf

Look for the setting HandleLidSwitch, by default it is set to suspend. Update this to be ignore, lile the below example

HandleLidSwitch=ignore

Now restart systemd-logind to load this new setting.

systemctl restart systemd-logind

You can confirm that the setting worked by checking the status

systemctl status systemd-logind

There will be multiple entries showing, just make sure that the lid switch is not listed. Below is an example entry for the lid.

systemd-logind[16784]: Watching system buttons on /dev/input/event1 (Lid Switch)