我已经根据此文档在 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
做什么?
答案1
没关系,找到了(我想)。显然,该服务仅在安装了任何快照时才保持运行。由于我尚未安装任何快照,因此它在启动后自行终止。安装第一个 snap 后,snapd 继续在后台运行。
为了安装,首先你必须停止守护进程:
systemctl stop snapd.socket
然后进行实际安装;否则,最初发布的错误(无法运行守护进程) 会出现。