我尝试创建一个文件 /etc/udev/rules.d/97-bluetooth-input.rules,其中包含以下内容:
KERNEL=="event*", SUBSYSTEM=="bluetooth", DEVPATH=="/devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7.1/1-7.1.3/1-7.1.3:1.0/bluetooth/hci0", ACTION=="add", RUN+="/usr/bin/systemctl restart bluetooth.service"
我也尝试省略 DEVPATH,但似乎没有任何作用。
更改后,我确实sudo udevadm control -R
拔下了加密狗并重新插入,但蓝牙服务并未重新启动。
udevadm monitor -u
当我插入加密狗时,我看到以下内容:
UDEV [456580.937864] add /devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7.1/1-7.1.3 (usb)
UDEV [456580.942751] add /devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7.1/1-7.1.3/1-7.1.3:1.0 (usb)
UDEV [456580.943739] add /devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7.1/1-7.1.3/1-7.1.3:1.1 (usb)
UDEV [456580.945729] add /devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7.1/1-7.1.3/1-7.1.3:1.2 (usb)
UDEV [456580.947046] add /devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7.1/1-7.1.3/1-7.1.3:1.3 (usb)
UDEV [456580.948077] bind /devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7.1/1-7.1.3/1-7.1.3:1.1 (usb)
UDEV [456580.948187] add /devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7.1/1-7.1.3/1-7.1.3:1.0/bluetooth/hci0 (bluetooth)
UDEV [456580.949265] bind /devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7.1/1-7.1.3/1-7.1.3:1.2 (usb)
UDEV [456580.950853] add /devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7.1/1-7.1.3/1-7.1.3:1.0/bluetooth/hci0/rfkill38 (rfkill)
UDEV [456580.952866] bind /devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7.1/1-7.1.3/1-7.1.3:1.0 (usb)
UDEV [456580.954560] bind /devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7.1/1-7.1.3 (usb)
请问我遗漏了什么?