Results 1 to 10 of 10

Thread: Disable Bluetooth forever? 16.04

  1. #1
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Disable Bluetooth forever? 16.04

    https://help.ubuntu.com/16.04/ubuntu...rn-on-off.html

    Explains how to disable it manually in the GUI. I´m seeking a way to disable it forever since being hacked through an unused bluetooth connection previously. I don´t and have never used bluetooth. To me, seems like an added security risk.

    Would be nice if the documentation covered this scenario too, BTW.

    I suspect the answer will be related to systemd. Tried
    Code:
      sudo systemctl stop bluetooth
      sudo systemctl disable bluetooth
    status returns:
    Code:
    $ sudo systemctl status bluetooth
    �� bluetooth.service - Bluetooth service
       Loaded: loaded (/lib/systemd/system/bluetooth.service; disabled; vendor preset: enabled)
       Active: active (running) since Tue 2016-05-31 13:01:13 EDT; 5min ago
         Docs: man:bluetoothd(8)
     Main PID: 8548 (bluetoothd)
       Status: "Running"
       CGroup: /system.slice/bluetooth.service
               ������8548 /usr/lib/bluetooth/bluetoothd
    
    May 31 13:01:13 cc3550 bluetoothd[8548]: Not enough free handles to register service
    May 31 13:01:13 cc3550 bluetoothd[8548]: Not enough free handles to register service
    May 31 13:01:13 cc3550 bluetoothd[8548]: Current Time Service could not be registered
    May 31 13:01:13 cc3550 bluetoothd[8548]: gatt-time-server: Input/output error (5)
    May 31 13:01:13 cc3550 bluetoothd[8548]: Not enough free handles to register service
    May 31 13:01:13 cc3550 bluetoothd[8548]: Not enough free handles to register service
    May 31 13:01:13 cc3550 bluetoothd[8548]: Sap driver initialization failed.
    May 31 13:01:13 cc3550 bluetoothd[8548]: sap-server: Operation not permitted (1)
    May 31 13:01:13 cc3550 bluetoothd[8548]: Endpoint registered: sender=:1.47 path=/MediaEndpoint/A2DPSource
    May 31 13:01:13 cc3550 bluetoothd[8548]: Endpoint registered: sender=:1.47 path=/MediaEndpoint/A2DPSink
    and the service is still running.


    TIA.
    Last edited by TheFu; May 31st, 2016 at 06:07 PM.

  2. #2
    Join Date
    Feb 2015
    Location
    United States
    Beans
    Hidden!
    Distro
    Ubuntu Studio

    Lightbulb Re: Disable Bluetooth forever? 16.04

    What you can do is use gedit or mousepad or leafpad or geany or whatnot to edit and create an .override file.
    Use the terminal console:

    sudo gedit /etc/init/bluetooth.override

    when the blank document opens up, just type on one line:

    manual

    ...and then save the file.
    The file should be "/etc/init/bluetooth.override" and it should simply contain one line with the word "manual" in it.
    Then log out and restart the computer and bluetooth should be disabled.

    If you later want to get bluetooth back, just "sudo rm /etc/init/bluetooth.override" from a terminal console.

    In the "/etc/init/" folder, you can find lots of .conf configuration files. If you want to disable something else, the procedure is pretty much the same...
    create an .override file (containing just the word "manual") corresponding to the .conf file and service you want to disable. For example, apport.override

    Also, check in "/etc/xdg/autostart/" to see if anything about bluetooth is in there too. If it is, create a folder "/etc/xdg/autostart-disabled" and move the
    bluetooth-related .desktop file into that to disable it from autostarting.

    I hope this is helpful.
    May Peace Prevail for Life in all Realms of Creation --Masahisa Goi

  3. #3
    Join Date
    Jun 2005
    Beans
    Hidden!

    Re: Disable Bluetooth forever? 16.04

    I have always just edited /etc/rc.local
    Like this
    Code:
    sudo nano /etc/rc.local
    add this line before exit 0

    Code:
    rfkill block bluetooth
    Screens Before and After and it works for Xenial also.
    Code:
    $ sudo systemctl status bluetooth
    ● bluetooth.service - Bluetooth service
       Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset
       Active: inactive (dead)
    Condition: start condition failed at Tue 2016-05-31 11:39:12 MDT; 1h 17min ago
               ConditionPathIsDirectory=/sys/class/bluetooth was not met
    Hope this helpful
    Kind Regards
    Attached Images Attached Images
    Last edited by QDR06VV9; May 31st, 2016 at 08:01 PM.

  4. #4
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: Disable Bluetooth forever? 16.04

    I am not yet using 16.04 but in the past I have used bum (Boot Up Manager) to remove services at boot and stop them running.

    You could also remove bluetooth from the machine, but take care as some of the bluetooth libraries are dependencies of other packages that you probably do want to keep.

  5. #5
    Join Date
    Jun 2005
    Beans
    Hidden!

    Re: Disable Bluetooth forever? 16.04

    I´m seeking a way to disable it forever since being hacked through an unused bluetooth connection previously. I don´t and have never used bluetooth. To me, seems like an added security risk.

    Would be nice if the documentation covered this scenario too, BTW.
    I just stopped it by editing "/lib/systemd/system/bluetooth.service"
    Code:
    sudo nano /lib/systemd/system/bluetooth.service
    Then I commented out "ExecStart=/usr/lib/bluetooth/bluetoothd "
    So it now looks like this

    Code:
    [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
    
    [Install]
    WantedBy=bluetooth.target
    Alias=dbus-org.bluez.service
    Now it shows in the terminal
    Code:
    ~$ sudo systemctl status bluetooth
    [sudo] password for me: 
    ● bluetooth.service - Bluetooth service
       Loaded: error (Reason: Invalid argument)
       Active: inactive (dead)
    Maybe more what you are after
    I have an old friend tell me that this works also but i had already made my changes so I duno for sure...check it out if you want or just to verify.
    Code:
    sudo "echo 'manual' > /etc/init/bluetooth.override"
    I'll be curious.
    Last edited by QDR06VV9; May 31st, 2016 at 09:25 PM.

  6. #6
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Disable Bluetooth forever? 16.04

    Thanks guys!

    The override - assuming it works - is the way to go. Already had that w/ the ¨manual¨ inside, but I hadn´t rebooted. Generally only reboot when a new kernel requires it.

    Had a number of things setup by the installer (mate as the GUI) that I don´t want - set those to manual and removed them from the autostart. Is the autostart-disabled a special directory or just a smart name? For example, could I use a autostart/disabled/ instead and would that work equally well?

    I was under the impression that rc.local wasn´t being called with systemd ... haven´t migrated any of my servers over to 16.04 or created any new servers yet to know. There isn´t any reference to it inside /etc/init/, but there is in the old /etc/init.d/ - hopefully that is all backwards compatible.

    Will someone be able to update the documentation to reflect the /etc/init/ and xdg/autostart stuff? Would be nice to have that solved for this release.

    BTW, sudo gedit (or more GUI editors) can have undesirable side effects. There was an entire discussion in these forums about a year ago. sudoedit was proposed as a solution. The other was to use policy-kit.

    Anyway - thanks for the pointers. I´ll reboot in a sec and post back.

  7. #7
    Join Date
    May 2014
    Location
    /home
    Beans
    10,929
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Disable Bluetooth forever? 16.04

    Another option would be to blacklist the btusb module as it is used in one way or another with any bluetooth chip I have ever used
    Code:
    echo "blacklist btusb" | sudo tee -a /etc/modprobe.d/bluetooth-blacklist.conf

  8. #8
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Disable Bluetooth forever? 16.04

    Just to confirm that the /etc/init/bluetooth.override worked.

  9. #9
    Join Date
    Jun 2005
    Beans
    Hidden!

    Re: Disable Bluetooth forever? 16.04

    Nice and thanks for the conformation. And also pointing out using "sudo" with any GUI is highly discouraged.
    Cheers

  10. #10
    Join Date
    May 2008
    Beans
    173

    Re: Disable Bluetooth forever? 16.04

    Quote Originally Posted by TheFu View Post
    I was under the impression that rc.local wasn´t being called with systemd ... haven´t migrated any of my servers over to 16.04 or created any new servers yet to know.
    I've been using rc.local in my 16.04 system and it appears to be working OK.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •