Autoconnection request for htop (hardware-observe)

Hi! The latest releases of htop (3.0.3+) added support for temperature sensors and battery status; but it doesn’t work out of the box due to confinement. Instead, it shows N/A with a warning message: Error: File /etc/sensors3.conf: Permission denied.

This is currently worked around by manually connecting hardware-observe.

Thus, I’d like to request the auto-connection of hardware-observe to make life easier for our users :slight_smile: TIA

2 Likes

Is it possible to use system-files rather than the wide-ranging hardware-observe to get access to that one file? Does it work if you do?

No, it still needs read access to various entries under /sys/devices. Adding system-files with read: [/etc/sensors3.conf] and manually connecting still shows N/A in cpu temperature and battery status, with a pretty generic warning message Error: Permission denied, and lots of apparmor denials such as:

Log: apparmor="DENIED" operation="open" profile="snap.htop.htop" name="/sys/devices/pci0000:00/0000:00:1f.4/i2c-0/name" pid=108530 comm="htop" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Log: apparmor="DENIED" operation="open" profile="snap.htop.htop" name="/sys/devices/platform/USBC000:00/power_supply/ucsi-source-psy-USBC000:001/hwmon8/name" pid=108530 comm="htop" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Log: apparmor="DENIED" operation="open" profile="snap.htop.htop" name="/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon6/name" pid=108530 comm="htop" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Log: apparmor="DENIED" operation="open" profile="snap.htop.htop" name="/sys/devices/platform/coretemp.0/hwmon/hwmon4/name" pid=108530 comm="htop" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Log: apparmor="DENIED" operation="open" profile="snap.htop.htop" name="/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1b/PNP0C09:00/ACPI0003:00/power_supply/AC/hwmon0/name" pid=108530 comm="htop" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Log: apparmor="DENIED" operation="open" profile="snap.htop.htop" name="/sys/devices/virtual/thermal/thermal_zone0/hwmon1/name" pid=108530 comm="htop" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

+1 to auto-connect hardware-observe. There was some talk of creating a hwmon-control interface that could have a companion observe interface, but it isn’t ready yet. At this time, IME hardware-observe is the correct path forward.

It’s been 7 days since this was requested. Do we need an extension for the voting period? Thanks!

1 Like

@maxiberta, apologize for the delay.

Since hardware-observe is required to support the new added temperature sensors , +1 from me for auto-connect of hardware-observe for htop. +2 votes for, 0 votes against, granting auto-connect of hardware-observe to htop. This is now live.

We should keep on eye on the potential new hwmon-control interface and its companion -observe one, and revisit this declaration accordingly to make sure htop keeps having the least privileges required.