AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1213390
Accepted
SebMa
SebMa
Asked: 2020-02-28 02:36:11 +0800 CST2020-02-28 02:36:11 +0800 CST 2020-02-28 02:36:11 +0800 CST

蓝牙服务无法正常重启:需要分两步完成

  • 772

蓝牙服务无法正常重启:

$ 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.serviceman 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:试过这个,但它没有解决RFCOMM server failed for Headset Voice gateway: rfcomm_bind: Address already in use (98)pb。

结论:我从@6666 提出的解决方案--noplugin=sap中将选项添加到ExecStart=命令行,它解决了我的重启 pb。仍然有其他错误,但每次蓝牙服务重启后蓝牙工作正常,所以谁在乎它们:-)

bluetooth systemd 16.04
  • 1 1 个回答
  • 4029 Views

1 个回答

  • Voted
  1. Best Answer
    jakethefinn
    2020-02-29T04:12:56+08:002020-02-29T04:12:56+08:00

    关注第一个重大错误Sap 驱动程序初始化失败,因为它级联到您突出显示的最后一个错误:

    RFCOMM server failed for Headset Voice gateway: rfcomm_bind: Address already in use (98).

    开始自顶向下调试。通常最后的错误会自行解决。对于一般参考,这里有一些用于音频的示例蓝牙配置文件。

    • 3

相关问题

  • ubuntu无法识别笔记本电脑的内部蓝牙:如何诊断问题?

  • 如何为我的蓝牙手机分配串口?

  • 我可以将我的计算机用作 A2DP 接收器/蓝牙扬声器吗?

  • 如何解决联想笔记本电脑上恢复/电源问题时禁用的蓝牙?

  • 命令列出启动时启动的服务?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve