2017-04-26 55 views
0

我試圖找到一種方法,在啓動時在Ubuntu 16.04禁用藍牙後不持續,單向我一直在網上絆倒時使用systemdsystemctl禁用name.service重啓

基本上

首先,停止服務:

須藤systemctl停止bluetooth.service

然後將其禁用:

須藤systemctl禁用藍牙。服務

檢查:

須藤systemctl狀態bluetooth.service

https://askubuntu.com/questions/744640/best-way-to-deactivate-bluetooth-on-system-startup-with-systemd-and-not-upstar

但每次我重新啓動它的背部上,我無法找到任何人在網上抱怨說,systemd禁用命令沒時間在我的情況下工作

即使在Ubuntu的維基上它說它應該工作我做錯了什麼?

https://wiki.ubuntu.com/SystemdForUpstartUsers

這裏是當我運行這些命令

[email protected]:~$ sudo systemctl stop bluetooth.service 
[sudo] password for mohamed: 
[email protected]:~$ sudo systemctl disable bluetooth.service 
Synchronizing state of bluetooth.service with SysV init with /lib/systemd/systemd-sysv-install... 
Executing /lib/systemd/systemd-sysv-install disable bluetooth 
insserv: warning: current start runlevel(s) (empty) of script `bluetooth' overrides LSB defaults (2 3 4 5). 
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `bluetooth' overrides LSB defaults (0 1 6). 
insserv: warning: current start runlevel(s) (empty) of script `bluetooth' overrides LSB defaults (2 3 4 5). 
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `bluetooth' overrides LSB defaults (0 1 6). 
[email protected]:~$ sudo systemctl status bluetooth.service 
● bluetooth.service - Bluetooth service 
    Loaded: loaded (/lib/systemd/system/bluetooth.service; disabled; vendor prese 
    Active: inactive (dead) since Wed 2017-04-26 19:56:04 AEST; 23s ago 
    Docs: man:bluetoothd(8) 
Main PID: 882 (code=exited, status=0/SUCCESS) 
    Status: "Quitting" 

Apr 26 19:42:19 mohamed-UX330UAK bluetoothd[882]: Endpoint registered: sender=:1 
Apr 26 19:42:19 mohamed-UX330UAK bluetoothd[882]: Endpoint registered: sender=:1 
Apr 26 19:42:19 mohamed-UX330UAK bluetoothd[882]: RFCOMM server failed for Heads 
Apr 26 19:42:34 mohamed-UX330UAK bluetoothd[882]: Endpoint unregistered: sender= 
Apr 26 19:42:34 mohamed-UX330UAK bluetoothd[882]: Endpoint unregistered: sender= 
Apr 26 19:56:04 mohamed-UX330UAK systemd[1]: Stopping Bluetooth service... 
Apr 26 19:56:04 mohamed-UX330UAK bluetoothd[882]: Terminating 
Apr 26 19:56:04 mohamed-UX330UAK bluetoothd[882]: Endpoint unregistered: sender= 
Apr 26 19:56:04 mohamed-UX330UAK bluetoothd[882]: Endpoint unregistered: sender= 
Apr 26 19:56:04 mohamed-UX330UAK systemd[1]: Stopped Bluetooth service. 
lines 1-17/17 (END)...skipping... 
● bluetooth.service - Bluetooth service 
    Loaded: loaded (/lib/systemd/system/bluetooth.service; disabled; vendor prese 
    Active: inactive (dead) since Wed 2017-04-26 19:56:04 AEST; 23s ago 
    Docs: man:bluetoothd(8) 
Main PID: 882 (code=exited, status=0/SUCCESS) 
    Status: "Quitting" 

Apr 26 19:42:19 mohamed-UX330UAK bluetoothd[882]: Endpoint registered: sender=:1 
Apr 26 19:42:19 mohamed-UX330UAK bluetoothd[882]: Endpoint registered: sender=:1 
Apr 26 19:42:19 mohamed-UX330UAK bluetoothd[882]: RFCOMM server failed for Heads 
Apr 26 19:42:34 mohamed-UX330UAK bluetoothd[882]: Endpoint unregistered: sender= 
Apr 26 19:42:34 mohamed-UX330UAK bluetoothd[882]: Endpoint unregistered: sender= 
Apr 26 19:56:04 mohamed-UX330UAK systemd[1]: Stopping Bluetooth service... 
Apr 26 19:56:04 mohamed-UX330UAK bluetoothd[882]: Terminating 
Apr 26 19:56:04 mohamed-UX330UAK bluetoothd[882]: Endpoint unregistered: sender= 
Apr 26 19:56:04 mohamed-UX330UAK bluetoothd[882]: Endpoint unregistered: sender= 
Apr 26 19:56:04 mohamed-UX330UAK systemd[1]: Stopped Bluetooth service. 
~ 
~ 
~ 
~ 
~ 
~ 
~ 
lines 1-17/17 (END)...skipping... 
● bluetooth.service - Bluetooth service 
    Loaded: loaded (/lib/systemd/system/bluetooth.service; disabled; vendor preset: enabled) 
    Active: inactive (dead) since Wed 2017-04-26 19:56:04 AEST; 23s ago 
    Docs: man:bluetoothd(8) 
Main PID: 882 (code=exited, status=0/SUCCESS) 
    Status: "Quitting" 

Apr 26 19:42:19 mohamed-UX330UAK bluetoothd[882]: Endpoint registered: sender=:1.79 path=/MediaEndpoint/A2DPSource 
Apr 26 19:42:19 mohamed-UX330UAK bluetoothd[882]: Endpoint registered: sender=:1.79 path=/MediaEndpoint/A2DPSink 
Apr 26 19:42:19 mohamed-UX330UAK bluetoothd[882]: RFCOMM server failed for Headset Voice gateway: rfcomm_bind: Address already in use (98) 
Apr 26 19:42:34 mohamed-UX330UAK bluetoothd[882]: Endpoint unregistered: sender=:1.43 path=/MediaEndpoint/A2DPSource 
Apr 26 19:42:34 mohamed-UX330UAK bluetoothd[882]: Endpoint unregistered: sender=:1.43 path=/MediaEndpoint/A2DPSink 
Apr 26 19:56:04 mohamed-UX330UAK systemd[1]: Stopping Bluetooth service... 
Apr 26 19:56:04 mohamed-UX330UAK bluetoothd[882]: Terminating 
Apr 26 19:56:04 mohamed-UX330UAK bluetoothd[882]: Endpoint unregistered: sender=:1.79 path=/MediaEndpoint/A2DPSource 
Apr 26 19:56:04 mohamed-UX330UAK bluetoothd[882]: Endpoint unregistered: sender=:1.79 path=/MediaEndpoint/A2DPSink 
Apr 26 19:56:04 mohamed-UX330UAK systemd[1]: Stopped Bluetooth service. 

回答

2

也許服務由依賴開始輸出。有一個third level of "off" with systemd,你可以嘗試,被稱爲「掩蔽」:

systemctl mask bluetooth.service 

一旦被屏蔽,服務不能在所有甚至手動啓動。你以後可以'揭露'它。