screen


Lubuntu: “Do Nothing” when I close the laptop’s lid 4

A few days ago we setup a server on a laptop with lubuntu. We wanted to make sure that once the screen lid is off, the PC would not shut down (or hibernate or sleep) and it would continue to accept requests.

We tried to configure the PC through the system settings that are available with the GUI but we could not get it to work right. Anyhow, what we did in the end and worked was the following:

In the file /etc/systemd/logind.conf we set the variable HandleLidSwitch to ignore. So after the change, the following line was in logind.conf:

HandleLidSwitch=ignore

If the above line is commented out (i.e. starts with the character #, be sure to uncomment it by removing the # character).
After that, we had to restart the systemd-logind service as follows:


service systemd-logind restart;

Finally, to test we closed the lid and the server was operating as expected.

Note

If you have a power manager such as xfce4-power-manager-settings, it is a good practice to make sure it is configure properly first before doing the change above. (e.g. Set Lock screen or Switch off display in When laptop lid is closed option).

If you start xfce4-power-manager after you do the change above, you might have to restart the service again as the solution seems to stop.