我在一个非Ubuntu系统上运行snap应用程序:
$ snap version
snap 2.30-5+b1
snapd 2.30-5+b1
series 16
pureos
kernel 4.18.0-1-amd64当我snap run一些应用程序工作时,其他应用程序返回此错误:
cannot perform readlinkat() on the mount namespace file descriptor of the init process: Permission denied在snapcraft.io上的建议之后,我尝试了:
snap list以准确识别我使用的核心版本(core 16-2.35.2r 5548)/etc/apparmor.d/snap.core.5548.usr.lib.snapd.snap-confine),向末尾添加ptrace read peer=unconfined,,如所述。sudo apparmor_parser -r /etc/apparmor.d/snap.core.5548.usr.lib.snapd.snap-confine但这没什么区别。失败的应用程序继续失败。我还能做什么?
说明
确认步骤2,包括:
$ tail /etc/apparmor.d/snap.core.5548.usr.lib.snapd.snap-confine
# from the core snap but we are already inside the constructed mount
# namespace. Here the apparmor kernel module re-constructs the path to
# snap-update-ns using the "hostfs" mount entry rather than the more
# "natural" /snap mount entry but we have no control over that. This is
# reported as (LP: #1716339). The variants here represent different
# locations of snap mount directory across distributions.
/var/lib/snapd/hostfs/{,var/lib/snapd/}snap/core/*/usr/lib/snapd/snap-update-ns r,
ptrace read peer=unconfined,
}发布于 2018-10-09 11:24:07
进行以下其他更改解决了此问题。这些步骤不适用于管理技术线程上的其他用户。,但它们确实为我工作。我不确定以前的任何更改是否实际上是不必要的。
/etc/apparmor.d/usr.lib.snapd.snap-confine.real,在末尾添加ptrace read peer=unconfined,,如下所示:$D4#但我们不希望任何人触摸/快照/bin审计拒绝挂载/D4/** -> /**,审计拒绝挂载/** -> /snap/bin/**,#允许内容接口从主机文件系统装入options=(ro bind) /var/lib/options=/hostfs/usr/share/ -> /->/snap/**/*,} ptrace peer=unconfined,}sudo apparmor_parser -r /etc/apparmor.d/*snap-confine*https://unix.stackexchange.com/questions/472068
复制相似问题