49

I am getting an error on bluetooth service status.

I need guidance to resolve this error.

    pi@raspberrypi:~ $ sudo service bluetooth status
* bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled)
   Active: active (running) since Sat 2016-01-09 19:12:47 UTC; 1min 12s ago
     Docs: man:bluetoothd(8)
 Main PID: 370 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           `-370 /usr/lib/bluetooth/bluetoothd

Jan 09 19:12:46 raspberrypi bluetoothd[370]: Bluetooth daemon 5.23
Jan 09 19:12:47 raspberrypi bluetoothd[370]: Starting SDP server
Jan 09 19:12:47 raspberrypi systemd[1]: Started Bluetooth service.
Jan 09 19:12:47 raspberrypi bluetoothd[370]: Bluetooth management interface 1.9 initialized
Jan 09 19:12:47 raspberrypi bluetoothd[370]: Sap driver initialization failed.
Jan 09 19:12:47 raspberrypi bluetoothd[370]: sap-server: Operation not permitted (1)
pi@raspberrypi:~ $
Patrick Cook
  • 6,365
  • 8
  • 38
  • 63
Jeeva
  • 603
  • 1
  • 5
  • 4

2 Answers2

64

NOTE:

This was a good answer at one time, but it appears that it may not work any longer. This is based on trying to cure the same problem posted in the OP's question - but on a bullseye system. The same is true for the answer below.

SAP stands for SIM Access Profile, so you have to disable it:

  • Open /etc/systemd/system/bluetooth.target.wants/bluetooth.service

  • Add "--noplugin=sap" at the end of the "ExecStart" Line: For example change-

      ExecStart=/usr/lib/bluetooth/bluetoothd
    

To

    ExecStart=/usr/lib/bluetooth/bluetoothd --noplugin=sap

Don't copy paste the above command directly! Just add "--noplugin=sap" at the end of the "ExecStart" line!

  • Reload the systemd:

      $ sudo systemctl daemon-reload
    
  • Restart the bluetooth:

      $ sudo service bluetooth restart
    
  • Get the bluetooth status:

      $ sudo service bluetooth status
    

    bluetooth.service - Bluetooth service Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled) Active: active (running) since Sat 2016-04-30 10:38:46 UTC; 6s ago Docs: man:bluetoothd(8) Main PID: 12775 (bluetoothd) Status: "Running" CGroup: /system.slice/bluetooth.service └─12775 /usr/lib/bluetooth/bluetoothd --noplugin=sap

Seamus
  • 23,558
  • 5
  • 42
  • 83
pylover
  • 740
  • 7
  • 9
19

NOTE:

This was a good answer at one time, but it appears that it may not work any longer. This is based on trying to cure the same problem posted in the OP's question - but on a bullseye system.

If you don't want to overwrite the system bluetooth.service file, it's a good place to use a .service.d override:

sudo mkdir  /etc/systemd/system/bluetooth.service.d/

Then place in this file:

/etc/systemd/system/bluetooth.service.d/01-disable-sap-plugin.conf

[Service]
ExecStart=
ExecStart=/usr/lib/bluetooth/bluetoothd --noplugin=sap
sudo systemctl daemon-reload
sudo systemctl restart bluetooth.service

Note: The double usage of ExecStart= in the SystemD bluetooth.service.d override file is important! The first line with empty assignment, "ExecStart=", clears out the value of ExecStart so we can override it later rather than append to it. This S.O. answer gives more detail. Some SystemD settings such as ExecStart behave as an appended list when specifying them multiple times. Many options that you want to override will apply to this use case when we use foo.service.d/*.conf files. So it's important to notice that an extra Foo= setting may be necessary to override a value rather than append to a list.

Seamus
  • 23,558
  • 5
  • 42
  • 83
TrinitronX
  • 299
  • 2
  • 6