You are not logged in.

#1 2012-08-15 11:49:32

Onyros
Member
From: Lisbon, Portugal
Registered: 2007-10-11
Posts: 307

[SOLVED] Disabling Bluetooth on boot with systemd

I'm having a nasty-won't-go-away problem with the disabling of the bluetooth module in my Thinkpad X200s.

Resorting to the old Arch way of disabling bluetooth on boot, I added this to my rc.local:

/bin/echo 0 > /sys/devices/platform/thinkpad_acpi/bluetooth_enable

The thing is, this somehow made my boots hit'n'miss: kernel panics every two boots. As soon as I commented that line from my rc.local... no more kernel panics at boot.

I was still using an rc.conf just with daemons, and in troubleshooting the kernel panics got rid of it and used the systemd way of enabling/disabling services. My problem here is that the bluetooth service seems to be impossible to disable.

I first tried the good ol'

systemctl disable bluetooth.service

Which supposedly disabled bluetooth... but didn't. Even

systemctl stop bluetooth.service

Does not work.

Digging around the interwebs, I found that there are "stronger" ways to disable services with systemd, meaning "masking" services - basically links them to /dev/null

So, I tried masking the bugger...

systemctl mask bluetooth.service

Reboot and... the damn bluetooth is still enabled. Only way that works is to echo 0 > /sys/devices/platform/thinkpad_acpi/bluetooth_enable... but I can't do it at boot with rc.local, otherwise I'll get the kernel panics again.

Any ideas?

Last edited by Onyros (2012-08-15 13:10:35)

Offline

#2 2012-08-15 11:58:28

bzt
Member
From: Germany
Registered: 2010-04-11
Posts: 39

Re: [SOLVED] Disabling Bluetooth on boot with systemd

Have you tried using rfkill and putting

rfkill block bluetooth

in your rc.local?

Offline

#3 2012-08-15 12:50:02

Onyros
Member
From: Lisbon, Portugal
Registered: 2007-10-11
Posts: 307

Re: [SOLVED] Disabling Bluetooth on boot with systemd

Just tried it and... bam!, kernel panic on the next boot. I really want to avoid having to use rc.local, somehow it seems to collide with systemd's management of services and cause those kernel panics. I thought about incorporating the first solution I had on my startup script for DWM, but there must be a cleaner solution.

Offline

#4 2012-08-15 12:50:58

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED] Disabling Bluetooth on boot with systemd

Onyros wrote:

I'm having a nasty-won't-go-away problem with the disabling of the bluetooth module in my Thinkpad X200s.

Resorting to the old Arch way of disabling bluetooth on boot, I added this to my rc.local:

/bin/echo 0 > /sys/devices/platform/thinkpad_acpi/bluetooth_enable

The thing is, this somehow made my boots hit'n'miss: kernel panics every two boots. As soon as I commented that line from my rc.local... no more kernel panics at boot.

I was still using an rc.conf just with daemons, and in troubleshooting the kernel panics got rid of it and used the systemd way of enabling/disabling services. My problem here is that the bluetooth service seems to be impossible to disable.

I first tried the good ol'

systemctl disable bluetooth.service

Which supposedly disabled bluetooth... but didn't.

It disables the bluetooth service which is very different from what your write to sysfs accomplishes. Don't you really just want to blacklist the bluetooth module? Your post is a bit hard to follow...

Offline

#5 2012-08-15 13:02:50

Onyros
Member
From: Lisbon, Portugal
Registered: 2007-10-11
Posts: 307

Re: [SOLVED] Disabling Bluetooth on boot with systemd

Absolute brainfart. You're right, falconindy: I mixed disabling the hardware with disabling the service. Hard set of days, too much work.

I will blacklist the bluetooth module - which wouldn't be necessary if one could just disable the thing in the BIOS.

Offline

Board footer

Powered by FluxBB