Systemd
snapd 在 openSUSE Leap 15.1 上失敗
根據本文件,我已經在我的 openSUSE Leap 15.1 系統上安裝並啟用了 snappy:https ://snapcraft.io/docs/installing-snap-on-opensuse
添加儲存庫時,我為我的特定版本使用了一個:https ://download.opensuse.org/repositories/system:/snappy/openSUSE_Leap_15.1/
但是,在啟用該服務後,它在我啟動它幾秒鐘後一直以退出程式碼 42 崩潰。插座似乎沒問題:
opensuse:~ # systemctl status snapd.socket ● snapd.socket - Socket activation for snappy daemon Loaded: loaded (/usr/lib/systemd/system/snapd.socket; disabled; vendor preset: disabled) Active: active (listening) since Tue 2019-12-31 15:22:47 CET; 1h 58min ago Listen: /run/snapd.socket (Stream) /run/snapd-snap.socket (Stream) Dec 31 15:22:47 opensuse systemd[1]: Starting Socket activation for snappy daemon. Dec 31 15:22:47 opensuse systemd[1]: Listening on Socket activation for snappy daemon.
當我手動啟動 snapd.service 時,它在啟動後立即顯示正常:
opensuse:~ # systemctl status snapd.service ● snapd.service - Snappy daemon Loaded: loaded (/usr/lib/systemd/system/snapd.service; enabled; vendor preset: disabled) Active: active (running) since Tue 2019-12-31 17:23:34 CET; 999ms ago Main PID: 3014 (snapd) Tasks: 10 (limit: 4915) CGroup: /system.slice/snapd.service └─3014 /usr/lib/snapd/snapd Dec 31 17:23:34 opensuse systemd[1]: Starting Snappy daemon... Dec 31 17:23:34 opensuse snapd[3014]: AppArmor status: apparmor is enabled but some kernel features are missing: dbus Dec 31 17:23:34 opensuse snapd[3014]: daemon.go:346: started snapd/2.42.4-lp151.1.1 (series 16; classic; devmode) opensuse-leap/15.1 (amd64) linux/4.12.14-lp151.28.36-defau. Dec 31 17:23:34 opensuse snapd[3014]: daemon.go:439: adjusting startup timeout by 30s (pessimistic estimate of 30s plus 5s per snap) Dec 31 17:23:34 opensuse systemd[1]: Started Snappy daemon.
但是,幾秒鐘後它失敗了:
opensuse:~ # systemctl status snapd.service ● snapd.service - Snappy daemon Loaded: loaded (/usr/lib/systemd/system/snapd.service; enabled; vendor preset: disabled) Active: inactive (dead) since Tue 2019-12-31 17:23:39 CET; 36s ago Process: 3014 ExecStart=/usr/lib/snapd/snapd (code=exited, status=42) Main PID: 3014 (code=exited, status=42) Dec 31 17:23:34 opensuse systemd[1]: Starting Snappy daemon... Dec 31 17:23:34 opensuse snapd[3014]: AppArmor status: apparmor is enabled but some kernel features are missing: dbus Dec 31 17:23:34 opensuse snapd[3014]: daemon.go:346: started snapd/2.42.4-lp151.1.1 (series 16; classic; devmode) opensuse-leap/15.1 (amd64) linux/4.12.14-lp151.28.36-defau. Dec 31 17:23:34 opensuse snapd[3014]: daemon.go:439: adjusting startup timeout by 30s (pessimistic estimate of 30s plus 5s per snap) Dec 31 17:23:34 opensuse systemd[1]: Started Snappy daemon. Dec 31 17:23:39 opensuse snapd[3014]: daemon.go:540: gracefully waiting for running hooks Dec 31 17:23:39 opensuse snapd[3014]: daemon.go:542: done waiting for running hooks Dec 31 17:23:39 opensuse snapd[3014]: daemon stop requested to wait for socket activation
直接執行 /usr/lib/snapd/snapd 給我:
opensuse:~ # /usr/lib/snapd/snapd AppArmor status: apparmor is enabled but some kernel features are missing: dbus cannot run daemon: when trying to listen on /run/snapd.socket: socket "/run/snapd.socket" already in use
做什麼?
沒關係,找到了(我想)。顯然,該服務僅在安裝任何快照時才繼續執行。由於我還沒有安裝任何快照,它在啟動後自行終止。安裝第一個 snap 後,snapd 一直在後台執行。
為了安裝,首先你必須停止守護程序:
systemctl stop snapd.socket
然後進行實際安裝;否則,將出現最初發布的錯誤(無法執行守護程序)。