I am running an old Dell Laptop as a server with Debian 10 on it. Installing Debian on the system was straight forward, but at a certain point you want to close the lid of the laptop. This puts your laptop in sleep, which for a server is not the intended result.
Debians Suspend Wiki page had the right solution for this
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
/etc/systemd/logind.confand change the accodring values
Sadly, the backlit of the display is not switching off, which leads to a broken display after a while and consumes additional energy. The simplest way to fix the issue was to change the
consoleblank setting at boot. This did not need any additional packages like ACPI or any extra user scripts at startup.
Verify the value used at the moment with
cat /sys/module/kernel/parameters/consoleblank. The value is in seconds.
The easiest way to add the parameter at boot is using the kernel command-line.
GRUB_CMDLINE_LINUX_DEFAULT=which sets the timeout to 10 minutes (600 seconds).
sudo update-grub, and reboot.