내 컴퓨터가 시작 시 특정 키보드 (1) 연결됨, (2) 연결 해제됨, (3) 특정 키보드를 감지하면 특정 스크립트를 실행하기를 원합니다.
이것은 장치입니다:
[rob@X200 vim]$ lsusb | grep keyb
Bus 005 Device 012: ID 04d9:1400 Holtek Semiconductor, Inc. PS/2 keyboard + mouse controller
.rules 파일은 다음과 같습니다.
[rob@X200 rules.d]$ cat 080-model-m.rules
ACTION=="add", ATTRS{idVendor}=="04d9", ATTRS{idProduct}=="1400", RUN+="/home/rob/home/scripts/caps-equals-super.sh"
ACTION=="remove", ATTRS{idVendor}=="04d9", ATTRS{idProduct}=="1400", RUN+="/home/rob/home/scripts/revert-keyboard-to-default.sh"
스크립트는 테스트를 거쳤으며 제대로 작동하지만 장치를 연결/분리할 때 트리거되지 않습니다.부팅 시 키보드가 감지되면 어떻게 스크립트를 트리거할지 잘 모르겠지만 일부 리소스가 준비될 때까지 스크립트를 실행하지 않도록 뭔가(systemd, udev?)에 지시해야 할 것 같습니다.
udevadm monitor -p
장치 플러그인은 다음과 같습니다 .
KERNEL[78150.293418] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1 (usb) ACTION=add BUSNUM=005 DEVNAME=/dev/bus/usb/005/014 DEVNUM=014 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1 DEVTYPE=usb_device MAJOR=189 MINOR=525 PRODUCT=4d9/1400/143 SEQNUM=2260 SUBSYSTEM=usb TYPE=0/0/0
KERNEL[78150.297188] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0 (usb) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0 DEVTYPE=usb_interface INTERFACE=3/1/1 MODALIAS=usb:v04D9p1400d0143dc00dsc00dp00ic03isc01ip01in00 PRODUCT=4d9/1400/143 SEQNUM=2261 SUBSYSTEM=usb TYPE=0/0/0
KERNEL[78150.315292] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0025 (hid) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0025 HID_ID=0003:000004D9:00001400 HID_NAME=HID 04d9:1400 HID_PHYS=usb-0000:00:1d.0-1/input0 MODALIAS=hid:b0003g0001v000004D9p00001400 SEQNUM=2262 SUBSYSTEM=hid
KERNEL[78150.315615] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0025/input/input44 (input) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0025/input/input44 EV=120013 KEY=1000000000007 ff9f207ac14057ff febeffdfffefffff fffffffffffffffe LED=7 MODALIAS=input:b0003v04D9p1400e0110-e0,1,4,11,14,k71,72,73,74,75,77,79,7A,7B,7C,7D,7E,7F,80,81,82,83,84,85,86,87,88,89,8A,8C,8E,96,98,9E,9F,A1,A3,A4,A5,A6,AD,B0,B1,B2,B3,B4,B7,B8,B9,BA,BB,BC,BD,BE,BF,C0,C1,C2,F0,ram4,l0,1,2,sfw MSC=10 NAME="HID 04d9:1400" PHYS="usb-0000:00:1d.0-1/input0" PRODUCT=3/4d9/1400/110 PROP=0 SEQNUM=2263 SUBSYSTEM=input UNIQ=""
KERNEL[78150.315762] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0025/input/input44/event6 (input) ACTION=add DEVNAME=/dev/input/event6 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0025/input/input44/event6 MAJOR=13 MINOR=70 SEQNUM=2264 SUBSYSTEM=input
KERNEL[78150.315864] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0025/hidraw/hidraw0 (hidraw) ACTION=add DEVNAME=/dev/hidraw0 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0025/hidraw/hidraw0 MAJOR=247 MINOR=0 SEQNUM=2265 SUBSYSTEM=hidraw
KERNEL[78150.315934] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1 (usb) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1 DEVTYPE=usb_interface INTERFACE=3/1/2 MODALIAS=usb:v04D9p1400d0143dc00dsc00dp00ic03isc01ip02in01 PRODUCT=4d9/1400/143 SEQNUM=2266 SUBSYSTEM=usb TYPE=0/0/0
KERNEL[78150.348378] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0026 (hid) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0026 HID_ID=0003:000004D9:00001400 HID_NAME=HID 04d9:1400 HID_PHYS=usb-0000:00:1d.0-1/input1 MODALIAS=hid:b0003g0001v000004D9p00001400 SEQNUM=2267 SUBSYSTEM=hid
KERNEL[78150.348750] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0026/input/input45 (input) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0026/input/input45 EV=17 KEY=1f0000 2000000 39fad941d001 1e000000000000 0 MODALIAS=input:b0003v04D9p1400e0110-e0,1,2,4,k71,72,73,74,80,8C,8E,8F,90,96,98,9B,9C,9E,9F,A1,A3,A4,A5,A6,A7,A8,AB,AC,AD,D9,110,111,112,113,114,r0,1,8,am4,lsfw MSC=10 NAME="HID 04d9:1400" PHYS="usb-0000:00:1d.0-1/input1" PRODUCT=3/4d9/1400/110 PROP=0 REL=103 SEQNUM=2268 SUBSYSTEM=input UNIQ=""
KERNEL[78150.348806] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0026/input/input45/event7 (input) ACTION=add DEVNAME=/dev/input/event7 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0026/input/input45/event7 MAJOR=13 MINOR=71 SEQNUM=2269 SUBSYSTEM=input
KERNEL[78150.349215] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0026/input/input45/mouse0 (input) ACTION=add DEVNAME=/dev/input/mouse0 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0026/input/input45/mouse0 MAJOR=13 MINOR=32 SEQNUM=2270 SUBSYSTEM=input
KERNEL[78150.349570] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0026/hidraw/hidraw1 (hidraw) ACTION=add DEVNAME=/dev/hidraw1 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0026/hidraw/hidraw1 MAJOR=247 MINOR=1 SEQNUM=2271 SUBSYSTEM=hidraw
UDEV [78150.352414] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1 (usb) ACTION=add BUSNUM=005 DEVNAME=/dev/bus/usb/005/014 DEVNUM=014 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1 DEVTYPE=usb_device ID_BUS=usb ID_MODEL=1400 ID_MODEL_ENC=1400 ID_MODEL_FROM_DATABASE=PS/2 keyboard + mouse controller ID_MODEL_ID=1400 ID_REVISION=0143 ID_SERIAL=04d9_1400 ID_USB_INTERFACES=:030101:030102: ID_VENDOR=04d9 ID_VENDOR_ENC=04d9 ID_VENDOR_FROM_DATABASE=Holtek Semiconductor, Inc. ID_VENDOR_ID=04d9 MAJOR=189 MINOR=525 PRODUCT=4d9/1400/143 SEQNUM=2260 SUBSYSTEM=usb TYPE=0/0/0 USEC_INITIALIZED=150293560
UDEV [78150.359452] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0 (usb) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0 DEVTYPE=usb_interface ID_MODEL_FROM_DATABASE=PS/2 keyboard + mouse controller ID_VENDOR_FROM_DATABASE=Holtek Semiconductor, Inc. INTERFACE=3/1/1 MODALIAS=usb:v04D9p1400d0143dc00dsc00dp00ic03isc01ip01in00 PRODUCT=4d9/1400/143 SEQNUM=2261 SUBSYSTEM=usb TYPE=0/0/0 USEC_INITIALIZED=297361
UDEV [78150.361013] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0025 (hid) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0025 HID_ID=0003:000004D9:00001400 HID_NAME=HID 04d9:1400 HID_PHYS=usb-0000:00:1d.0-1/input0 MODALIAS=hid:b0003g0001v000004D9p00001400 SEQNUM=2262 SUBSYSTEM=hid USEC_INITIALIZED=315394
UDEV [78150.363279] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0025/input/input44 (input) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0025/input/input44 EV=120013 ID_BUS=usb ID_FOR_SEAT=input-pci-0000_00_1d_0-usb-0_1_1_0 ID_INPUT=1 ID_INPUT_KEY=1 ID_INPUT_KEYBOARD=1 ID_MODEL=1400 ID_MODEL_ENC=1400 ID_MODEL_ID=1400 ID_PATH=pci-0000:00:1d.0-usb-0:1:1.0 ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_1_0 ID_REVISION=0143 ID_SERIAL=04d9_1400 ID_TYPE=hid ID_USB_DRIVER=usbhid ID_USB_INTERFACES=:030101:030102: ID_USB_INTERFACE_NUM=00 ID_VENDOR=04d9 ID_VENDOR_ENC=04d9 ID_VENDOR_ID=04d9 KEY=1000000000007 ff9f207ac14057ff febeffdfffefffff fffffffffffffffe LED=7 MODALIAS=input:b0003v04D9p1400e0110-e0,1,4,11,14,k71,72,73,74,75,77,79,7A,7B,7C,7D,7E,7F,80,81,82,83,84,85,86,87,88,89,8A,8C,8E,96,98,9E,9F,A1,A3,A4,A5,A6,AD,B0,B1,B2,B3,B4,B7,B8,B9,BA,BB,BC,BD,BE,BF,C0,C1,C2,F0,ram4,l0,1,2,sfw MSC=10 NAME="HID 04d9:1400" PHYS="usb-0000:00:1d.0-1/input0" PRODUCT=3/4d9/1400/110 PROP=0 SEQNUM=2263 SUBSYSTEM=input TAGS=:seat: UNIQ="" USEC_INITIALIZED=315688
UDEV [78150.363612] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1 (usb) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1 DEVTYPE=usb_interface ID_MODEL_FROM_DATABASE=PS/2 keyboard + mouse controller ID_VENDOR_FROM_DATABASE=Holtek Semiconductor, Inc. INTERFACE=3/1/2 MODALIAS=usb:v04D9p1400d0143dc00dsc00dp00ic03isc01ip02in01 PRODUCT=4d9/1400/143 SEQNUM=2266 SUBSYSTEM=usb TYPE=0/0/0 USEC_INITIALIZED=150315976
UDEV [78150.366574] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0025/hidraw/hidraw0 (hidraw) ACTION=add DEVNAME=/dev/hidraw0 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0025/hidraw/hidraw0 MAJOR=247 MINOR=0 SEQNUM=2265 SUBSYSTEM=hidraw USEC_INITIALIZED=150315900
UDEV [78150.367209] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0026 (hid) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0026 HID_ID=0003:000004D9:00001400 HID_NAME=HID 04d9:1400 HID_PHYS=usb-0000:00:1d.0-1/input1 MODALIAS=hid:b0003g0001v000004D9p00001400 SEQNUM=2267 SUBSYSTEM=hid USEC_INITIALIZED=348465
UDEV [78150.369365] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0026/input/input45 (input) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0026/input/input45 EV=17 ID_BUS=usb ID_FOR_SEAT=input-pci-0000_00_1d_0-usb-0_1_1_1 ID_INPUT=1 ID_INPUT_KEY=1 ID_INPUT_MOUSE=1 ID_MODEL=1400 ID_MODEL_ENC=1400 ID_MODEL_ID=1400 ID_PATH=pci-0000:00:1d.0-usb-0:1:1.1 ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_1_1 ID_REVISION=0143 ID_SERIAL=04d9_1400 ID_TYPE=hid ID_USB_DRIVER=usbhid ID_USB_INTERFACES=:030101:030102: ID_USB_INTERFACE_NUM=01 ID_VENDOR=04d9 ID_VENDOR_ENC=04d9 ID_VENDOR_ID=04d9 KEY=1f0000 2000000 39fad941d001 1e000000000000 0 MODALIAS=input:b0003v04D9p1400e0110-e0,1,2,4,k71,72,73,74,80,8C,8E,8F,90,96,98,9B,9C,9E,9F,A1,A3,A4,A5,A6,A7,A8,AB,AC,AD,D9,110,111,112,113,114,r0,1,8,am4,lsfw MSC=10 NAME="HID 04d9:1400" PHYS="usb-0000:00:1d.0-1/input1" PRODUCT=3/4d9/1400/110 PROP=0 REL=103 SEQNUM=2268 SUBSYSTEM=input TAGS=:seat: UNIQ="" USEC_INITIALIZED=349029
UDEV [78150.370966] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0026/hidraw/hidraw1 (hidraw) ACTION=add DEVNAME=/dev/hidraw1 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0026/hidraw/hidraw1 MAJOR=247 MINOR=1 SEQNUM=2271 SUBSYSTEM=hidraw USEC_INITIALIZED=349776
UDEV [78150.372975] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0026/input/input45/event7 (input) ACTION=add DEVLINKS=/dev/input/by-id/usb-04d9_1400-if01-event-mouse /dev/input/by-path/pci-0000:00:1d.0-usb-0:1:1.1-event-mouse DEVNAME=/dev/input/event7 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0026/input/input45/event7 ID_BUS=usb ID_INPUT=1 ID_INPUT_KEY=1 ID_INPUT_MOUSE=1 ID_MODEL=1400 ID_MODEL_ENC=1400 ID_MODEL_ID=1400 ID_PATH=pci-0000:00:1d.0-usb-0:1:1.1 ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_1_1 ID_REVISION=0143 ID_SERIAL=04d9_1400 ID_TYPE=hid ID_USB_DRIVER=usbhid ID_USB_INTERFACES=:030101:030102: ID_USB_INTERFACE_NUM=01 ID_VENDOR=04d9 ID_VENDOR_ENC=04d9 ID_VENDOR_ID=04d9 MAJOR=13 MINOR=71 SEQNUM=2269 SUBSYSTEM=input USEC_INITIALIZED=349103
UDEV [78150.373507] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0025/input/input44/event6 (input) ACTION=add DEVLINKS=/dev/input/by-id/usb-04d9_1400-event-kbd /dev/input/by-path/pci-0000:00:1d.0-usb-0:1:1.0-event-kbd DEVNAME=/dev/input/event6 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0025/input/input44/event6 ID_BUS=usb ID_INPUT=1 ID_INPUT_KEY=1 ID_INPUT_KEYBOARD=1 ID_MODEL=1400 ID_MODEL_ENC=1400 ID_MODEL_ID=1400 ID_PATH=pci-0000:00:1d.0-usb-0:1:1.0 ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_1_0 ID_REVISION=0143 ID_SERIAL=04d9_1400 ID_TYPE=hid ID_USB_DRIVER=usbhid ID_USB_INTERFACES=:030101:030102: ID_USB_INTERFACE_NUM=00 ID_VENDOR=04d9 ID_VENDOR_ENC=04d9 ID_VENDOR_ID=04d9 MAJOR=13 MINOR=70 SEQNUM=2264 SUBSYSTEM=input USEC_INITIALIZED=315738
UDEV [78150.408756] add /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0026/input/input45/mouse0 (input) ACTION=add DEVLINKS=/dev/input/by-id/usb-04d9_1400-if01-mouse /dev/input/by-path/pci-0000:00:1d.0-usb-0:1:1.1-mouse DEVNAME=/dev/input/mouse0 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0026/input/input45/mouse0 ID_BUS=usb ID_INPUT=1 ID_INPUT_KEY=1 ID_INPUT_MOUSE=1 ID_MODEL=1400 ID_MODEL_ENC=1400 ID_MODEL_ID=1400 ID_PATH=pci-0000:00:1d.0-usb-0:1:1.1 ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_1_1 ID_REVISION=0143 ID_SERIAL=04d9_1400 ID_TYPE=hid ID_USB_DRIVER=usbhid ID_USB_INTERFACES=:030101:030102: ID_USB_INTERFACE_NUM=01 ID_VENDOR=04d9 ID_VENDOR_ENC=04d9 ID_VENDOR_ID=04d9 MAJOR=13 MINOR=32 SEQNUM=2270 SUBSYSTEM=input USEC_INITIALIZED=150349156
그리고 플러그:
KERNEL[78050.382672] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0023/input/input42/event6 (input) ACTION=remove DEVNAME=/dev/input/event6 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0023/input/input42/event6 MAJOR=13 MINOR=70 SEQNUM=2248 SUBSYSTEM=input
UDEV [78050.385911] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0023/input/input42/event6 (input) ACTION=remove DEVLINKS=/dev/input/by-id/usb-04d9_1400-event-kbd /dev/input/by-path/pci-0000:00:1d.0-usb-0:1:1.0-event-kbd DEVNAME=/dev/input/event6 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0023/input/input42/event6 ID_BUS=usb ID_INPUT=1 ID_INPUT_KEY=1 ID_INPUT_KEYBOARD=1 ID_MODEL=1400 ID_MODEL_ENC=1400 ID_MODEL_ID=1400 ID_PATH=pci-0000:00:1d.0-usb-0:1:1.0 ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_1_0 ID_REVISION=0143 ID_SERIAL=04d9_1400 ID_TYPE=hid ID_USB_DRIVER=usbhid ID_USB_INTERFACES=:030101:030102: ID_USB_INTERFACE_NUM=00 ID_VENDOR=04d9 ID_VENDOR_ENC=04d9 ID_VENDOR_ID=04d9 MAJOR=13 MINOR=70 SEQNUM=2248 SUBSYSTEM=input USEC_INITIALIZED=215964
KERNEL[78050.399307] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0023/input/input42 (input) ACTION=remove DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0023/input/input42 EV=120013 KEY=1000000000007 ff9f207ac14057ff febeffdfffefffff fffffffffffffffe LED=7 MODALIAS=input:b0003v04D9p1400e0110-e0,1,4,11,14,k71,72,73,74,75,77,79,7A,7B,7C,7D,7E,7F,80,81,82,83,84,85,86,87,88,89,8A,8C,8E,96,98,9E,9F,A1,A3,A4,A5,A6,AD,B0,B1,B2,B3,B4,B7,B8,B9,BA,BB,BC,BD,BE,BF,C0,C1,C2,F0,ram4,l0,1,2,sfw MSC=10 NAME="HID 04d9:1400" PHYS="usb-0000:00:1d.0-1/input0" PRODUCT=3/4d9/1400/110 PROP=0 SEQNUM=2249 SUBSYSTEM=input UNIQ=""
KERNEL[78050.399658] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0023/hidraw/hidraw0 (hidraw) ACTION=remove DEVNAME=/dev/hidraw0 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0023/hidraw/hidraw0 MAJOR=247 MINOR=0 SEQNUM=2250 SUBSYSTEM=hidraw
KERNEL[78050.399744] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0023 (hid) ACTION=remove DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0023 HID_ID=0003:000004D9:00001400 HID_NAME=HID 04d9:1400 HID_PHYS=usb-0000:00:1d.0-1/input0 MODALIAS=hid:b0003g0001v000004D9p00001400 SEQNUM=2251 SUBSYSTEM=hid
KERNEL[78050.399821] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0 (usb) ACTION=remove DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0 DEVTYPE=usb_interface INTERFACE=3/1/1 MODALIAS=usb:v04D9p1400d0143dc00dsc00dp00ic03isc01ip01in00 PRODUCT=4d9/1400/143 SEQNUM=2252 SUBSYSTEM=usb TYPE=0/0/0
UDEV [78050.402035] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0023/input/input42 (input) ACTION=remove DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0023/input/input42 EV=120013 ID_BUS=usb ID_FOR_SEAT=input-pci-0000_00_1d_0-usb-0_1_1_0 ID_INPUT=1 ID_INPUT_KEY=1 ID_INPUT_KEYBOARD=1 ID_MODEL=1400 ID_MODEL_ENC=1400 ID_MODEL_ID=1400 ID_PATH=pci-0000:00:1d.0-usb-0:1:1.0 ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_1_0 ID_REVISION=0143 ID_SERIAL=04d9_1400 ID_TYPE=hid ID_USB_DRIVER=usbhid ID_USB_INTERFACES=:030101:030102: ID_USB_INTERFACE_NUM=00 ID_VENDOR=04d9 ID_VENDOR_ENC=04d9 ID_VENDOR_ID=04d9 KEY=1000000000007 ff9f207ac14057ff febeffdfffefffff fffffffffffffffe LED=7 MODALIAS=input:b0003v04D9p1400e0110-e0,1,4,11,14,k71,72,73,74,75,77,79,7A,7B,7C,7D,7E,7F,80,81,82,83,84,85,86,87,88,89,8A,8C,8E,96,98,9E,9F,A1,A3,A4,A5,A6,AD,B0,B1,B2,B3,B4,B7,B8,B9,BA,BB,BC,BD,BE,BF,C0,C1,C2,F0,ram4,l0,1,2,sfw MSC=10 NAME="HID 04d9:1400" PHYS="usb-0000:00:1d.0-1/input0" PRODUCT=3/4d9/1400/110 PROP=0 SEQNUM=2249 SUBSYSTEM=input TAGS=:seat: UNIQ="" USEC_INITIALIZED=215881
UDEV [78050.403745] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0023/hidraw/hidraw0 (hidraw) ACTION=remove DEVNAME=/dev/hidraw0 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0023/hidraw/hidraw0 MAJOR=247 MINOR=0 SEQNUM=2250 SUBSYSTEM=hidraw USEC_INITIALIZED=50400126
UDEV [78050.405656] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0023 (hid) ACTION=remove DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/0003:04D9:1400.0023 HID_ID=0003:000004D9:00001400 HID_NAME=HID 04d9:1400 HID_PHYS=usb-0000:00:1d.0-1/input0 MODALIAS=hid:b0003g0001v000004D9p00001400 SEQNUM=2251 SUBSYSTEM=hid USEC_INITIALIZED=400682
UDEV [78050.407323] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0 (usb) ACTION=remove DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0 DEVTYPE=usb_interface ID_MODEL_FROM_DATABASE=PS/2 keyboard + mouse controller ID_VENDOR_FROM_DATABASE=Holtek Semiconductor, Inc. INTERFACE=3/1/1 MODALIAS=usb:v04D9p1400d0143dc00dsc00dp00ic03isc01ip01in00 PRODUCT=4d9/1400/143 SEQNUM=2252 SUBSYSTEM=usb TYPE=0/0/0 USEC_INITIALIZED=197298
KERNEL[78050.432446] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0024/input/input43/event7 (input) ACTION=remove DEVNAME=/dev/input/event7 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0024/input/input43/event7 MAJOR=13 MINOR=71 SEQNUM=2253 SUBSYSTEM=input
UDEV [78050.434993] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0024/input/input43/event7 (input) ACTION=remove DEVLINKS=/dev/input/by-id/usb-04d9_1400-if01-event-mouse /dev/input/by-path/pci-0000:00:1d.0-usb-0:1:1.1-event-mouse DEVNAME=/dev/input/event7 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0024/input/input43/event7 ID_BUS=usb ID_INPUT=1 ID_INPUT_KEY=1 ID_INPUT_MOUSE=1 ID_MODEL=1400 ID_MODEL_ENC=1400 ID_MODEL_ID=1400 ID_PATH=pci-0000:00:1d.0-usb-0:1:1.1 ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_1_1 ID_REVISION=0143 ID_SERIAL=04d9_1400 ID_TYPE=hid ID_USB_DRIVER=usbhid ID_USB_INTERFACES=:030101:030102: ID_USB_INTERFACE_NUM=01 ID_VENDOR=04d9 ID_VENDOR_ENC=04d9 ID_VENDOR_ID=04d9 MAJOR=13 MINOR=71 SEQNUM=2253 SUBSYSTEM=input USEC_INITIALIZED=248972
KERNEL[78050.456155] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0024/input/input43/mouse0 (input) ACTION=remove DEVNAME=/dev/input/mouse0 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0024/input/input43/mouse0 MAJOR=13 MINOR=32 SEQNUM=2254 SUBSYSTEM=input
UDEV [78050.457413] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0024/input/input43/mouse0 (input) ACTION=remove DEVLINKS=/dev/input/by-id/usb-04d9_1400-if01-mouse /dev/input/by-path/pci-0000:00:1d.0-usb-0:1:1.1-mouse DEVNAME=/dev/input/mouse0 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0024/input/input43/mouse0 ID_BUS=usb ID_INPUT=1 ID_INPUT_KEY=1 ID_INPUT_MOUSE=1 ID_MODEL=1400 ID_MODEL_ENC=1400 ID_MODEL_ID=1400 ID_PATH=pci-0000:00:1d.0-usb-0:1:1.1 ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_1_1 ID_REVISION=0143 ID_SERIAL=04d9_1400 ID_TYPE=hid ID_USB_DRIVER=usbhid ID_USB_INTERFACES=:030101:030102: ID_USB_INTERFACE_NUM=01 ID_VENDOR=04d9 ID_VENDOR_ENC=04d9 ID_VENDOR_ID=04d9 MAJOR=13 MINOR=32 SEQNUM=2254 SUBSYSTEM=input USEC_INITIALIZED=249005
KERNEL[78050.490161] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0024/input/input43 (input) ACTION=remove DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0024/input/input43 EV=17 KEY=1f0000 2000000 39fad941d001 1e000000000000 0 MODALIAS=input:b0003v04D9p1400e0110-e0,1,2,4,k71,72,73,74,80,8C,8E,8F,90,96,98,9B,9C,9E,9F,A1,A3,A4,A5,A6,A7,A8,AB,AC,AD,D9,110,111,112,113,114,r0,1,8,am4,lsfw MSC=10 NAME="HID 04d9:1400" PHYS="usb-0000:00:1d.0-1/input1" PRODUCT=3/4d9/1400/110 PROP=0 REL=103 SEQNUM=2255 SUBSYSTEM=input UNIQ=""
KERNEL[78050.490227] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0024/hidraw/hidraw1 (hidraw) ACTION=remove DEVNAME=/dev/hidraw1 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0024/hidraw/hidraw1 MAJOR=247 MINOR=1 SEQNUM=2256 SUBSYSTEM=hidraw
UDEV [78050.490261] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0024/hidraw/hidraw1 (hidraw) ACTION=remove DEVNAME=/dev/hidraw1 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0024/hidraw/hidraw1 MAJOR=247 MINOR=1 SEQNUM=2256 SUBSYSTEM=hidraw USEC_INITIALIZED=489761
KERNEL[78050.490301] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0024 (hid) ACTION=remove DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0024 HID_ID=0003:000004D9:00001400 HID_NAME=HID 04d9:1400 HID_PHYS=usb-0000:00:1d.0-1/input1 MODALIAS=hid:b0003g0001v000004D9p00001400 SEQNUM=2257 SUBSYSTEM=hid
KERNEL[78050.490340] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1 (usb) ACTION=remove DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1 DEVTYPE=usb_interface INTERFACE=3/1/2 MODALIAS=usb:v04D9p1400d0143dc00dsc00dp00ic03isc01ip02in01 PRODUCT=4d9/1400/143 SEQNUM=2258 SUBSYSTEM=usb TYPE=0/0/0
UDEV [78050.491393] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0024/input/input43 (input) ACTION=remove DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0024/input/input43 EV=17 ID_BUS=usb ID_FOR_SEAT=input-pci-0000_00_1d_0-usb-0_1_1_1 ID_INPUT=1 ID_INPUT_KEY=1 ID_INPUT_MOUSE=1 ID_MODEL=1400 ID_MODEL_ENC=1400 ID_MODEL_ID=1400 ID_PATH=pci-0000:00:1d.0-usb-0:1:1.1 ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_1_1 ID_REVISION=0143 ID_SERIAL=04d9_1400 ID_TYPE=hid ID_USB_DRIVER=usbhid ID_USB_INTERFACES=:030101:030102: ID_USB_INTERFACE_NUM=01 ID_VENDOR=04d9 ID_VENDOR_ENC=04d9 ID_VENDOR_ID=04d9 KEY=1f0000 2000000 39fad941d001 1e000000000000 0 MODALIAS=input:b0003v04D9p1400e0110-e0,1,2,4,k71,72,73,74,80,8C,8E,8F,90,96,98,9B,9C,9E,9F,A1,A3,A4,A5,A6,A7,A8,AB,AC,AD,D9,110,111,112,113,114,r0,1,8,am4,lsfw MSC=10 NAME="HID 04d9:1400" PHYS="usb-0000:00:1d.0-1/input1" PRODUCT=3/4d9/1400/110 PROP=0 REL=103 SEQNUM=2255 SUBSYSTEM=input TAGS=:seat: UNIQ="" USEC_INITIALIZED=248939
UDEV [78050.491500] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0024 (hid) ACTION=remove DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/0003:04D9:1400.0024 HID_ID=0003:000004D9:00001400 HID_NAME=HID 04d9:1400 HID_PHYS=usb-0000:00:1d.0-1/input1 MODALIAS=hid:b0003g0001v000004D9p00001400 SEQNUM=2257 SUBSYSTEM=hid USEC_INITIALIZED=489833
UDEV [78050.491546] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1 (usb) ACTION=remove DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1 DEVTYPE=usb_interface ID_MODEL_FROM_DATABASE=PS/2 keyboard + mouse controller ID_VENDOR_FROM_DATABASE=Holtek Semiconductor, Inc. INTERFACE=3/1/2 MODALIAS=usb:v04D9p1400d0143dc00dsc00dp00ic03isc01ip02in01 PRODUCT=4d9/1400/143 SEQNUM=2258 SUBSYSTEM=usb TYPE=0/0/0 USEC_INITIALIZED=32216435
KERNEL[78050.509101] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1 (usb) ACTION=remove BUSNUM=005 DEVNAME=/dev/bus/usb/005/013 DEVNUM=013 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1 DEVTYPE=usb_device MAJOR=189 MINOR=524 PRODUCT=4d9/1400/143 SEQNUM=2259 SUBSYSTEM=usb TYPE=0/0/0
UDEV [78050.509856] remove /devices/pci0000:00/0000:00:1d.0/usb5/5-1 (usb) ACTION=remove BUSNUM=005 DEVNAME=/dev/bus/usb/005/013 DEVNUM=013 DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-1 DEVTYPE=usb_device ID_BUS=usb ID_MODEL=1400 ID_MODEL_ENC=1400 ID_MODEL_FROM_DATABASE=PS/2 keyboard + mouse controller ID_MODEL_ID=1400 ID_REVISION=0143 ID_SERIAL=04d9_1400 ID_USB_INTERFACES=:030101:030102: ID_VENDOR=04d9 ID_VENDOR_ENC=04d9 ID_VENDOR_FROM_DATABASE=Holtek Semiconductor, Inc. ID_VENDOR_ID=04d9 MAJOR=189 MINOR=524 PRODUCT=4d9/1400/143 SEQNUM=2259 SUBSYSTEM=usb TYPE=0/0/0 USEC_INITIALIZED=32193478
답변1
내 관점에서는 두 가지 문제가 있을 수 있다.
- 이 스크립트에는 777 권한이 없습니다.
- 당신이 부르는 방식. 다음을 시도해 보세요. 작동해야합니다.
udev 규칙 파일
$ cat 080-model-m.rules
ACTION=="add", ATTRS{idVendor}=="04d9", ATTRS{idProduct}=="1400", RUN+="/bin/sh /home/rob/home/scripts/caps-equals-super.sh"
ACTION=="remove", ATTRS{idVendor}=="04d9", ATTRS{idProduct}=="1400", RUN+="/bin/sh /home/rob/home/scripts/revert-keyboard-to-default.sh"
/bin/sh
시작 부분을 참고하세요 RUN
. 또한 쉘 스크립트의 경로를 다시 확인하십시오.
또한 udev 규칙을 변경한 후에는 udevadm trigger
udev 규칙을 다시 로드 해야 합니다.