Toolbox: /etc/localtime이 호슀트의 μ ˆλŒ€ 심볼릭 링크인 경우 μ»¨ν…Œμ΄λ„ˆκ°€ μ‹œμž‘λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€(예: Arch 및 Ubuntu).

에 λ§Œλ“  2020λ…„ 11μ›” 09일  Β·  10μ½”λ©˜νŠΈ  Β·  좜처: containers/toolbox

버그 μ„€λͺ…
도ꡬ μƒμž 버전 0.0.97둜 μ—…κ·Έλ ˆμ΄λ“œν•œ ν›„ 더 이상 도ꡬ μƒμžλ₯Ό μ‹œμž‘ν•  수 μ—†μŠ΅λ‹ˆλ‹€.

toolbox enter work 좜λ ₯:

DEBU Running as real user ID 1000                 
DEBU Resolved absolute path to the executable as /usr/bin/toolbox 
DEBU Running on a cgroups v1 host                 
DEBU Checking if /etc/subgid and /etc/subuid have entries for user x 
DEBU TOOLBOX_PATH is /usr/bin/toolbox             
DEBU Toolbox config directory is /home/x/.config/toolbox 
DEBU Current Podman version is 2.1.1              
DEBU Old Podman version is 2.1.1                  
DEBU Migration not needed: Podman version 2.1.1 is unchanged 
DEBU Resolving container and image names          
DEBU Container: 'work'                            
DEBU Image: ''                                    
DEBU Release: ''                                  
DEBU Resolved container and image names           
DEBU Container: 'work'                            
DEBU Image: 'fedora-toolbox:31'                   
DEBU Release: '31'                                
DEBU Checking if container work exists            
DEBU Inspecting mounts of container work          
DEBU Starting container work                      
DEBU Inspecting entry point of container work     
DEBU Entry point PID is a float64                 
DEBU Entry point of container work is toolbox (PID=0) 
Error: invalid entry point PID of container work

μ—…λ°μ΄νŠΈ 전후에 μƒμ„±λœ μ»¨ν…Œμ΄λ„ˆμ˜ 좜λ ₯은 λ™μΌν•©λ‹ˆλ‹€. 도ꡬ μƒμžλŠ” 0.0.96으둜 λ‹€μš΄κ·Έλ ˆμ΄λ“œν•œ ν›„ μ‹œμž‘ν•  수 있으며 μ‹œμž‘λ˜λ©΄ 0.0.97에 μž…λ ₯ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

행동을 μž¬ν˜„ν•˜λŠ” 방법 단계

  1. 도ꡬ μƒμž μ‹œμž‘

μ˜ˆμƒλ˜λŠ” 행동
도ꡬ μƒμžκ°€ μ‹œμž‘λ˜μ—ˆμŠ΅λ‹ˆλ‹€

μ‹€μ œ 행동
Error: invalid entry point PID of container work 였λ₯˜κ°€ λ°œμƒν•˜κ³  도ꡬ μƒμžκ°€ μ‹œμž‘λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

toolbox --version 좜λ ₯(v0.0.90+)
toolbox version 0.0.97

도ꡬ μƒμž νŒ¨ν‚€μ§€ 정보( rpm -q toolbox )
toolbox-0.0.97-1-x86_64 (arch)

podman version 좜λ ₯

Version:      2.1.1
API Version:  2.0.0
Go Version:   go1.15.2
Git Commit:   9f6d6ba0b314d86521b66183c9ce48eaa2da1de2
Built:        Sat Sep 26 16:50:37 2020
OS/Arch:      linux/amd64

Podman νŒ¨ν‚€μ§€ 정보( rpm -q podman )
podman-2.1.1-1-x86_64 (arch)

OS에 λŒ€ν•œ 정보
μ•„μΉ˜λ¦¬λˆ…μŠ€

1. Bug

κ°€μž₯ μœ μš©ν•œ λŒ“κΈ€

λ‚˜λŠ” λ˜‘κ°™μ€ λ¬Έμ œκ°€ λ°œμƒν•©λ‹ˆλ‹€ (Arch Linuxμ—μ„œλ„). 0.0.96으둜 λ‹€μš΄ κ·Έλ ˆμ΄λ“œν•˜λ©΄ μ €μ—κ²Œ λ„μ›€μ΄λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

λ‹€μŒμ€ Fedora 32 도ꡬ μƒμžμ— λŒ€ν•œ Podman λ‘œκ·Έμž…λ‹ˆλ‹€.

$ podman logs fedora-toolbox-32
level=debug msg="Running as real user ID 0"
level=debug msg="Resolved absolute path to the executable as /usr/bin/toolbox"
level=debug msg="TOOLBOX_PATH is /usr/bin/toolbox"
level=debug msg="XDG_RUNTIME_DIR is unset"
level=debug msg="XDG_RUNTIME_DIR set to /run/user/1000"
level=debug msg="Creating /run/.toolboxenv"
level=debug msg="Monitoring host"
level=debug msg="Path /run/host/etc exists"
level=debug msg="Resolved /etc/localtime to /usr/share/zoneinfo/Europe/Amsterdam"
Error: /etc/localtime points to unknown location

λͺ¨λ“  10 λŒ“κΈ€

λ‚˜λŠ” λ˜‘κ°™μ€ λ¬Έμ œκ°€ λ°œμƒν•©λ‹ˆλ‹€ (Arch Linuxμ—μ„œλ„). 0.0.96으둜 λ‹€μš΄ κ·Έλ ˆμ΄λ“œν•˜λ©΄ μ €μ—κ²Œ λ„μ›€μ΄λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

λ‹€μŒμ€ Fedora 32 도ꡬ μƒμžμ— λŒ€ν•œ Podman λ‘œκ·Έμž…λ‹ˆλ‹€.

$ podman logs fedora-toolbox-32
level=debug msg="Running as real user ID 0"
level=debug msg="Resolved absolute path to the executable as /usr/bin/toolbox"
level=debug msg="TOOLBOX_PATH is /usr/bin/toolbox"
level=debug msg="XDG_RUNTIME_DIR is unset"
level=debug msg="XDG_RUNTIME_DIR set to /run/user/1000"
level=debug msg="Creating /run/.toolboxenv"
level=debug msg="Monitoring host"
level=debug msg="Path /run/host/etc exists"
level=debug msg="Resolved /etc/localtime to /usr/share/zoneinfo/Europe/Amsterdam"
Error: /etc/localtime points to unknown location

λ‚˜λŠ” 같은 것을 λ³Έλ‹€

level=debug msg="Running as real user ID 0"
level=debug msg="Resolved absolute path to the executable as /usr/bin/toolbox"
level=debug msg="TOOLBOX_PATH is /usr/bin/toolbox"
level=debug msg="XDG_RUNTIME_DIR is unset"
level=debug msg="XDG_RUNTIME_DIR set to /run/user/1000"
level=debug msg="Creating /run/.toolboxenv"
level=debug msg="Monitoring host"
level=debug msg="Path /run/host/etc exists"
level=debug msg="Preparing to redirect /etc/localtime to /run/host/etc/localtime"
level=debug msg="/run/host/etc/localtime is a symbolic link"
level=debug msg="Redirecting /etc/localtime to /run/host/etc/localtime"
level=debug msg="Resolved /etc/localtime to /usr/share/zoneinfo/Europe/Copenhagen"
Error: /etc/localtime points to unknown location

이것은 4c9b80aee2b2ee3162b82e309718a23792d0e103으둜 인해 λ°œμƒν•  수 μžˆμŠ΅λ‹ˆκΉŒ?

Manjaro(μ•„μΉ˜ 기반)μ—μ„œ λ™μΌν•œ λ¬Έμ œκ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€. 컀밋을 μ§„ν–‰ν•˜λ©΄μ„œ b9a0bd5f0c2a2421ec15eea286ca20f03b7152d2κ°€ λ²”μΈμž„μ„ λ°œκ²¬ν–ˆμŠ΅λ‹ˆλ‹€. 4c9b80aee2b2ee3162b82e309718a23792d0e103이 λ§ˆμ§€λ§‰μœΌλ‘œ μ˜¬λ°”λ₯΄κ²Œ μž‘λ™ν•˜λŠ” κ²ƒμœΌλ‘œ λ³΄μž…λ‹ˆλ‹€.

Arch Linuxμ—μ„œ 0.0.98.1을 μ‚¬μš©ν•΄ λ³Έ μ‚¬λžŒμ΄ μžˆμŠ΅λ‹ˆκΉŒ?

κΆκΈˆν•΄μ„œ κ·€ν•˜μ˜ Arch 호슀트 μ‹œμŠ€ν…œμ—λŠ” /etc/localtime μ—†μŠ΅λ‹ˆκΉŒ?

예, μ•„μΉ˜ ν˜ΈμŠ€νŠΈμ—λŠ” /etc/localtime이 μžˆμŠ΅λ‹ˆλ‹€. /usr/share/zoneinfo/에 λŒ€ν•œ 심볼릭 λ§ν¬μž…λ‹ˆλ‹€.
λ¬Έμ œλŠ” 도ꡬ μƒμžμ— λ‹€μŒμ΄ μžˆλ‹€λŠ” κ²ƒμž…λ‹ˆλ‹€.

        const zoneInfoRoot = "/run/host/usr/share/zoneinfo"

        if !strings.HasPrefix(localTimeEvaled, zoneInfoRoot) {
                return errors.New("/etc/localtime points to unknown location")
        }

zoneInfoRoot λ₯Ό "/usr/share/zoneinfo" ν•˜λ©΄ 도ꡬ μƒμžκ°€ μ œλŒ€λ‘œ μž‘λ™ν•©λ‹ˆλ‹€.

updateTimeZoneFromLocalTime() ν˜ΈμΆœν•˜κΈ° 전에 /etc/localtime λ§ν¬λŠ” /run/host/etc/localtime이 κ°€λ¦¬ν‚€λŠ” 것과 λ™μΌν•œ 경둜λ₯Ό 가리킀도둝 μ—…λ°μ΄νŠΈλ©λ‹ˆλ‹€.
호슀트 파일이 도ꡬ μƒμžμ— λŒ€ν•΄ 아무것도 λͺ¨λ₯΄κΈ° λ•Œλ¬Έμ— /etc/localtime이 /run/hostλ₯Ό κ°€λ¦¬μΌœμ•Ό ν•˜λŠ” 방법을 μ•Œμ§€ λͺ»ν•©λ‹ˆλ‹€.

λ”°λΌμ„œ λ‚΄κ°€ λ†“μΉœ 것이 μ•„λ‹ˆλ©΄ λ‹€λ₯Έ μ‚¬λžŒμ—κ²Œ λͺ…λ°±ν•  μˆ˜λ„ μžˆμ§€λ§Œ zoneInfoRoot λŠ” λ‹¨μˆœνžˆ λ³€κ²½/κ³ μ •λ˜μ–΄μ•Ό ν•©λ‹ˆλ‹€. /etc/localtime이 /run/host/usr/share/zoneinfo/... 및 /usr/share/zoneinfo/...λ₯Ό κ°€λ¦¬ν‚€λŠ” 두 가지 μ‚¬μš© 사둀가 μžˆλŠ” 경우 두 가지 κ°€λŠ₯성을 λͺ¨λ‘ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€. μΌμΉ˜ν•˜λŠ” 접두사λ₯Ό 기반으둜 timeZone λ₯Ό ν™•μΈν•©λ‹ˆλ‹€.

예, μ•„μΉ˜ ν˜ΈμŠ€νŠΈμ—λŠ” /etc/localtime이 μžˆμŠ΅λ‹ˆλ‹€. 에 λŒ€ν•œ 심볼릭 λ§ν¬μž…λ‹ˆλ‹€.
/usr/share/zoneinfo/.

μ’‹μ•„, Fedora CoreOS 의 상황 κ³Ό

이 λ¬Έμ œλŠ” https://github.com/containers/toolbox/pull/634μ—μ„œ ν•΄κ²°ν•΄μ•Ό ν•©λ‹ˆλ‹€.

κ·ΈλŸ¬λ‚˜ Arch와 Ubuntu λͺ¨λ‘ μƒλŒ€ 심볼릭 링크λ₯Ό μ‚¬μš©ν•΄μ•Ό ν•œλ‹€λŠ” 점을 μ–ΈκΈ‰ν•΄μ•Ό ν•©λ‹ˆλ‹€. 그듀이 κ·Έλž¬λ‹€λ©΄ μƒλŒ€ 심볼릭 링크가 chroot와 같은 상황을 처리 ν•  수 β€‹β€‹μžˆκΈ° λ•Œλ¬Έμ— 이것은 계속 μž‘λ™ν•©λ‹ˆλ‹€. 이것이 더 μ’‹μŠ΅λ‹ˆλ‹€. 예λ₯Ό λ“€μ–΄ Fedora Workstationμ—λŠ” λ‹€μŒμ΄ μžˆμŠ΅λ‹ˆλ‹€.

$ ls -l /etc/localtime 
lrwxrwxrwx. 1 root root 35 Jan  5 18:20 /etc/localtime -> ../usr/share/zoneinfo/Europe/Prague

반면 Ubuntu 18.04μ—μ„œλŠ” λ‹€μŒμ„ λ³Ό 수 μžˆμŠ΅λ‹ˆλ‹€.

$ ls -l /etc/localtime 
lrwxrwxrwx 1 root root 33 lis 11 16:21 /etc/localtime -> /usr/share/zoneinfo/Europe/Prague

κ·ΈλŸ¬λ‚˜ timedatectl λ₯Ό μ‚¬μš©ν•˜λ©΄ λ‹€μŒκ³Ό 같이 μˆ˜μ •λ©λ‹ˆλ‹€ .

$ timedatectl set-timezone Europe/Prague
$ ls -l /etc/localtime 
lrwxrwxrwx 1 root root 35 led 12 20:29 /etc/localtime -> ../usr/share/zoneinfo/Europe/Prague

예, /etc/localtime 심볼릭 링크λ₯Ό μ ˆλŒ€ 링크둜 λ³€κ²½ν•˜λŠ” 것은 μ‚¬μš© κ°€λŠ₯ν•œ ν•΄κ²° λ°©λ²•μž…λ‹ˆλ‹€. 일단 이것을 μ‚¬μš©ν•˜κ² μŠ΅λ‹ˆλ‹€. κ°μ‚¬ν•©λ‹ˆλ‹€.

ν•˜μ§€λ§Œ #634λŠ” λ³‘ν•©λ˜μ–΄μ•Ό ν•œλ‹€κ³  μƒκ°ν•©λ‹ˆλ‹€. λ‚˜λŠ” κ·ΈλŸ¬ν•œ μ ˆλŒ€ 심볼릭 링크λ₯Ό μ§€μ›ν•˜μ§€ μ•ŠλŠ” κ²ƒμ΄λ³„λ‘œ μ€‘μš”ν•˜μ§€ μ•Šλ‹€κ³  μƒκ°ν•©λ‹ˆλ‹€.

폐쇄. 이것이 μ—¬μ „νžˆ ν•΄κ²°λ˜μ§€ μ•Šμ•˜λ‹€κ³  μƒκ°λ˜λ©΄ λ‹€μ‹œ μ—΄κ±°λ‚˜ μ˜κ²¬μ„ λ‚¨κ²¨μ£Όμ„Έμš”.

Toolboxλ₯Ό ν…ŒμŠ€νŠΈν•΄ μ£Όμ…”μ„œ κ°μ‚¬ν•©λ‹ˆλ‹€.

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰