Служба Bluetooth не может перезапуститься должным образом:
$ sudo service bluetooth restart;service bluetooth status
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: active (running) since jeu. 2020-02-27 11:18:05 CET; 398ms ago
Docs: man:bluetoothd(8)
Main PID: 18310 (bluetoothd)
Status: "Running"
CGroup: /system.slice/bluetooth.service
└─18310 /usr/lib/bluetooth/bluetoothd
févr. 27 11:18:05 sebastien-B206 bluetoothd[18310]: gatt-time-server: Input/output error (5)
févr. 27 11:18:05 sebastien-B206 bluetoothd[18310]: Not enough free handles to register service
févr. 27 11:18:05 sebastien-B206 bluetoothd[18310]: Not enough free handles to register service
févr. 27 11:18:05 sebastien-B206 bluetoothd[18310]: Sap driver initialization failed.
févr. 27 11:18:05 sebastien-B206 bluetoothd[18310]: sap-server: Operation not permitted (1)
févr. 27 11:18:05 sebastien-B206 bluetoothd[18310]: Endpoint registered: sender=:1.55 path=/MediaEndpoint/A2DPSource
févr. 27 11:18:05 sebastien-B206 bluetoothd[18310]: Endpoint registered: sender=:1.55 path=/MediaEndpoint/A2DPSink
févr. 27 11:18:05 sebastien-B206 bluetoothd[18310]: Endpoint registered: sender=:1.43 path=/MediaEndpoint/A2DPSource
févr. 27 11:18:05 sebastien-B206 bluetoothd[18310]: Endpoint registered: sender=:1.43 path=/MediaEndpoint/A2DPSink
févr. 27 11:18:05 sebastien-B206 bluetoothd[18310]: RFCOMM server failed for Headset Voice gateway: rfcomm_bind: Address already in use (98)
Это нужно сделать в два этапа (см. Последнюю строку status
):
$ sudo service bluetooth stop;sudo service bluetooth start;service bluetooth status
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: active (running) since jeu. 2020-02-27 11:20:12 CET; 2s ago
Docs: man:bluetoothd(8)
Main PID: 18390 (bluetoothd)
Status: "Running"
CGroup: /system.slice/bluetooth.service
└─18390 /usr/lib/bluetooth/bluetoothd
févr. 27 11:20:12 sebastien-B206 bluetoothd[18390]: Not enough free handles to register service
févr. 27 11:20:12 sebastien-B206 bluetoothd[18390]: Not enough free handles to register service
févr. 27 11:20:12 sebastien-B206 bluetoothd[18390]: Sap driver initialization failed.
févr. 27 11:20:12 sebastien-B206 bluetoothd[18390]: sap-server: Operation not permitted (1)
févr. 27 11:20:12 sebastien-B206 bluetoothd[18390]: Endpoint registered: sender=:1.55 path=/MediaEndpoint/A2DPSource
févr. 27 11:20:12 sebastien-B206 bluetoothd[18390]: Endpoint registered: sender=:1.55 path=/MediaEndpoint/A2DPSink
févr. 27 11:20:12 sebastien-B206 bluetoothd[18390]: Endpoint registered: sender=:1.43 path=/MediaEndpoint/A2DPSource
févr. 27 11:20:12 sebastien-B206 bluetoothd[18390]: Endpoint registered: sender=:1.43 path=/MediaEndpoint/A2DPSink
févr. 27 11:20:12 sebastien-B206 bluetoothd[18390]: RFCOMM server failed for Headset Voice gateway: rfcomm_bind: Address already in use (98)
févr. 27 11:20:15 sebastien-B206 systemd[1]: Started Bluetooth service.
Я попытался добавить параметр RestartSec = 5
в [ Service]
раздел /lib/systemd/system/bluetooth.service
( man systemd.service
), но он не работал:
$ sudo systemctl edit --full bluetooth
$ systemctl cat bluetooth | grep RestartSec
RestartSec=5
$ sudo systemctl daemon-reload
$ sudo service bluetooth restart;service bluetooth status
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: active (running) since jeu. 2020-02-27 11:30:28 CET; 524ms ago
Docs: man:bluetoothd(8)
Main PID: 18830 (bluetoothd)
Status: "Running"
CGroup: /system.slice/bluetooth.service
└─18830 /usr/lib/bluetooth/bluetoothd
févr. 27 11:30:28 sebastien-B206 bluetoothd[18830]: gatt-time-server: Input/output error (5)
févr. 27 11:30:28 sebastien-B206 bluetoothd[18830]: Not enough free handles to register service
févr. 27 11:30:28 sebastien-B206 bluetoothd[18830]: Not enough free handles to register service
févr. 27 11:30:28 sebastien-B206 bluetoothd[18830]: Sap driver initialization failed.
févr. 27 11:30:28 sebastien-B206 bluetoothd[18830]: sap-server: Operation not permitted (1)
févr. 27 11:30:28 sebastien-B206 bluetoothd[18830]: Endpoint registered: sender=:1.55 path=/MediaEndpoint/A2DPSource
févr. 27 11:30:28 sebastien-B206 bluetoothd[18830]: Endpoint registered: sender=:1.55 path=/MediaEndpoint/A2DPSink
févr. 27 11:30:28 sebastien-B206 bluetoothd[18830]: Endpoint registered: sender=:1.43 path=/MediaEndpoint/A2DPSource
févr. 27 11:30:28 sebastien-B206 bluetoothd[18830]: Endpoint registered: sender=:1.43 path=/MediaEndpoint/A2DPSink
févr. 27 11:30:28 sebastien-B206 bluetoothd[18830]: RFCOMM server failed for Headset Voice gateway: rfcomm_bind: Address already in use (98)
Вот мой bluetooth.service
конфигурация:
$ systemctl cat bluetooth
# /lib/systemd/system/bluetooth.service
[Unit]
Description=Bluetooth service
Documentation=man:bluetoothd(8)
ConditionPathIsDirectory=/sys/class/bluetooth
[Service]
Type=dbus
BusName=org.bluez
ExecStart=/usr/lib/bluetooth/bluetoothd
NotifyAccess=main
#WatchdogSec=10
#Restart=on-failure
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
LimitNPROC=1
RestartSec=5
[Install]
WantedBy=bluetooth.target,suspend.target
Alias=dbus-org.bluez.service
EDIT0: Только что перезагрузился:
$ sudo systemctl restart bluetooth
$ systemctl status -n 20 bluetooth
● bluetooth.service - Bluetooth service
Loaded: loaded (/etc/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: active (running) since jeu. 2020-02-27 17:23:24 CET; 2min 42s ago
Docs: man:bluetoothd(8)
Main PID: 5050 (bluetoothd)
Status: "Running"
CGroup: /system.slice/bluetooth.service
└─5050 /usr/lib/bluetooth/bluetoothd
févr. 27 17:23:24 sebastien-B206 systemd[1]: Started Bluetooth service.
févr. 27 17:23:25 sebastien-B206 bluetoothd[5050]: Starting SDP server
févr. 27 17:23:25 sebastien-B206 bluetoothd[5050]: Bluetooth management interface 1.10 initialized
févr. 27 17:23:25 sebastien-B206 bluetoothd[5050]: Failed to obtain handles for "Service Changed" characteristic
févr. 27 17:23:25 sebastien-B206 bluetoothd[5050]: Not enough free handles to register service
févr. 27 17:23:25 sebastien-B206 bluetoothd[5050]: Error adding Link Loss service
févr. 27 17:23:25 sebastien-B206 bluetoothd[5050]: Not enough free handles to register service
févr. 27 17:23:25 sebastien-B206 bluetoothd[5050]: Not enough free handles to register service
févr. 27 17:23:25 sebastien-B206 bluetoothd[5050]: Not enough free handles to register service
févr. 27 17:23:25 sebastien-B206 bluetoothd[5050]: Current Time Service could not be registered
févr. 27 17:23:25 sebastien-B206 bluetoothd[5050]: gatt-time-server: Input/output error (5)
févr. 27 17:23:25 sebastien-B206 bluetoothd[5050]: Not enough free handles to register service
févr. 27 17:23:25 sebastien-B206 bluetoothd[5050]: Not enough free handles to register service
févr. 27 17:23:25 sebastien-B206 bluetoothd[5050]: Sap driver initialization failed.
févr. 27 17:23:25 sebastien-B206 bluetoothd[5050]: sap-server: Operation not permitted (1)
févr. 27 17:23:25 sebastien-B206 bluetoothd[5050]: Endpoint registered: sender=:1.65 path=/MediaEndpoint/A2DPSource
févr. 27 17:23:25 sebastien-B206 bluetoothd[5050]: Endpoint registered: sender=:1.65 path=/MediaEndpoint/A2DPSink
févr. 27 17:23:25 sebastien-B206 bluetoothd[5050]: Endpoint registered: sender=:1.42 path=/MediaEndpoint/A2DPSource
févr. 27 17:23:25 sebastien-B206 bluetoothd[5050]: Endpoint registered: sender=:1.42 path=/MediaEndpoint/A2DPSink
févr. 27 17:23:25 sebastien-B206 bluetoothd[5050]: RFCOMM server failed for Headset Voice gateway: rfcomm_bind: Address already in use (98)
EDIT1: rfkill list
вывод:
$ rfkill list
0: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
EDIT2: Пробовал это , но не t решить проблему сервера RFCOMM для голосового шлюза гарнитуры: rfcomm_bind: адрес уже используется (98)
pb.
ВЫВОД: Я добавил параметр - noplugin = sap
в командную строку ExecStart =
из решения , предложенного @ 6666 , и это решило мой перезапуск pb. По-прежнему есть другие ошибки, но bluetooth работает нормально после каждого перезапуска службы bluetooth, так что кого это волнует: -)
Сосредоточьтесь на первой существенной ошибке Ошибка инициализации драйвера SAP , поскольку она переходит в последнюю выделенную вами ошибку:
Сервер RFCOMM не работает для голосового шлюза гарнитуры: rfcomm_bind: Адрес уже используется (98)
.
Начать отладку сверху вниз. Обычно тогда последние ошибки решаются сами собой. Для справки, здесь - это несколько примеров конфигурационных файлов Bluetooth для аудио.