Okay great, in that case after I’m done with everything I’ll request for these interfaces to be “auto-connect” for my snap.
Regarding my snap in strict
confinement, I made the necessary changes and this is how my snapcraft.yml looks like now.
I noticed during snap install I’ll get following INFO message:
2020-02-10T18:11:22+01:00 INFO snap "auto-cpufreq" has bad plugs or slots: system-files (cannot add system-files plug: needs valid "read" or "write" attribute)
After that I run:
snap connect auto-cpufreq:cpu-control
snap connect auto-cpufreq:system-observe
snap connect auto-cpufreq:hardware-observe
to make manual interface connections, which as a result look like:
$ snap connections auto-cpufreq
Interface Plug Slot Notes
cpu-control auto-cpufreq:cpu-control :cpu-control manual
hardware-observe auto-cpufreq:hardware-observe :hardware-observe manual
log-observe auto-cpufreq:log-observe :log-observe manual
process-control auto-cpufreq:process-control :process-control manual
system-observe auto-cpufreq:system-observe :system-observe manual
upower-observe auto-cpufreq:upower-observe :upower-observe -
However, when I run sudo auto-cpufreq --live
I’ll get following output:
----------------------------- System information ------------------------------
Linux distro: Ubuntu 19.10 (Eoan Ermine)
Linux kernel: 5.3.0-29-generic
Driver: intel_pstate
Architecture: x86_64
Processor: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
Cores: 8
------------------------------ Current CPU states ------------------------------
CPU max frequency:
4600 MHz
CPU frequency for each core:
CPU0: 4257 MHz
CPU1: 4306 MHz
CPU2: 4153 MHz
CPU3: 4123 MHz
CPU4: 4232 MHz
CPU5: 4264 MHz
CPU6: 4204 MHz
CPU7: 4188 MHz
Temperature for each physical core:
CPU0 temp: 83°C
CPU1 temp: 77°C
CPU2 temp: 83°C
CPU3 temp: 71°C
---------------------------- CPU frequency scaling ----------------------------
Battery is: charging
Setting to use "performance" governor
/snap/auto-cpufreq/x1/usr/bin/cpufreqctl: line 142: /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor: Permission denied
/snap/auto-cpufreq/x1/usr/bin/cpufreqctl: line 142: /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor: Permission denied
/snap/auto-cpufreq/x1/usr/bin/cpufreqctl: line 142: /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor: Permission denied
/snap/auto-cpufreq/x1/usr/bin/cpufreqctl: line 142: /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor: Permission denied
/snap/auto-cpufreq/x1/usr/bin/cpufreqctl: line 142: /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor: Permission denied
/snap/auto-cpufreq/x1/usr/bin/cpufreqctl: line 142: /sys/devices/system/cpu/cpu5/cpufreq/scaling_governor: Permission denied
/snap/auto-cpufreq/x1/usr/bin/cpufreqctl: line 142: /sys/devices/system/cpu/cpu6/cpufreq/scaling_governor: Permission denied
/snap/auto-cpufreq/x1/usr/bin/cpufreqctl: line 142: /sys/devices/system/cpu/cpu7/cpufreq/scaling_governor: Permission denied
Total CPU usage: 6.7 %
Total system load: 1.11
High load, setting turbo boost: on
/bin/sh: 1: cannot create /sys/devices/system/cpu/intel_pstate/no_turbo: Permission denied
-------------------------------------------------------------------------------
"auto-cpufreq" refresh in: 4
Any idea why I’m getting “permission denied” on /sys/devices/system/cpu/cpu*
and /sys/devices/system/cpu/intel_pstate/no_turbo
or am I doing something wrong?
I also noticed that when I run: sudo auto-cpufreq --install
I get following output:
/snap/auto-cpufreq/x1/lib/python3.6/site-packages/power/linux.py:100: UserWarning: Unable to read properties of /sys/class/power_supply/BAT0: [Errno 13] Permission denied: '/sys/class/power_supply/BAT0/type'
warnings.warn("Unable to read properties of {path}: {error}".format(path=supply_path, error=str(e)))
/snap/auto-cpufreq/x1/lib/python3.6/site-packages/power/linux.py:100: UserWarning: Unable to read properties of /sys/class/power_supply/AC: [Errno 13] Permission denied: '/sys/class/power_supply/AC/type'
warnings.warn("Unable to read properties of {path}: {error}".format(path=supply_path, error=str(e)))
----------------- auto-cpufreq daemon installed and running -----------------
To view live log, run:
auto-cpufreq --log
To disable and remove auto-cpufreq daemon, run:
sudo auto-cpufreq --remove
-------------------------------------------------------------------------------
As it seems I also have permission issues with: /sys/class/power_supply/*
Either way, looking forward to any comments that you may have, thanks!