在系统启动时停用蓝牙的最佳方法? (使用systemd而非upstart)

使用systemd为每次启动停用蓝牙的最佳方法是什么? 有很多例子,但它们都与upstart和rc.local一起使用。

使用Ubuntu 15.10,默认情况下禁用rc.local。 我认为这是有原因的,或者不是吗?

那么如何在没有rc.local脚本的情况下正确停用蓝牙目标/服务?

也许重新激活rc.local添加行“rfkill block bluetooth”是正确的方法吗?

首先,停止服务:

sudo systemctl stop bluetooth.service 

然后,禁用它:

 sudo systemctl disable bluetooth.service 

校验:

 systemctl status bluetooth.service 

上面的大多数方法完全禁用蓝牙,而许多用户可能只希望他们的操作系统记住他们的偏好。 问题是blueman-applet具有自动开机设置,每次指示灯启动时都会自动启用蓝牙。 因此,如果您希望Ubuntu记住您的偏好,请打开终端并输入以下内容:

 $ gsettings set org.blueman.plugins.powermanager auto-power-on false 

这样您就可以禁用蓝牙,操作系统会记住它,并且下次打开或重启PC时不会自动重新启用它。

要禁用它,以便它永远不会尝试重新启动( 因为其他应用程序可能会在您禁用它之后尝试启动它并且在日志日志中显示错误 )停止和禁用后,您可以sudo systemctl mask dbus-org.bluez.service ,这将符号链接指向/ dev / null。 要恢复它sudo systemctl unmask dbus-org.bluez.service systemd中的sudo systemctl unmask dbus-org.bluez.servicehttps://www.ibm.com/support/knowledgecenter/SSNW54_1.1.1/com.ibm.kvm.v111.admin/hpssdisabling.htm