Linuxias
Developer's Delight
Linuxias
  • Category
    • AI
      • Deep Learning
      • Machine Learning
      • Data Science
      • Framework
      • MLOps
      • Paper-Review
      • Tips
    • Android
      • Kotlin
      • Component
      • Compose
      • Compose UI
      • Material
      • Testing
    • Software Architecture
      • Architecture Pattern
      • Design Pattern
      • Requirement Engineering
    • Linux
      • Compile & Link
      • Command & Tool
      • Container
      • Debugging & Testing
      • Profiling
      • Kernel Analysis
      • Server
      • Shell Script
      • System Programming
    • Language
      • Carbon
      • C,C++
      • C#
      • Java
      • Python
    • ETC
      • Data Struct | Algorithm
      • git
      • Security
    • Book
    • 경제공부
      • 세금
      • 부동산
hELLO · Designed By 정상우.
Linuxias

Developer's Delight

Linux

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

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.
반응형
저작자표시 비영리 (새창열림)

'Linux' 카테고리의 다른 글

[Linux] Ubuntu에서 Ubuntu 22.04 설치 USB 만들기  (0) 2023.09.09
[Tip] zsh에서 프롬프트 경로 줄이기  (0) 2023.03.28
[vim] 특정 패턴이 포함된 라인 제거 또는 라인 외 제거  (0) 2019.07.15
[Ubuntu 16.04] Change network interface name  (0) 2017.12.07
자주 쓰는 Linux terminal terminator theme  (0) 2017.08.04
    'Linux' 카테고리의 다른 글
    • [Linux] Ubuntu에서 Ubuntu 22.04 설치 USB 만들기
    • [Tip] zsh에서 프롬프트 경로 줄이기
    • [vim] 특정 패턴이 포함된 라인 제거 또는 라인 외 제거
    • [Ubuntu 16.04] Change network interface name
    Linuxias
    Linuxias
    I want to be a S/W developer who benefits people.

    티스토리툴바