10

What is the best way to deactivate Bluetooth for every startup with systemd? There are a lot of examples, but all of them work with upstart and rc.local.

With Ubuntu 15.10 rc.local is disabled by default. I think it's for a reason, or isn't it?

So how can I deactivate the Bluetooth target/service correctly without the rc.local script?

Maybe reactivate rc.local an add the line "rfkill block bluetooth" is the proper way?

Metro
  • 103

4 Answers4

27

First, stop the service:

sudo systemctl stop bluetooth.service

Then, disable it:

sudo systemctl disable bluetooth.service

Check:

systemctl status bluetooth.service
David Foerster
  • 36,264
  • 56
  • 94
  • 147
11

Most of the methods above totally disable bluetooth, while probably many users just want their OS to remember their preference. The problem is that blueman-applet has an auto-power-on setting that automatically enables bluetooth each time the indicator starts. So if you you want Ubuntu to remember your preference open a terminal and type this:

$ gsettings set org.blueman.plugins.powermanager auto-power-on false

This way you can just disable bluetooth and the OS will remember it and won't automatically re-enable it next time you turn on or reboot your PC.

  • 1
    Thanks! exactly what I needed! A way to make it stop being on everytime, but leave it easy re-enable it. – yinon Sep 07 '17 at 10:11
4

To disable it so it never tries to restart (as other apps may be trying to start it after you've disabled it and will show up with errors in the journal log) after stopping and disabling, you can sudo systemctl mask dbus-org.bluez.service, this points the symlink to /dev/null. To restore it sudo systemctl unmask dbus-org.bluez.service in systemd. https://www.ibm.com/support/knowledgecenter/SSNW54_1.1.1/com.ibm.kvm.v111.admin/hpssdisabling.htm

Vince
  • 41
  • I gave +1 because my system kept showing errors at startup and I could not get them to stop, until I found this advice. – pauljohn32 Sep 10 '16 at 02:33
3

Edit the bluetooth configuration file and set AutoEnable to false to disable bluetooth on boot.

sudo gedit /etc/bluetooth/main.conf

At the end of the file

AutoEnable=false

Dohd
  • 201