The bluez package fails to upgrade properly on my system, and would otherwise
give problems when booting on some systems:
Starting bluetooth:/etc/init.d/bluetooth: 199: cannot create /sys/class/rfkill/rfkill1/state: Directory nonexistent
invoke-rc.d: initscript bluetooth, action "start" failed.
The /etc/init.d/bluetooth script contains this line:
echo 1 >/sys/class/rfkill/rfkill1/state
This fails if that file does not exist, for example if there is no rfkill
function for a bluetooth device, or a bluetooth device is not plugged in when
booting, or if the bluetooth rfkill switch has a different name than rfkill1.
Also, there could be more than one bluetooth device, in which case not all of
them are switched on, or another device (a wifi card for example) could use
rfkill1, or maybe the user only wants to turn it on/off manually when
necessary. In short, I think it's a bad idea to try to write to rfkill state
files in the bluetooth init script.