If you don't want the laptop went to sleep or if you closed the lid, or low-power mode for continuous operation of clients or servers.
You can try the following.
These are separate alternatives for solving the problem.
They can be used individually or in combination.
1. /etc/systemd/logind.conf
Edit and uncomment this lines in /etc/systemd/logind.conf
``` HandleLidSwitch=ignore HandleLidSwitchExternalPower=ignore HandleLidSwitchDocked=ignore ```
Restart with :
systemctl restart systemd-logind
2. cpufrequtils
Install and run cpufrequtils
`apt install cpufrequtils`
Set the CPU governor to powersave
`cpufreq-set -r -g powersave`
3. systemctl
Disable suspend with systemctl
4. linux-tools-generic
Use cpupower from the linux-tools-generic
``` apt install linux-tools-generic cpupower frequency-set -g powersave cpupower frequency-set -d <min_frequency> ```
Do a reboot after you change it.
5. With Systemd:
Disable sleep settings with:
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
Reboot your system
6. Try over UPower
Edit /etc/UPower/UPower.conf and set:
IgnoreLid=true IdleAction=none
Restart with:
systemctl restart upower
7. More Sources and Solutions:
8. Blacklisting ideapad_laptop module
For some devices, you need to make changes and use kernel modules and GRUB settings.
Blacklisting ideapad_laptop module solves the problem completely. I did it by editing a line in /etc/default/grub to be GRUB_CMDLINE_LINUX_DEFAULT='quiet splash module_blacklist=ideapad_laptop'. Will this affect the Windows system? Also, where does the ideapad_laptop module come from (e.g. BIOS)?
This change normally won't affect your windows system because the GRUB bootloader configuration and the blacklisted module only apply to your Linux environment. The ideapad_laptop module is part of the Linux kernel, and Windows doesn't interact with it.
The module it is included in the Linux kernel for handling certain power and hardware management features specific to Lenovo Ideapad models.
Laptop suddenly shuts down when opening or closing lid during sleep
9. setterm --blank force
One way to turn off the screen manually, with physical or remote access to the device.
Here, the settings are applied only via SSH, turning the screen on and off, as in this example.
Without SSH, I can only reactivate the screen display with a hard reboot if i use setterm --blank force with physical access to the device, I also couldn't switch to a console TTY*.
How can I turn the screen back on using setterm or another command, only with the core utilities over ssh?