A missing blog post image


For years now, I’ve been using Cinnamon as desktop environment on my (graphical) Debian-powered systems.
Whereas this might painfully and sadly change in the future, I still had have to manually turn off Bluetooth on startup, as somehow, this state does not persist across reboots, and this feature does not seem implemented by the Blueman applet.

The problem

It appears since BlueZ 5.35 (2015 !) that enabling or disabling daemon automatic startup is possible.

The thing is, even if you manually revert the Debian-packaged configuration enabling AutoStart, the Blueman applet will ensure Bluetooth is correctly turned on when bootstrapping, resulting in :

A missing blog post image

… and that makes sens, because we can expect the front-end to check whether the back-end is ready on startup. But that’s a problem if you want it to stay off (and shut up) unconditionally.

The workaround

The workaround is then to let the Bluetooth daemon automatically start with AutoStart set to true, but directly disabling the wireless device with rfkill.

Unlike many others, I usually prefer handling “system-related issues” with “system-related tools”, instead of cheap hooks messy to maintain and always ending up requiring unnecessary privileges.
Using systemd, we can easily implement this using unit overriding and built-in Service execution hooks :

systemctl edit bluetooth.service

… and insert the following :

ExecStartPost=/usr/sbin/rfkill block bluetooth

Note that we do not reset with an empty string ExecStartPost entry first, so if one day Debian-based distributions decide to add another hook like that, this workaround wouldn’t break a thing, and will always be run afterwards.

Last words

Shoot-out to Norbert Preining for maintaining all those pieces of software available in Debian, for all these years, including Cinnamon :pray: