btop
btop copied to clipboard
[BUG] apparmor premission denial stops zfs drive io stats from displaying in ubuntu snap btop
Describe the bug Ubuntu 22.04.3 LTS SNAP btop will not show zfs iostats because apparmor denies access. See #339 from an eternity ago.
To Reproduce have ZFS FS > snap install btop
Expected behavior allow access to show zfs mounts io as intended
Info (please complete the following information):
- btop++ version: 1.2.13
- Binary: static binary from release
- Architecture: x86_64
- Platform: Linux Ubuntu 22.04.3 LTS
- (Linux) Kernel: 5.15.0-87-generic
- Terminal used: GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
Additional context SNAP version which is allegedly https://github.com/kz6fittycent/btop Tried looking for anything related to /var/lib/snapd/apparmor/profiles/snap.btop.btop (which needs modification for fix) but couldn't find anything, no idea how snap makes theses files. Should this bug even be attributed here or at the snap repo?...
Workaround/Fix edit /var/lib/snapd/apparmor/profiles/snap.btop.btop find "@{PROC}/spl/kstat/zfs/arcstats r," ~line 790 add line "@{PROC}/spl/kstat/zfs/** r," apparmor_parser -r /var/lib/snapd/apparmor/profiles/snap.btop.btop run btop and enjoy working IO
Please assist. Thanks.
see also #639
This issue can be resolved fo the snap case by running the followign after install:
snap connect btop-desktop:hardware-observe
snap connect btop-desktop:mount-observe
snap connect btop-desktop:network-observe
snap connect btop-desktop:process-control
snap connect btop-desktop:removable-media
snap connect btop-desktop:system-observe
This issue can be resolved fo the snap case by running the followign after install:
snap connect btop-desktop:hardware-observe snap connect btop-desktop:mount-observe snap connect btop-desktop:network-observe snap connect btop-desktop:process-control snap connect btop-desktop:removable-media snap connect btop-desktop:system-observe
adapted for Ubuntu 22.04:
snap connect btop:hardware-observe snap connect btop:mount-observe snap connect btop:network-observe snap connect btop:process-control snap connect btop:removable-media snap connect btop:system-observe
Dec 08 13:56:31
audit[102049]: AVC apparmor="DENIED" operation="open" profile="snap.btop.btop" name="/proc/spl/kstat/zfs/nvme1/" pid=102049 comm="btop" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
Repeats apparmor denied error for each mount point.
This did not remedy.
Interesting. Please try running snap connections btop
and see if any others are missing. My specific issue was with ptrace and networks. That led me to finding the missing permissions. I do not have specific experience with the ZFS issue.
literally added everything
snap connect btop:audio-playback snap connect btop:audio-record snap connect btop:avahi-observe snap connect btop:browser-support snap connect btop:camera snap connect btop:content snap connect btop:cups-control snap connect btop:desktop snap connect btop:desktop-legacy snap connect btop:gsettings snap connect btop:hardware-observe snap connect btop:home snap connect btop:joystick snap connect btop:kernel-module-control snap connect btop:lxd-support snap connect btop:mount-control snap connect btop:mount-observe snap connect btop:network snap connect btop:network-bind snap connect btop:network-control snap connect btop:network-manager snap connect btop:network-observe snap connect btop:opengl snap connect btop:personal-files snap connect btop:process-control snap connect btop:removable-media snap connect btop:screen-inhibit-control snap connect btop:system-files snap connect btop:system-observe snap connect btop:system-packages-doc snap connect btop:u2f-devices snap connect btop:unity7 snap connect btop:upower-observe snap connect btop:wayland snap connect btop:x11 error: snap "btop" has no plug named "audio-playback" error: snap "btop" has no plug named "audio-record" error: snap "btop" has no plug named "avahi-observe" error: snap "btop" has no plug named "browser-support" error: snap "btop" has no plug named "camera" error: snap "btop" has no plug named "content" error: snap "btop" has no plug named "cups-control" error: snap "btop" has no plug named "desktop" error: snap "btop" has no plug named "desktop-legacy" error: snap "btop" has no plug named "gsettings" error: snap "btop" has no plug named "joystick" error: snap "btop" has no plug named "kernel-module-control" error: snap "btop" has no plug named "lxd-support" error: snap "btop" has no plug named "mount-control" error: snap "btop" has no plug named "network-bind" error: snap "btop" has no plug named "network-control" error: snap "btop" has no plug named "network-manager" error: snap "btop" has no plug named "opengl" error: snap "btop" has no plug named "personal-files" error: snap "btop" has no plug named "screen-inhibit-control" error: snap "btop" has no plug named "system-files" error: snap "btop" has no plug named "system-packages-doc" error: snap "btop" has no plug named "u2f-devices" error: snap "btop" has no plug named "unity7" error: snap "btop" has no plug named "upower-observe" error: snap "btop" has no plug named "wayland" error: snap "btop" has no plug named "x11"
[===>snap connections btop Interface Plug Slot Notes hardware-observe btop:hardware-observe :hardware-observe - home btop:home :home - mount-observe btop:mount-observe :mount-observe - network btop:network :network - network-observe btop:network-observe :network-observe - process-control btop:process-control :process-control - removable-media btop:removable-media :removable-media manual system-observe btop:system-observe :system-observe -
No dice. Only fix thus-far is the workaround in first post.
Even the first post didn't fix (for latest rev in the edge
channel). I will open a thread on forum.snapcraft.io to see if there's any other input.
NOTE: I've verified the stable
channel is working so do NOT refresh to edge
!
Please see my forum post regarding this issue: https://forum.snapcraft.io/t/btop-having-issues-with-segfault-on-hosts-running-zfs/38078