- 0x0000007b
- 2차세계대전
- 3.20해킹
- 4대강
- 502 error
- 53빌딩
- 7840hs
- 88체육관 수영장
- ABI
- abortive close
- abortive shutdown
- AHCI
- akmods
- ALC1220
- alma linux
- alternatives
- AM4 메인보드
- AMD
- amd 7840hs
- amd 그래픽 게임용
- amd 내장 그래픽 최적화
- anonymous file
- API
- apple.com
- APT
- apt-get
- Armagnac
- Asrock
- ASTALIFT
- audacious player
- Today / Yesterday
- /
- Total
Linux Programmer
리눅스 절전 모드 비활성화 - systemd sleep 본문
리눅스 워크스테이션이나 데스크탑 버전을 설치하면 기본적으로 절전 기능이 활성화 되어있다. 예를 들어 Fedora workstation을 설치했다면 기본으로 절전 기능이 활성화되어있을 것이다. 만일 ssh로 외부에서 접속해서 작업하다가는 아래와 같은 메시지와 함께 절전으로 전환(suspend) 될 수도 있다. 이렇게 절전 모드로 빠지면 외부 접속은 모두 끊긴다.
$ Broadcast message from gdm@fedora on tty1:
The system will suspend now!
이런 문제를 겪지 않으려면 다음과 같이 설정하도록 한다. (관련 매뉴얼 페이지 : systemd-sleep.conf)
1. systemd/sleep.conf 설정 확인
먼저 현재 설정을 systemd-analyze cat-config systemd/sleep.conf 명령으로 확인해본다.
$ sudo systemd-analyze cat-config systemd/sleep.conf
# /etc/systemd/sleep.conf
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (at your option)
# any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the sleep.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# See systemd-sleep.conf(5) for details.
[Sleep]
#AllowSuspend=yes
#AllowHibernation=yes
#AllowSuspendThenHibernate=yes
#AllowHybridSleep=yes
#SuspendMode=
#SuspendState=mem standby freeze
#HibernateMode=platform shutdown
#HibernateState=disk
#HybridSleepMode=suspend platform shutdown
#HybridSleepState=disk
#HibernateDelaySec=
#SuspendEstimationSec=60min
위에 보면 모든 값들이 해시문자(#)로 막혀있는데, 이는 기본값을 의미한다. 그 중에 AllowSuspend=yes로 되어있는 부분이 바로 자동 절전 모드이다. 이를 no로 바꾸면 되는데, 편집을 직접하는게 아니라 overriding config를 만드는 방법을 사용하게 된다.
2. AllowSuspend=no 설정 방법
해당 설정은 관리자인 root 계정으로 명령해야 한다. 먼저 overriding config file을 저장할 디렉토리로 /etc/systemd/sleep.conf.d를 만들어야 한다. 그리고 해당 디렉토리에 넣을 설정 파일을 vi 같은 에디터로 만들어주면 된다. 즉 아래와 같이 명령한다.
mkdir /etc/systemd/sleep.conf.d
cd $!
vi nosuspend.conf
vi nosuspend.conf 명령어를 실행한 다음에는 아래의 내용을 넣는다. 핵심 설정 부분은 AllowSuspend=no 라는 부분이다.
[Sleep]
AllowSuspend=no
AllowHibernation=no
AllowSuspendThenHibernate=no
AllowHybridSleep=no
설정이 제대로 되었는지 확인하기 위해 systemd-analyze cat-config systemd/sleep.conf 명령을 다시 내려본다. 만일 가장 하단에 /etc/systemd/sleep.conf.d/nosuspend.conf로부터 파일을 읽혀졌다면 제대로 설정된 것이다.
root user# systemd-analyze cat-config systemd/sleep.conf
...생략...
[Sleep]
#AllowSuspend=yes
#AllowHibernation=yes
#AllowSuspendThenHibernate=yes
#AllowHybridSleep=yes
#SuspendMode=
#SuspendState=mem standby freeze
#HibernateMode=platform shutdown
#HibernateState=disk
#HybridSleepMode=suspend platform shutdown
#HybridSleepState=disk
#HibernateDelaySec=
#SuspendEstimationSec=60min
# /etc/systemd/sleep.conf.d/nosuspend.conf
[Sleep]
AllowSuspend=no
...
해당 설정은 즉시 적용되므로 따로 restart나 reload해줘야 하는 것은 없다. 다만 정 불안하다면 systemctl daemon-reload 명령을 한번 해주면 될 것이다.
히스토리
2025-03-21 글 작성
'컴퓨터 관련 > 리눅스(유닉스) 일반' 카테고리의 다른 글
sudoers 및 PAM 보안 설정 - sudo, su 권한 조정 (0) | 2025.01.12 |
---|---|
페도라 리눅스 DNF 저장소 설정 튜닝하기 - Fedora 41 dnf5 repository (4) | 2024.12.22 |
유닉스 표준 IEEE std 1003.1 issue 8 (SUSv5) 개정판 - 2024년 5월 발표 (10) | 2024.11.25 |
페도라 리눅스 nvidia 드라이버 설치 (RPM Fusion akmods, 24년 10월 기준) (4) | 2024.10.19 |
썬더볼트 장치 스캔 방법 - Fedora Linux / Windows (2) | 2024.02.26 |
[CentOS7] vim 7.4의 python3 지원 (0) | 2022.11.23 |
Fedora 35 : Thunderbolt 4 Maple ridge 인식 실패 문제 (0) | 2022.05.09 |
Failed to initialize NVML (Fedora 리눅스) (0) | 2020.11.28 |