How to disable auto-suspend in Linux
If you work in an open environment, it can even protect your computer from opportunists snooping, trying to steal sensitive data while you're away.
However, that doesn't mean the auto-suspend feature is completely useful. It is often annoying and disrupts your workflow, such as when you are trying to read a long web page or actively running an application in the background. In these situations, disabling auto-suspend will allow you to get the most out of your Linux system.
How to disable auto-suspend using the GUI
One of the easiest ways to turn off auto-suspend on your computer is to use the Settings app. You can adjust System Suspension settings in Ubuntu and similar distributions by navigating to Settings > Power . Click Automatic Suspend and toggle the two settings so your computer doesn't automatically suspend when on battery power or when plugged in.
If you're not opposed to using an app to prevent auto-suspend, you may also find that programs like Caffeine will help you with the problem. Otherwise, the process is similar for distributions other than Debian and Ubuntu such as Arch Linux - although you may need to look for distro-specific configurations.
It should be noted that you may need to check your BIOS settings if your computer continues to automatically suspend or sleep despite adjusting the settings. After you have opened the BIOS by restarting your PC, you can usually configure the sleep settings by navigating to the Power Management tab .
How to disable auto-suspend from CLI
You'll find it just as easy to disable auto-suspend using the command line interface (CLI) on Linux, as you only need to enter a few commands on most distributions.
On Debian-based distributions such as Ubuntu and Linux Mint, you can disable the suspend daemon (and verify that its status is disabled) with the following commands:
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target sudo systemctl status sleep.target suspend.target hibernate.target hybrid-sleep.target
If you successfully disable the daemons responsible for system hibernation and sleep, the second command will result in a result that says ' Loaded: masked (Reason: Unit [daemon].target is masked. ) Active: inactive (dead)' for each daemon listed in the command. You may need to reboot the system before the changes take effect.
The process for disabling automatic suspend in other distributions is similar, although you may need to research some forums for specific advice. In Arch Linux, adding the following lines to .xinitrc with sudo nano /etc/X11/xinit/xinitrc usually fixes the problem:
xset s off xset -dpms xset s noblank
If you have a laptop that wants to prevent suspending after closing the lid, you will also need to edit the configuration file /etc/systemd.logind.conf. Open the file with the following command, add the lines followed by the asterisk, and close and save the file to disable the system suspend caused by the laptop closed:
sudo nano /etc/systemd/logind.conf * [Login] HandleLidSwitch=ignore HandleLidSwitchDocked=ignore
Entering the above command is very important if you plan to disable auto-suspend on your laptop. On the other hand, the systemd-logind daemon will try to call sleep.target hundreds of times per second when the lid is closed. Although it can be troublesome to tweak logind.conf , it will help keep your computer's CPU from being overloaded.
It's important to note that you can easily re-enable auto-suspend. If you want to run these system services again, you can enable them on your system by opening a terminal and entering the following commands:
sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target
You should read it
- 3 ways to disable USB Selective Suspend in Windows 11
- How to disable the Auto-Complete feature in Outlook 2013
- How to disable Auto-Brightness on iPhone
- Turn off the Win 10 update, stop Windows 10 from updating automatically
- How to turn off automatic screen rotation in Windows 10
- Turn off Auto refresh in the browser
- Is Auto-GPT worth using without GPT-4?
- Auto Click and how to automatically click when playing games
- New features of Android Auto
- The bank has to suspend operations because of the cat's actions
- Download GS Auto Clicker 3.1.4
- Automatic shutdown increases the screen brightness of Windows 10
Maybe you are interested
3 ways to disable USB Selective Suspend in Windows 11
3 ways to turn off suspended applications on Windows 11
Tips to quickly close (Force Quit) suspended applications on Mac
Tesla suspended production in the United States due to Covid-19
Temporarily suspend MWC 2020 indefinitely due to the complicated development of the Covid-19 pneumonia epidemic
The student was suspended from school because he found a hole in the school's software system