Posted On October 9, 2021

Disable and Enable Sleep Mode on a Linux Workstation

kimconnect 0 comments
blog.KimConnect.com >> Linux >> Disable and Enable Sleep Mode on a Linux Workstation

The following commands would work on any Linux machine with SystemD (Ubuntu, Linux Mint, Redhat, Fedora, etc.)

# Disable Sleep
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

# Output sample:
kim@kim-linux:~$ sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
[sudo] password for kim:
Created symlink /etc/systemd/system/sleep.target → /dev/null.
Created symlink /etc/systemd/system/suspend.target → /dev/null.
Created symlink /etc/systemd/system/hibernate.target → /dev/null.
Created symlink /etc/systemd/system/hybrid-sleep.target → /dev/null

# Enable Sleep
sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target

# Output Sample:
kim@kim-linux:~$ sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target
Removed /etc/systemd/system/sleep.target.
Removed /etc/systemd/system/suspend.target.
Removed /etc/systemd/system/hibernate.target.
Removed /etc/systemd/system/hybrid-sleep.target.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

How to Run OpenMediaVault with Pass-through Disks in VMWare ESXi

Assumptions: 1. The ESXi host in this lab is available with three (3) 1TB hard…

Network Time Service for Centos 7

yum install -y ntp ntpdatesystemctl start ntpdsystemctl enable ntpdntpdate -u -s 0.north-america.pool.ntp.org 1.north-america.pool.ntp.org 2.north-america.pool.ntp.org 3.north-america.pool.ntp.orgsystemctl…

Default Nginx Installation on Centos 7

NGINX as HTTP / HTTPS Proxysudo yum install epel-releasesudo yum install nginxsudo systemctl start nginxsudo…