LXD 우분투 이미지 시작 문제: snap.lxd.activate.service를 찾을 수 없습니다.

LXD 우분투 이미지 시작 문제: snap.lxd.activate.service를 찾을 수 없습니다.

LXC/LXD를 처음 사용하고 이를 사용하고 싶지만 새 ubuntu 22.04 이미지를 시작하는 동안 문제가 발생했습니다.

나는 스냅을 사용하여 lxd를 설치했으며,LXD 설치 페이지.

lxc launch ubuntu:22.04 test
lxc shell test

시스템 snapd.seed.service작업이 완료되지 않습니다. 컨테이너 내의 시스템 작업을 확인하면 다음이 제공됩니다.

root@test:~# systemctl list-jobs
JOB UNIT                                 TYPE  STATE  
2   multi-user.target                    start waiting
136 cloud-config.service                 start waiting
145 ubuntu-advantage.service             start waiting
1   graphical.target                     start waiting
127 snapd.autoimport.service             start waiting
113 systemd-update-utmp-runlevel.service start waiting
116 snapd.seeded.service                 start running
135 cloud-init.target                    start waiting
142 cloud-final.service                  start waiting

9 jobs listed.
root@test:~# systemctl status snapd.seeded.service
● snapd.seeded.service - Wait until snapd is fully seeded
     Loaded: loaded (/lib/systemd/system/snapd.seeded.service; enabled; vendor preset: enabled)
     Active: activating (start) since Tue 2023-08-29 14:08:49 UTC; 18min ago
   Main PID: 428 (snap)
      Tasks: 17 (limit: 17608)
     Memory: 21.5M
        CPU: 2.060s
     CGroup: /system.slice/snapd.seeded.service
             └─428 /usr/bin/snap wait system seed.loaded

Aug 29 14:08:49 test systemd[1]: Starting Wait until snapd is fully seeded...
root@test:~# systemctl status snap.lxd.activate.service
× snap.lxd.activate.service
     Loaded: not-found (Reason: Unit snap.lxd.activate.service not found.)
     Active: failed (Result: exit-code) since Tue 2023-08-29 14:24:14 UTC; 5min ago
   Main PID: 4450 (code=exited, status=1/FAILURE)
        CPU: 27ms

Aug 29 14:24:14 test systemd[1]: Starting Service for snap application lxd.activate...
Aug 29 14:24:14 test systemd[1]: snap.lxd.activate.service: Main process exited, code=exited, status=1/FAILURE
Aug 29 14:24:14 test systemd[1]: snap.lxd.activate.service: Failed with result 'exit-code'.
Aug 29 14:24:14 test systemd[1]: Failed to start Service for snap application lxd.activate.
root@test:~# journalctl -xe
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The unit snapd.service completed and consumed the indicated resources.
Aug 29 14:34:32 test systemd[1]: snapd.service: Scheduled restart job, restart counter is at 11.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ Automatic restarting of the unit snapd.service has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
Aug 29 14:34:32 test systemd[1]: Stopped Snap Daemon.
░░ Subject: A stop job for unit snapd.service has finished
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A stop job for unit snapd.service has finished.
░░ 
░░ The job identifier is 3052 and the job result is done.
Aug 29 14:34:32 test systemd[1]: snapd.service: Consumed 7.198s CPU time.
░░ Subject: Resources consumed by unit runtime
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The unit snapd.service completed and consumed the indicated resources.
Aug 29 14:34:32 test systemd[1]: Starting Snap Daemon...
░░ Subject: A start job for unit snapd.service has begun execution
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A start job for unit snapd.service has begun execution.
░░ 
░░ The job identifier is 3052.
Aug 29 14:34:32 test snapd[7253]: overlord.go:268: Acquiring state lock file
Aug 29 14:34:32 test snapd[7253]: overlord.go:273: Acquired state lock file
Aug 29 14:34:32 test snapd[7253]: patch.go:64: Patching system state level 6 to sublevel 1...
Aug 29 14:34:32 test snapd[7253]: patch.go:64: Patching system state level 6 to sublevel 2...
Aug 29 14:34:32 test snapd[7253]: patch.go:64: Patching system state level 6 to sublevel 3...
Aug 29 14:34:32 test snapd[7253]: daemon.go:247: started snapd/2.58+22.04.1 (series 16; classic; devmode) ubuntu/22.04 (amd64) linux/6.4.6-76060406-generic.
Aug 29 14:34:32 test systemd[1]: tmp-syscheck\x2dmountpoint\x2d2772350938.mount: Deactivated successfully.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The unit tmp-syscheck\x2dmountpoint\x2d2772350938.mount has successfully entered the 'dead' state.
Aug 29 14:34:32 test snapd[7253]: daemon.go:340: adjusting startup timeout by 30s (pessimistic estimate of 30s plus 5s per snap)
Aug 29 14:34:32 test snapd[7253]: backends.go:58: AppArmor status: apparmor is enabled but some kernel features are missing: dbus, network
Aug 29 14:34:32 test systemd[1]: Started Snap Daemon.
░░ Subject: A start job for unit snapd.service has finished successfully
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A start job for unit snapd.service has finished successfully.
░░ 
░░ The job identifier is 3052.
Aug 29 14:34:32 test systemd[1]: snap-snapd-19993.mount: Deactivated successfully.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The unit snap-snapd-19993.mount has successfully entered the 'dead' state.
Aug 29 14:34:32 test systemd[1]: snap-snapd-19993.mount: Unit process 110 (snapfuse) remains running after unit stopped.
Aug 29 14:34:32 test systemd[1]: snap-snapd-19993.mount: Consumed 1.627s CPU time.
░░ Subject: Resources consumed by unit runtime
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The unit snap-snapd-19993.mount completed and consumed the indicated resources.
Aug 29 14:34:32 test systemd[1]: Reloading.
Aug 29 14:34:32 test snapd[7253]: handlers.go:662: Reported install problem for "snapd" as already-reported

문제를 찾아 해결하는 데 도움을 주시면 감사하겠습니다(그리고 그 과정에서 LXC/LXD에 대해 자세히 알아볼 수 있습니다).

답변1

snapd이것은 "해결책"은 아니지만 위에 표시된 대로 이에 영향을 미치는 것으로 확인된 것은 패키지입니다 .몇 가지 이유, snapd.seed.service결코 끝나지 않습니다. apt-get purge snapd그런 다음 apt-get install snapd(필요하거나 설치를 원하는 경우) 어떻게든 문제를 해결하는 것 같습니다.

문제는 미리 시드된 스냅과 관련된 것 같습니다.

snaps:
  -
    name: core20
    channel: stable
    file: core20_2015.snap
  -
    name: snapd
    channel: stable
    file: snapd_20092.snap
  -
    name: lxd
    channel: 5.0/stable/ubuntu-22.04
    file: lxd_24322.snap

미리 시드된 이 스냅 목록은 말하자면 이미지에 "구워진" 것처럼 보입니다. 이미지가 작동하는 머신에서는 ubuntu:22.04기본적으로 다음 스냅을 사용할 수 있음을 의미합니다.

root@hip-weasel:~# snap list
Name    Version        Rev    Tracking       Publisher   Notes
core20  20230801       2015   latest/stable  canonical✓  base
lxd     5.0.2-838e1b2  24322  5.0/stable/…   canonical✓  -
snapd   2.60.3         20092  latest/stable  canonical✓  snapd

해결 방법

apt-get purge snapd과 를 수행하면 apt-get install snapd이러한 스냅은 다음과 같습니다.~ 아니다더 이상 미리 시드되었습니다. 이것이 바로 "작동"하는 이유입니다. 하지만 다음에 대해 더 많이 이해하는 것은 확실히 흥미로울 것입니다.이런 일이 일어나고왜 우리 기계 중 일부에서만...

root@settling-monster:/var/lib/snapd# snap list
No snaps are installed yet. Try 'snap install hello-world'.

관련 정보