PDA

View Full Version : [ubuntu] Disable bluetooth at startup with gnome-bluetooth



Axx83
December 28th, 2009, 10:05 PM
Hi. I'm using Ubuntu 9.10 Karmic and since the bluetooth in my notebook works perfectly with the gnome-bluetooth applet, especially turning it on and off, I'd like to issue at startup the command that the applet issue every time it's used. Currently the system turns bluetooth on at each restart not remembering its last status and I see no other way around then my eventual solution.

Thanks

Axx83
December 29th, 2009, 11:03 AM
Guys, any help ?

darius.k
December 29th, 2009, 03:10 PM
I was looking for a solution for this as well. I didn't find one.
It's annoying to have to turn off bluetooth every time you boot and don't use it. And if your forget it sucks on your laptop batteries.

Maybe open a bug for this at launchpad?

Axx83
December 29th, 2009, 07:29 PM
Sure it might be a very good idea, but I guess there's already more than one open on this subject

carimbonon
March 24th, 2010, 02:20 AM
I could not find any graphical method so I had to do it this way:
First ALWAYS backup configuration files ! !

sudo cp /etc/bluetooth/main.conf /etc/bluetooth/main.conf.OLDonce backed up edit main.conf file

sudo nano /etc/bluetooth/main.confInside main.conf look for entry:

InitiallyPowered = trueand change the value to false

Save with Ctrl+X and restart GDM to see the effect :

/etc/init.d/gdm restartRemember to save any file in use before restarting the graphical session

I have read this tutorial (https://help.ubuntu.com/community/BluetoothSetup) but seems a little bit out of date.

Axx83
March 24th, 2010, 12:40 PM
Thanks carimbonon ! That works perfectly ;-)

lostthetrail
June 19th, 2010, 11:36 PM
Thank you for the great solution, but...

gnome-bluetooth doesn't seem to recognize that I have changed this value and always shows that I have bluetooth enabled. Anyone find a way to solve this problem that will have the applet reporting correctly as well?

wagalaweia
July 28th, 2011, 03:19 PM
According to https://bugs.launchpad.net/ubuntu/+source/bluez/+bug/381913 there is the problem that the entries InitiallyPowered and RememberPowered seem to be ignored (or perhaps overwritten by some other settings). However, there is mentioned a workaround, which works in ubuntu 11.04 and very likely elsewhere, too:

Calling from the commandline...

rfkill block bluetooth...disables bluetooth in the same way, as a click on 'decativate' does. You can then manually enable/disable it later.

So, it is a good idea to just add the above command to your .profile file in your home-directory, then the bluetooth manager gets loaded, but deactivated on each startup.

lvanderree
October 15th, 2011, 02:11 PM
Thanks, rfkill block bluetooth seems to do the trick!

Lupius
November 22nd, 2011, 04:11 AM
So how do you manually start up bluetooth after disabling it?

Axx83
November 22nd, 2011, 11:13 AM
By clicking on the bluetooth icon, upper right of the screen

Lupius
November 24th, 2011, 10:22 PM
I disabled my bluetooth so hard that there's no bluetooth icon there anymore, and I can't remember what I did to make it go away...

lvanderree
November 28th, 2011, 07:13 PM
I disabled my bluetooth so hard that there's no bluetooth icon there anymore, and I can't remember what I did to make it go away...

Hard to say, only thing I can think of right now, with no information at all is that you might have disabled the entire bluetooth module in /etc/modprobe.d/blacklist.conf ?

I have these modules loaded:



$ modprobe -l | grep -i blue



kernel/drivers/platform/x86/toshiba_bluetooth.ko
kernel/drivers/bluetooth/hci_vhci.ko
kernel/drivers/bluetooth/hci_uart.ko
kernel/drivers/bluetooth/bcm203x.ko
kernel/drivers/bluetooth/bpa10x.ko
kernel/drivers/bluetooth/bfusb.ko
kernel/drivers/bluetooth/dtl1_cs.ko
kernel/drivers/bluetooth/bt3c_cs.ko
kernel/drivers/bluetooth/bluecard_cs.ko
kernel/drivers/bluetooth/btuart_cs.ko
kernel/drivers/bluetooth/btusb.ko
kernel/drivers/bluetooth/btsdio.ko
kernel/drivers/bluetooth/ath3k.ko
kernel/drivers/bluetooth/btmrvl.ko
kernel/drivers/bluetooth/btmrvl_sdio.ko
kernel/drivers/bluetooth/btwilink.ko
kernel/net/bluetooth/bluetooth.ko
kernel/net/bluetooth/rfcomm/rfcomm.ko
kernel/net/bluetooth/bnep/bnep.ko
kernel/net/bluetooth/cmtp/cmtp.ko
kernel/net/bluetooth/hidp/hidp.ko


But you should always be able to find the bluetooth icon in the system settings

something else you can check is, if the bluetooth service is running:


$ service bluetooth status



* bluetooth is running


if it is not running, and you have bluetooth modules, you should probably be able to simply start the service, or check your log /var/log/syslog or dmesg and find errors.

ceoxtc
December 4th, 2011, 06:27 PM
So how do you manually start up bluetooth after disabling it?

$ rfkill unblock bluetooth

(Or just right-click on the applet in the tray and turn it on.)

pbanerjee
December 8th, 2011, 05:31 AM
Hard to say, only thing I can think of right now, with no information at all is that you might have disabled the entire bluetooth module in /etc/modprobe.d/blacklist.conf ?

I have these modules loaded:



$ modprobe -l | grep -i blue

kernel/drivers/platform/x86/toshiba_bluetooth.ko
kernel/drivers/bluetooth/hci_vhci.ko
kernel/drivers/bluetooth/hci_uart.ko
kernel/drivers/bluetooth/bcm203x.ko
kernel/drivers/bluetooth/bpa10x.ko
kernel/drivers/bluetooth/bfusb.ko
kernel/drivers/bluetooth/dtl1_cs.ko
kernel/drivers/bluetooth/bt3c_cs.ko
kernel/drivers/bluetooth/bluecard_cs.ko
kernel/drivers/bluetooth/btuart_cs.ko
kernel/drivers/bluetooth/btusb.ko
kernel/drivers/bluetooth/btsdio.ko
kernel/drivers/bluetooth/ath3k.ko
kernel/drivers/bluetooth/btmrvl.ko
kernel/drivers/bluetooth/btmrvl_sdio.ko
kernel/drivers/bluetooth/btwilink.ko
kernel/net/bluetooth/bluetooth.ko
kernel/net/bluetooth/rfcomm/rfcomm.ko
kernel/net/bluetooth/bnep/bnep.ko
kernel/net/bluetooth/cmtp/cmtp.ko
kernel/net/bluetooth/hidp/hidp.ko
But you should always be able to find the bluetooth icon in the system settings

something else you can check is, if the bluetooth service is running:


$ service bluetooth status

* bluetooth is running
if it is not running, and you have bluetooth modules, you should probably be able to simply start the service, or check your log /var/log/syslog or dmesg and find errors.

I have Lucid Lynx 10.04 running Toshiba laptop with built in bluetooth v3.
When I run modprob as suggested by you, I don't get the first line of the output that you got.. the Toshiba driver for bluetooth. Below is what I get:
---------------------------------------------------------------------
pbanerjee@pbanerjee-laptop:~$ modprobe -l | grep -i blue
kernel/drivers/bluetooth/hci_vhci.ko
kernel/drivers/bluetooth/hci_uart.ko
kernel/drivers/bluetooth/bcm203x.ko
kernel/drivers/bluetooth/bpa10x.ko
kernel/drivers/bluetooth/bfusb.ko
kernel/drivers/bluetooth/dtl1_cs.ko
kernel/drivers/bluetooth/bt3c_cs.ko
kernel/drivers/bluetooth/bluecard_cs.ko
kernel/drivers/bluetooth/btuart_cs.ko
kernel/drivers/bluetooth/btusb.ko
kernel/drivers/bluetooth/btsdio.ko
kernel/drivers/bluetooth/btmrvl.ko
kernel/drivers/bluetooth/btmrvl_sdio.ko
kernel/net/bluetooth/bluetooth.ko
kernel/net/bluetooth/l2cap.ko
kernel/net/bluetooth/sco.ko
kernel/net/bluetooth/rfcomm/rfcomm.ko
kernel/net/bluetooth/bnep/bnep.ko
kernel/net/bluetooth/cmtp/cmtp.ko
kernel/net/bluetooth/hidp/hidp.ko
pbanerjee@pbanerjee-laptop:~$
---------------------------------------------------------------------

Any idea why I don't see the bluetooth module for Toshiba ?
Thanks in advance.

spielball
December 22nd, 2011, 09:13 PM
I use Ubuntu 11.10

And the following does the trick for me to disable bluetooth by default on startup/boot, but still keeping the icon in the top panel:

Open your /etc/rc.local file:


sudo gedit /etc/rc.localAdd the following line before all other commands:


rfkill block bluetoothThen you have something like this:


#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

rfkill block bluetooth
exit 0
Save the file.

After reboot, your bluetooth should be disabled. But you can still re-enable it when needed by using the icon in the top bar.

SpindizZzy
January 10th, 2012, 05:07 PM
Well, spielball, i tried your solution and the upper right corner icon DOES indeed indicate that bluetooth is off, but when i open a terminal right after bootup and check 'service bluetooth status' i get :

* bluetooth is running :confused:

So i guess the graphical interface 'thinks' that BT is down, but processes are still running... Is this possible ?


EDIT: I looked here: http://ubuntuforums.org/showthread.php?t=1768170 , and Howefield's solution (post # 7) removes the graphical BT-icon. That, along with this http://ubuntuforums.org/showthread.php?t=1897021&highlight=disable+bluetooth+startup (post # 3) did the trick for me. When i boot now and check status in terminal, i get
* bluetooth is not running

Next question: how to enable it when i need it ?

Syock
August 31st, 2012, 06:01 AM
* bluetooth is running :confused:

So i guess the graphical interface 'thinks' that BT is down, but processes are still running... Is this possible ?

"bluetooth is running" refers to the bluetooth service, which stars the daemon (the program running in background). Even if you disable bluetooth via the applet, it should still be running. If you set BLUETOOTH_ENABLED=0, the bluetooth service won't start at all, on you won't be able to turn on bluetooth via the applet, unless you start the daemon by yourself (and if you try to start the service, it will mention about BLUETOOTH_ENABLED=0 and refuse to start)