Linux

[Ubuntu] 일시중단, 절전모드 활성화/비활성화 하기

Linuxias 2022. 2. 22. 18:16
반응형

Ubuntu에는 3가지 Suspend, Hibernation 모드가 존재합니다.

  1. Suspend to RAM (Normal Suspend)
  2. Suspend to Disk (Hibernate)
  3. Suspend to both (Hybrid)

위 모드는 systemd에서 target으로 각각 관리하고 있습니다.

$systemctl status sleep.target
● sleep.target - Sleep
     Loaded: loaded (/lib/systemd/system/sleep.target; static; vendor preset: enabled)
     Active: inactive (dead) since Tue 2022-02-22 18:07:56 KST; 1min 33s ago
       Docs: man:systemd.special(7)

 2월 22 17:59:44 linuxias systemd[1]: Reached target Sleep.
 2월 22 18:07:56 linuxias systemd[1]: Stopped target Sleep.


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

 2월 22 14:52:50 linuxias systemd[1]: Reached target Suspend.
 2월 22 14:52:50 linuxias systemd[1]: Stopped target Suspend.
 2월 22 17:16:40 linuxias systemd[1]: Reached target Suspend.
 2월 22 17:16:40 linuxias systemd[1]: Stopped target Suspend.
 2월 22 18:07:56 linuxias systemd[1]: Reached target Suspend.
 2월 22 18:07:56 linuxias systemd[1]: Stopped target Suspend.


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

 2월 22 14:52:50 linuxias systemd[1]: Reached target Suspend.
 2월 22 14:52:50 linuxias systemd[1]: Stopped target Suspend.
 2월 22 17:16:40 linuxias systemd[1]: Reached target Suspend.
 2월 22 17:16:40 linuxias systemd[1]: Stopped target Suspend.
 2월 22 18:07:56 linuxias systemd[1]: Reached target Suspend.
 2월 22 18:07:56 linuxias systemd[1]: Stopped target Suspend.

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

 2월 22 14:52:50 linuxias systemd[1]: Reached target Suspend.
 2월 22 14:52:50 linuxias systemd[1]: Stopped target Suspend.
 2월 22 17:16:40 linuxias systemd[1]: Reached target Suspend.
 2월 22 17:16:40 linuxias systemd[1]: Stopped target Suspend.
 2월 22 18:07:56 linuxias systemd[1]: Reached target Suspend.
 2월 22 18:07:56 linuxias systemd[1]: Stopped target Suspend.

각 모드는 mask, unmask를 이용하여 활성화 비활성화 할 수 있습니다.

비활성화 하기

$sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
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.

활성화 하기

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.
반응형