태그 보관물: daemons

daemons

명령 줄에서 Bluetooth 서비스를 다시 시작하는 방법 경우 간단히 터미널을

Linux에서 Bluetooth 서비스를 다시 시작하려는 경우 간단히 터미널을 시작하고 다음 명령을 실행하십시오.

sudo /etc/init.d/bluetooth restart

Mac OS X에 해당하는 것은 무엇입니까? 전체 컴퓨터를 다시 시작하지 않고 Bluetooth를 다시 시작하고 싶습니다.

사용하고 Yosemite있습니다.

업데이트 : Testing에서 제공하는 다양한 명령 행 옵션 중 작동하는 것으로 보이는 유일한 옵션은 다음과 같습니다.

sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport

업데이트 2 : 위의 명령이 더 이상 작동하지 않으며 그랬는지 궁금합니다. 처음 시도했을 때 블루투스 서비스를 다시 시작한 것일 수 있습니다. 나에게 도움이되는 유일한 것은 매일 아침 전체 컴퓨터를 다시 시작하는 것입니다.



답변

High Sierra에서는 어떤 명령 줄 옵션도 효과가 없었습니다. 유선 USB 마우스를 꽂고 Shift + Option을 Debug / Rest 솔루션과 함께 사용할 수있었습니다.

High Sierra에서 blueutil 솔루션을 사용해 보니 매력처럼 작동했습니다. Apple Magic Mouse 호스를 사용하여 2015 MBPR에서 Bluetooth를 정기적으로 사용하고 다시 시작해야합니다. 예, 뚜껑을 열고 트랙 패드를 사용할 수는 있지만 책상 공간에서 벽 반대편에 있습니다.

Homebrew를 사용하여 blueutil 을 설치할 수 있습니다 .

brew install blueutil

또는 다음을 사용하여 직접 컴파일하고 설치할 수 있습니다.

cd ~/tmp/
git clone https://github.com/toy/blueutil.git
cd blueutil
make
make test
cp blueutil ~/bin/

이제 다음을 실행하십시오.

blueutil -p 0 && sleep 1 && blueutil -p 1


답변

El Capitan에서는 시스템 서비스를 언로드 할 수 없기 때문에 까다 롭습니다. 그러나 무차별 강제 방법은 다음과 같습니다.
sudo pkill blued
‘blued’는 OS X 블루투스 데몬이며 종료되면 (적어도 El Capitan 컴퓨터에서 테스트했을 때) 자동으로 다시 시작됩니다. 다른 관련 데몬은 다음과 같습니다. com.apple.bluetoothReporter, com.apple.IOBluetoothUSBDFU 및 com.apple.bluetoothaudiod (를 사용하여 실행되는 데몬을 볼 수 있음 sudo launchctl list)

시도해 볼 수도 있습니다 :

sudo launchctl stop com.apple.blued
sudo launchctl start com.apple.blued

이전 OS X 버전이 있다면 더 깨끗합니다.

sudo launchctl unload /System/Library/LaunchDaemons/com.apple.blued.plist
sudo launchctl load /System/Library/LaunchDaemons/com.apple.blued.plist

또는

sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport


답변

한 가지 언급 할 것은 데몬 이름 blued (적어도 macOS 10.11 El Capitan까지)가 bluetoothd 로 변경되었다는 것 입니다.

따라서 macOS 버전에 따라 아래 명령에서 데몬 이름을 변경해야합니다.

주목해야 할 또 다른 사항은 El Capitan에 도입 된 SIP (System Integrity Protection)로 인해 데몬의 plist를 언로드 한 다음로드하는 것입니다 (정지 한 다음 시작 또는 HUP 신호 전송 대신)가 작동하지 않을 수 있습니다. 그러나 El Capitan 이전에 SIP를 비활성화하거나 macOS에서 작동해야합니다.

$ sudo launchctl unload /System/Library/LaunchDaemons/com.apple.blued.plist
$ sudo launchctl load /System/Library/LaunchDaemons/com.apple.blued.plist

SIP 환경 (El Capitan 이후)에서도 간단히 ctctl stop시작한 다음 launchctl을 사용 하여 데몬을 시작할 수 있습니다 .

$ sudo launchctl stop com.apple.bluetoothd # or blued based on macOS version
$ sudo launchctl start com.apple.bluetoothd

데몬을 실제로 다시 시작하지 않고 블루투스의 상태 (on | off)를 변경하려는 경우 다음을 수행 할 수 있습니다.

# Let bluetooth be on
$ sudo defaults write
/Library/Preferences/com.apple.Bluetooth ControllerPowerState -int 1

# let bluetooth be off
$ sudo defaults write
/Library/Preferences/com.apple.Bluetooth ControllerPowerState -int 0

# Then reload the daemon
$ sudo killall -HUP bluetoothd # or blued based on macOS version
# On a macOS system which has proctools installed, you can replace `killall` to `pkill`

Blueutil은 멋진 기능이지만 IOBluetooth.framework의 일부 개인 API를 사용 하므로 향후 버전의 macOS에서는 작동하지 않을 수 있습니다.


답변

이 타사 명령 줄 도구는 OSX 버전의 차이점을 추상화하여 High Sierra까지 완벽하게 작동하는 것 같습니다. https://github.com/toy/blueutil


답변

sudo pkill bluetoothd

macOS High Sierra에서 작동합니다. Logitech mx는 수면 후 가끔 작동하지 않습니다. 마우스 때문에 읽지 않은 것은 macOS Smart Bluetooth 버그입니다. 그러나 내 Apple 키보드는 항상 작동하지만이 문제는 발생하지 않았습니다. 때로는 컴퓨터를 깨울 때 Apple 키보드는 작동하지만 Logitech 마우스는 작동하지 않습니다. 따라서 마우스가 없으면 시스템에서 블루투스를 다시 시작할 수 없습니다 (닫을 수는 있지만 키보드도 사라져 다시 시작할 수 없습니다) 터미널 에서이 명령을 사용하기 시작하면 서비스가 중지되지만 서비스가 중지되면 자동으로 자체 재시작됩니다. . 그리고 내 마우스가 1 초 안에 작동하기 시작합니다!


답변

macOS High Sierra 10.13.6이 설치된 Macbook Pro 2017의 경우 다음 bash 스크립트를 사용하여 블루투스를 다시 시작합니다.

#!/bin/bash

sudo launchctl stop com.apple.bluetoothd
sudo launchctl start com.apple.bluetoothd


답변

저에게 도움이되는 명령으로 GitHub Gist 에서이 페이지 를 찾았 습니다 (요세미티 v. 10.10.5를 실행 중입니다). 터미널에 다음을 입력하여 다시 시작하지 않고 블루투스 데몬을 다시 시작할 수 있습니다.

sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport

sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport