openSUSE Leap에서 unattended-upgrades 설정 방법
Source: Dev.to
안녕하세요 여러분, Shitty Linux Documentation의 또 다른 에피소드에 오신 것을 환영합니다. 여기서는 개발자들이 충분히 설명하지 않았고, 다른 사람들도 직접 알아낸 뒤 별다른 글을 쓰지 않은 주제에 대해 블로그를 씁니다.
제목에 unattended-upgrades라는 용어를 사용한 이유는 해당 패키지가 openSUSE에 존재하거나 동작한다는 뜻이 아니라, 비‑Windows 환경에서 가장 기능적이고 신뢰할 수 있는 자동 업데이트 시스템이기 때문입니다. (macOS는 자동으로 OS 업데이트를 설치할 수 없으므로 제외합니다.)
Step 0: Read the docs
네, 이 단계도 싫어하지만 문서가 거의 없고, 다음 내용을 이해하려면 반드시 읽어야 합니다.
Step 1: Install os-update
# zypper install os-update
Step 2: Configure os-update
/usr/share/os-update/os-update.conf 파일을 엽니다. 그곳에 표시된 설정에 동의한다면 다음 단계로 넘어가세요.
설정을 변경하고 싶다면 /etc/os-update.conf를 편집하고, 오버라이드하고 싶은 줄만 포함합니다. 예를 들어, 유지하고 싶은 기본값이 다음과 같다면:
#UPDATE_CMD=dup
#REBOOT_CMD=reboot
/etc/os-update.conf에는 해당 줄들을 (주석을 해제하거나 필요에 따라 수정해서) 넣어야 합니다.
Step 3: Configure os-update.timer
서비스만 시작하고 os-update가 자체 일정에 따라 실행되도록 하려면 다음 단계로 건너뛰세요.
그렇지 않다면 /etc/systemd/system/os-update.timer를 편집하여 os-update가 언제 실행될지 정의합니다. 내용은 systemd timer documentation 을 참고해 맞춤 설정하세요. 예시 구성은 다음과 같습니다:
[Unit]
Description="Run os-update daily at 0300 even if machine was offline for previous attempt"
[Timer]
OnCalendar=Mon..Sun *-*-* 03:00:00
Persistent=true
Step 4: Reload systemd config
타이머 파일을 수정했다면 systemd를 재로드하여 변경 사항을 적용합니다:
# systemctl daemon-reload
Step 5: Enable and start os-update.timer
# systemctl enable os-update.timer
# systemctl start os-update.timer
Step 6: Check the os-update.timer config
# systemctl list-timers os-update.timer
NEXT 열에 표시된 값이 /etc/systemd/system/os-update.timer에 명시한 의도와 일치해야 합니다.