As part of auto-cpufreq (Automatic CPU speed & power optimizer for Linux), in latest changes on gnome-power-v2 branch I would like to be able to configure bluetooth to be enabled or disabled on boot.
This functionality is already there for non Snap installs, and this is a bug fix for Snap, as currently it’s not possible to do this with application installed as a Snap.
As part of this request I’ve added etc-bluetooth-conf to plugs definition:
Instead of writing directly to /etc/bluetooth/main.conf would it be possible to use the bluez
interface to communicate with bluez and have it enabled / disabled at boot? Since auto-cpufreq is not the owner of this file then it would not be appropriate to grant auto-connection for this file but perhaps this could be allowed to be manually connected.
Regarding /etc/auto-cpufreq.conf - +1 from me for auto-connect of write access to this file named etc-auto-cpufreq-conf as this snap is the clear owner of this file.
If possible I would prefer if things could stay the way they are now, as I’ve already done a lot of code changes to adjust the app to properly work within Snap context. I also don’t know how I could to this with bluez.
I know it could be done by disabling bluetooth service: sudo systemctl disable bluetooth.service, but this doesn’t seem to be possible as I’m trying to get answer in Disabling systemctl service on host from snap.
Just setting (as it is now) AutoEnable=false to /etc/bluetooth/main.conf is simplest way to go, considering auto-cpufreq is targeting all distros (including those not using systemd).
network-control does seem like a safer option (although it does grant more permissions).
However, this doesn’t feel like core functionality for auto-cpufreq to control bluetooth so I don’t think it is suitable for auto-connection in this case. As such -1 for me for auto-connect of network-control for auto-cpufreq as users can manually connect this if required (and the app could prompt them to do so by checking snapctl is-connected network-control
+1 from me as well for auto-connect system-files with read access to /etc/auto-cpufreq.conf since the snap is the clear owner of such directory. +2 votes for, 0 votes against. Granting the requested auto-connection. @ahodzic I see the latest revision is still indicating read only access, let us know if for any reason you are not willing to have write access anymore and I will revert it to read only.
I agree with @alexmurray and will be -1 as well for auto-connect network-control since it is a very privileged interface and enabling/disabling bluetooth is not a core functionality of auto-cpufreq.
I wanted to have these changes approved before I made code changes. In latest revision auto-cpufreq 1.8.1 (93) it’s set back to write and will be so going forward. Thank you both for the approval.
Rest of the request can be ignored, as I made code changes where if app detects it’s running as a snap, it’ll will inform user how they can disable bluetooth on boot manually outside of snap package context.