Fix systemd service: Add Bluetooth permissions troubleshooting

The service needs setcap on the Python binary to access Bluetooth.
Added verification steps to troubleshooting section.
This commit is contained in:
2025-12-27 14:14:51 +01:00
parent d0ba2c5a52
commit b740372d88

View File

@@ -139,7 +139,26 @@ systemctl --user restart sensorpajen
```
### Troubleshooting
### Permission Denied Errors
If you see `PermissionError: [Errno 1] Operation not permitted` in the logs:
```bash
# Verify Bluetooth capabilities are set on Python binary
getcap ~/.local/share/virtualenvs/*/bin/python3.*
# If not set, apply capabilities (adjust path to your venv):
sudo setcap 'cap_net_raw,cap_net_admin+eip' $(readlink -f ~/sensorpajen/.venv/bin/python3)
# Verify it was set:
getcap $(readlink -f ~/sensorpajen/.venv/bin/python3)
# Should show: cap_net_admin,cap_net_raw+eip
# Restart the service
systemctl --user restart sensorpajen
```
**Important**: Capabilities must be set on the **actual Python binary**, not symlinks. Use `readlink -f` to resolve the real path.
#### Service Won't Start
```bash