본문 바로가기

Linux

Ubuntu 절전모드 설정

ubuntu 서버에서 ssh 접속이 끊어지면 혹시 절전모드가 활성화 되어 있는건 아닌지 확인해보자

절전모드 확인 명령어

sudo systemctl status sleep.target suspend.target hibernate.target hybrid-sleep.target

만약, 절전모드가 활성화 되어 있다면 다음과 같은 결과가 출력된다

-------------------------------------------------------------------------------------
● sleep.target - Sleep
Loaded: loaded (/lib/systemd/system/sleep.target; static; vendor preset: enabled)
Active: inactive (dead)
Docs: man:systemd.special(7)

● suspend.target - Suspend
Loaded: loaded (/lib/systemd/system/suspend.target; static; vendor preset: enabled)
Active: inactive (dead)
Docs: man:systemd.special(7)

● hibernate.target - Hibernate
Loaded: loaded (/lib/systemd/system/hibernate.target; static; vendor preset: enabled)
Active: inactive (dead)
Docs: man:systemd.special(7)

● hybrid-sleep.target - Hybrid Suspend+Hibernate
Loaded: loaded (/lib/systemd/system/hybrid-sleep.target; static; vendor preset: enabled)
Active: inactive (dead)
Docs: man:systemd.special(7)
---------------------------------------------------------------------------------------------------

절전모드 해제 명령어

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

해제 후 다시 확인해 보면 다음과 같이 출력된다

sudo systemctl status sleep.target suspend.target hibernate.target hybrid-sleep.target
-----------------------------------------------------------------------------------------
● sleep.target
Loaded: masked (Reason: Unit sleep.target is masked.)
Active: inactive (dead)

● suspend.target
Loaded: masked (Reason: Unit suspend.target is masked.)
Active: inactive (dead)

● hibernate.target
Loaded: masked (Reason: Unit hibernate.target is masked.)
Active: inactive (dead)

● hybrid-sleep.target
Loaded: masked (Reason: Unit hybrid-sleep.target is masked.)
Active: inactive (dead)
-------------------------------------------------------------------------------------------

절전모드 활성화 명령어

sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target

'Linux' 카테고리의 다른 글

Ubuntu apt 패키지 초기화  (0) 2024.05.31
Ubuntu 22.04 LTS SSH접속 안될 때  (1) 2023.11.02
Ubuntu 추가 디스크 Mount  (0) 2023.04.20
리눅스 Logrotate  (1) 2023.04.17
awk 명령어  (0) 2023.04.15