16

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:~ $
  • sap in this context seems to be SIM access protocol and thus is likely to be something to do with connecting to a mobile phone (and presumably internet data). Given that all the other messages are about a successful start-up of the bluetooth daemon I'm not entirely sure that is an error as such...? – SlySven Jan 10 '16 at 12:37
24

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

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

    ExecStart=/usr/lib/bluetooth/bluetoothd
    

    To

    ExecStart=/usr/lib/bluetooth/bluetoothd --noplugin=sap
    
  • 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
    
  • 2
    If you like to stick with systemctl, it can also do systemctl restart bluetooth and systemctl status bluetooth. Those probably also need sudo. – XTL Sep 26 '16 at 19:42
  • 1
    In most of web tutorials and solutions, we do not write the sudo for safety. i assume the linux users are already knowing about privileges. but here is no problem, tanks, i'll add those sudo's. – pylover Sep 26 '16 at 21:12
  • Works ok, once, then I find out that the file that need to be addressed is (also) /lib/systemd/system/bluetooth.service – fcm Aug 12 '17 at 22:02
  • Why isn't this disabled by default? – Sawtaytoes Jul 6 at 4:13
  • I don't know why. the Linux audio is so complicated. – pylover Jul 6 at 17:52
0

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
  • I think it is better to use sudo systemctl edit bluetooth.service instead of fiddling direct with systemd directories and files. – Ingo Jun 25 at 14:47
  • Yeah, good suggestion. It's a an easy way to do the same thing above. Sometimes it helps to rename the .d/ file snippet to clarify what it's doing. – TrinitronX Jun 26 at 17:18
  • 1
    Mainly it's a safer way doing this under control of systemd? – Ingo Jun 26 at 17:22
  • @Ingo: Yeah it's another feature of newer SystemD versions. There are some cases where you may not want to do this, like for example: editing a production .service file is risky. This blog post has more helpful info. One of the things mentioned there is "All successful editing converts into a service restart!" So it's not always "safer" as you say, but it could be more convenient. – TrinitronX Jun 27 at 21:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.