起動時にBluetoothを再起動する

起動時にBluetoothを再起動する

コンピュータを起動するたびに(Pop!_OS 20.04)、Bluetoothサービスはrfkillによってソフトブロックされます。

Bluetoothマウスを操作するには、端末を開いてsudo systemctl restart bluetooth操作する必要があります。

毎回手動で行う必要がないようにsystemctlサービスを作成してみましたが、動作しません。

これはサービスです:

[Unit]
Description= restarting bluetooth service

[Service]
ExecStart=systemctl restart bluetooth

[Install]
WantedBy=multi-user.target

また、実行可能にして(sudo chmod u+x restart-bluetooth.service)有効にして起動しました。

sudo systemctl start restart-bluetooth.service
sudo systemctl enable restart-bluetooth.service

事前にありがとう

ベストアンサー1

今助けてこの問題を解決しました。まず端末を開き、次のコマンドを使用してsudoを作成します。

sudo -i
cd /etc/init.d

テキストエディタを使用して、次のように入力します。

sleep 10
systemctl restart bluetooth.service

このスクリプトを次のように保存しますBLUETOOTHFIX.sh。その後、端末の実行を有効にします。

chmod 755 /etc/init.d/BLUETOOTHFIX.sh
chmod +x /etc/init.d/BLUETOOTHFIX.sh
ln -s /etc/init.d/BLUETOOTHFIX.sh /etc/rc3.d/S99BLUETOOTHFIX.sh

おすすめ記事