Ubuntu 17.10, as regras do Yubikey Neo udev não acionam

6

Eu tenho o Ubuntu 17.10 instalado em um iMac de meados de 2011. Em um laptop Dell XPS 15, eu pude configurar meu Yubikey (via regras do udev) para ativar & amp; Desativar o protetor de tela quando o Yubikey foi desconectado ou conectado. Eu tentei configurar a mesma coisa no Ubuntu 17.10, mas nada parece funcionar. O script que defini como o parâmetro RUN na seção RUN da regra nunca é acionado.

Aqui está a saída em /var/log/syslog quando eu conecto o Yubikey:

    Dec  5 10:38:02 computer kernel: [  814.455304] usb 2-1.3.1: new full-speed USB device number 10 using ehci-pci
Dec  5 10:38:02 computer kernel: [  814.566229] usb 2-1.3.1: New USB device found, idVendor=1050, idProduct=0116
Dec  5 10:38:02 computer kernel: [  814.566233] usb 2-1.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Dec  5 10:38:02 computer kernel: [  814.566235] usb 2-1.3.1: Product: Yubikey NEO OTP+U2F+CCID
Dec  5 10:38:02 computer kernel: [  814.566237] usb 2-1.3.1: Manufacturer: Yubico
Dec  5 10:38:02 computer kernel: [  814.567661] input: Yubico Yubikey NEO OTP+U2F+CCID as /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1.3/2-1.3.1/2-1.3.1:1.0/0003:1050:0116.000F/input/input21
Dec  5 10:38:02 computer kernel: [  814.627832] hid-generic 0003:1050:0116.000F: input,hidraw5: USB HID v1.10 Keyboard [Yubico Yubikey NEO OTP+U2F+CCID] on usb-0000:00:1d.7-1.3.1/input0
Dec  5 10:38:02 computer kernel: [  814.628715] hid-generic 0003:1050:0116.0010: hiddev2,hidraw6: USB HID v1.10 Device [Yubico Yubikey NEO OTP+U2F+CCID] on usb-0000:00:1d.7-1.3.1/input1
Dec  5 10:38:02 computer mtp-probe: checking bus 2, device 10: "/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1.3/2-1.3.1"
Dec  5 10:38:02 computer mtp-probe: bus: 2, device: 10 was not an MTP device
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[4002]: (II) config/udev: Adding input device Yubico Yubikey NEO OTP+U2F+CCID (/dev/input/event9)
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[4002]: (**) Yubico Yubikey NEO OTP+U2F+CCID: Applying InputClass "libinput keyboard catchall"
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[4002]: (II) Using input driver 'libinput' for 'Yubico Yubikey NEO OTP+U2F+CCID'            
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[2389]: (II) config/udev: Adding input device Yubico Yubikey NEO OTP+U2F+CCID (/dev/input/event9)
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[2389]: (**) Yubico Yubikey NEO OTP+U2F+CCID: Applying InputClass "libinput keyboard catchall"
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[2389]: (II) Using input driver 'libinput' for 'Yubico Yubikey NEO OTP+U2F+CCID'            
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[4002]: (II) systemd-logind: got fd for /dev/input/event9 13:73 fd 56 paused 0
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[4002]: (**) Yubico Yubikey NEO OTP+U2F+CCID: always reports core events
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[4002]: (**) Option "Device" "/dev/input/event9"
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[4002]: (**) Option "_source" "server/udev"
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[4002]: (II) event9  - (II) Yubico Yubikey NEO OTP+U2F+CCID: (II) is tagged by udev as: Keyboard
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[4002]: (II) event9  - (II) Yubico Yubikey NEO OTP+U2F+CCID: (II) device is a keyboard      
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[4002]: (II) event9  - (II) Yubico Yubikey NEO OTP+U2F+CCID: (II) device removed            
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[4002]: (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1.3/2-1.3.1/2-1.3.1:1.0/0003:1050:0116.000F/input/input21/event9"
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[4002]: (II) XINPUT: Adding extended input device "Yubico Yubikey NEO OTP+U2F+CCID" (type: KEYBOARD, id 15)
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[4002]: (**) Option "xkb_model" "pc105"
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[4002]: (**) Option "xkb_layout" "us"
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[4002]: (WW) Option "xkb_variant" requires a string value
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[4002]: (WW) Option "xkb_options" requires a string value
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[4002]: (II) event9  - (II) Yubico Yubikey NEO OTP+U2F+CCID: (II) is tagged by udev as: Keyboard
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[4002]: (II) event9  - (II) Yubico Yubikey NEO OTP+U2F+CCID: (II) device is a keyboard      
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[2389]: (II) systemd-logind: got fd for /dev/input/event9 13:73 fd 30 paused 1
Dec  5 10:38:02 computer /usr/lib/gdm3/gdm-x-session[2389]: (II) systemd-logind: releasing fd for 13:73 

Quando uso udevadm info , aqui está o que recebo:

looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1.3/2-1.3.1':
KERNELS=="2-1.3.1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{authorized}=="1"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{bConfigurationValue}=="1"
ATTRS{bDeviceClass}=="00"
ATTRS{bDeviceProtocol}=="00"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{bMaxPower}=="30mA"
ATTRS{bNumConfigurations}=="1"
ATTRS{bNumInterfaces}==" 3"
ATTRS{bcdDevice}=="0333"
ATTRS{bmAttributes}=="80"
ATTRS{busnum}=="2"
ATTRS{configuration}==""
ATTRS{devnum}=="7"
ATTRS{devpath}=="1.3.1"
ATTRS{idProduct}=="0116"
ATTRS{idVendor}=="1050"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="Yubico"
ATTRS{maxchild}=="0"
ATTRS{product}=="Yubikey NEO OTP+U2F+CCID"
ATTRS{quirks}=="0x0"
ATTRS{removable}=="removable"
ATTRS{speed}=="12"
ATTRS{urbnum}=="262"
ATTRS{version}==" 2.00"

E udevadm test gera o seguinte:

calling: test
version 234
This program is for debugging only, it does not run any program
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.   
=== trie on-disk ===
tool version:          234                                            
file size:         9138024 bytes
header size             80 bytes                                      
strings            1910832 bytes
nodes              7227112 bytes                                           
Load module index
Found container virtualization none.
timestamp of '/etc/systemd/network' changed
timestamp of '/lib/systemd/network' changed
Parsed configuration file /lib/systemd/network/99-default.link
Created link configuration context.
timestamp of '/etc/udev/rules.d' changed
Reading rules file: /lib/udev/rules.d/39-usbmuxd.rules
Reading rules file: /lib/udev/rules.d/40-usb-media-players.rules      
Reading rules file: /lib/udev/rules.d/40-usb_modeswitch.rules         
Reading rules file: /lib/udev/rules.d/40-vm-hotadd.rules              
Reading rules file: /lib/udev/rules.d/50-apport.rules                 
Reading rules file: /lib/udev/rules.d/50-firmware.rules
Reading rules file: /lib/udev/rules.d/50-udev-default.rules           
Reading rules file: /lib/udev/rules.d/55-dm.rules
Reading rules file: /lib/udev/rules.d/55-ippusbxd.rules               
Reading rules file: /lib/udev/rules.d/56-hpmud.rules                  
Reading rules file: /lib/udev/rules.d/60-block.rules                  
Reading rules file: /lib/udev/rules.d/60-cdrom_id.rules               
Reading rules file: /lib/udev/rules.d/60-crda.rules                   
Reading rules file: /lib/udev/rules.d/60-drm.rules                    
Reading rules file: /lib/udev/rules.d/60-evdev.rules                  
Reading rules file: /lib/udev/rules.d/60-gnupg2.rules                 
Reading rules file: /lib/udev/rules.d/60-input-id.rules               
Reading rules file: /lib/udev/rules.d/60-inputattach.rules            
Reading rules file: /lib/udev/rules.d/60-libgphoto2-6.rules           
Reading rules file: /lib/udev/rules.d/60-libsane1.rules               
Reading rules file: /lib/udev/rules.d/60-pcmcia.rules                 
Reading rules file: /lib/udev/rules.d/60-persistent-alsa.rules        
Reading rules file: /lib/udev/rules.d/60-persistent-input.rules       
Reading rules file: /lib/udev/rules.d/60-persistent-storage-dm.rules  
Reading rules file: /lib/udev/rules.d/60-persistent-storage-tape.rules
Reading rules file: /lib/udev/rules.d/60-persistent-storage.rules     
Reading rules file: /lib/udev/rules.d/60-persistent-v4l.rules         
Reading rules file: /lib/udev/rules.d/60-scdaemon.rules               
Reading rules file: /lib/udev/rules.d/60-sensor.rules                 
Reading rules file: /lib/udev/rules.d/60-serial.rules                 
Reading rules file: /lib/udev/rules.d/61-gnome-settings-daemon-rfkill.rules
Reading rules file: /lib/udev/rules.d/61-persistent-storage-android.rules
Reading rules file: /lib/udev/rules.d/64-btrfs.rules                                  
Reading rules file: /lib/udev/rules.d/64-xorg-xkb.rules               
Reading rules file: /lib/udev/rules.d/65-libwacom.rules               
Reading rules file: /lib/udev/rules.d/66-snapd-autoimport.rules       
Reading rules file: /lib/udev/rules.d/66-xorg-synaptics-quirks.rules  
Reading rules file: /lib/udev/rules.d/69-cd-sensors.rules             
Reading rules file: /lib/udev/rules.d/69-libmtp.rules                 
Reading rules file: /lib/udev/rules.d/69-wacom.rules                  
Reading rules file: /lib/udev/rules.d/69-yubikey.rules                
Reading rules file: /lib/udev/rules.d/70-debian-uaccess.rules         
Reading rules file: /lib/udev/rules.d/70-mouse.rules 
Reading rules file: /lib/udev/rules.d/70-old-u2f.rules
Reading rules file: /lib/udev/rules.d/70-power-switch.rules           
Reading rules file: /lib/udev/rules.d/70-printers.rules               
Reading rules file: /lib/udev/rules.d/70-touchpad.rules               
Reading rules file: /etc/udev/rules.d/70-u2f.rules                    
Reading rules file: /lib/udev/rules.d/70-uaccess.rules                
Reading rules file: /lib/udev/rules.d/71-power-switch-proliant.rules
Reading rules file: /lib/udev/rules.d/71-seat.rules
Reading rules file: /lib/udev/rules.d/71-u-d-c-gpu-detection.rules
Reading rules file: /lib/udev/rules.d/73-seat-late.rules
Reading rules file: /lib/udev/rules.d/73-special-net-names.rules      
Reading rules file: /lib/udev/rules.d/73-usb-net-by-mac.rules
Reading rules file: /lib/udev/rules.d/75-net-description.rules
Reading rules file: /lib/udev/rules.d/75-probe_mtd.rules
Reading rules file: /lib/udev/rules.d/77-mm-cinterion-port-types.rules
Reading rules file: /lib/udev/rules.d/77-mm-dell-port-types.rules
Reading rules file: /lib/udev/rules.d/77-mm-ericsson-mbm.rules        
Reading rules file: /lib/udev/rules.d/77-mm-haier-port-types.rules
Reading rules file: /lib/udev/rules.d/77-mm-huawei-net-port-types.rules
Reading rules file: /lib/udev/rules.d/77-mm-longcheer-port-types.rules
Reading rules file: /lib/udev/rules.d/77-mm-mtk-port-types.rules
Reading rules file: /lib/udev/rules.d/77-mm-nokia-port-types.rules    
Reading rules file: /lib/udev/rules.d/77-mm-pcmcia-device-blacklist.rules
Reading rules file: /lib/udev/rules.d/77-mm-platform-serial-whitelist.rules
Reading rules file: /lib/udev/rules.d/77-mm-qdl-device-blacklist.rules
Reading rules file: /lib/udev/rules.d/77-mm-simtech-port-types.rules
Reading rules file: /lib/udev/rules.d/77-mm-telit-port-types.rules
Reading rules file: /lib/udev/rules.d/77-mm-usb-device-blacklist.rules
Reading rules file: /lib/udev/rules.d/77-mm-usb-serial-adapters-greylist.rules
Reading rules file: /lib/udev/rules.d/77-mm-x22x-port-types.rules
Reading rules file: /lib/udev/rules.d/77-mm-zte-port-types.rules
Reading rules file: /lib/udev/rules.d/78-graphics-card.rules
Reading rules file: /lib/udev/rules.d/78-sound-card.rules             
Reading rules file: /lib/udev/rules.d/80-debian-compat.rules          
Reading rules file: /lib/udev/rules.d/80-docker-ce.rules              
Reading rules file: /lib/udev/rules.d/80-drivers.rules                
Reading rules file: /lib/udev/rules.d/80-ifupdown.rules
Reading rules file: /lib/udev/rules.d/80-iio-sensor-proxy.rules       
Reading rules file: /lib/udev/rules.d/80-libinput-device-groups.rules
Reading rules file: /lib/udev/rules.d/80-mm-candidate.rules           
Reading rules file: /lib/udev/rules.d/80-net-setup-link.rules         
Reading rules file: /lib/udev/rules.d/80-snappy-assign.rules          
Reading rules file: /lib/udev/rules.d/80-udisks2.rules                
Reading rules file: /lib/udev/rules.d/84-nm-drivers.rules             
Reading rules file: /lib/udev/rules.d/85-brltty.rules                 
Reading rules file: /lib/udev/rules.d/85-hdparm.rules                 
Reading rules file: /lib/udev/rules.d/85-hplj10xx.rules               
Reading rules file: /lib/udev/rules.d/85-nm-unmanaged.rules           
Reading rules file: /lib/udev/rules.d/85-regulatory.rules             
Reading rules file: /lib/udev/rules.d/90-alsa-restore.rules           
Reading rules file: /lib/udev/rules.d/90-console-setup.rules          
Reading rules file: /lib/udev/rules.d/90-fwupd-devices.rules          
Reading rules file: /lib/udev/rules.d/90-libgpod.rules                
Reading rules file: /lib/udev/rules.d/90-libinput-model-quirks.rules  
Reading rules file: /lib/udev/rules.d/90-pulseaudio.rules             
Reading rules file: /lib/udev/rules.d/92-libccid.rules                
Reading rules file: /lib/udev/rules.d/95-cd-devices.rules             
Reading rules file: /lib/udev/rules.d/95-upower-csr.rules             
Reading rules file: /lib/udev/rules.d/95-upower-hid.rules             
Reading rules file: /lib/udev/rules.d/95-upower-wup.rules             
Reading rules file: /lib/udev/rules.d/97-hid2hci.rules                
Reading rules file: /lib/udev/rules.d/99-systemd.rules                
rules contain 393216 bytes tokens (32768 * 12 bytes), 36008 bytes strings
24465 strings (207924 bytes), 21215 de-duplicated (175167 bytes), 3251 trie nodes used
value '[dmi/id]sys_vendor' is 'Apple Inc.'                            
value '[dmi/id]sys_vendor' is 'Apple Inc.'                            
GROUP 106 /lib/udev/rules.d/50-udev-default.rules:29                  
IMPORT builtin 'hwdb' /lib/udev/rules.d/60-evdev.rules:8              
RUN 'keyboard' /lib/udev/rules.d/60-evdev.rules:8                     
IMPORT builtin 'input_id' /lib/udev/rules.d/60-input-id.rules:5       
capabilities/ev raw kernel attribute: 120013                          
capabilities/abs raw kernel attribute: 0                              
capabilities/rel raw kernel attribute: 0                              
capabilities/key raw kernel attribute: e080ffdf01cfffff fffffffffffffffe
properties raw kernel attribute: 0 test_key: checking bit block 0 for any keys; found=1                  
test_key: checking bit block 64 for any keys; found=1                 
test_key: checking bit block 128 for any keys; found=1                
test_key: checking bit block 192 for any keys; found=1                
IMPORT builtin 'usb_id' /lib/udev/rules.d/60-persistent-input.rules:11
/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1.3/2-1.3.1/2-1.3.1:1. if_class 3 protocol 0
LINK 'input/by-id/usb-Yubico_Yubikey_NEO_OTP+U2F+CCID-event-kbd' /lib/udev/rules.d/60-persistent-input.rules:28
IMPORT builtin 'path_id' /lib/udev/rules.d/60-persistent-input.rules:35
LINK 'input/by-path/pci-0000:00:1d.7-usb-0:1.3.1:1.0-event-kbd' /lib/udev/rules.d/60-persistent-input.rules:37
RUN 'uaccess' /lib/udev/rules.d/73-seat-late.rules:15                 
PROGRAM 'libinput-device-group /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1.3/2-1.3.1/2-1.3.1:1.0/0003:1050:0116.0011/input/input22/event9' /lib/udev/rules.d/80-libinput-device-groups.rules:7
starting 'libinput-device-group /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1.3/2-1.3.1/2-1.3.1:1.0/0003:1050:0116.0011/input/input22/event9'
'libinput-device-group /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1.3/2-1.3.1/2-1.3.1:1.0/0003:1050:0116.0011/input/input22/event9'(out) '3/1050/116/110:usb-0000:00:1d.7-1.3'
Process 'libinput-device-group /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1.3/2-1.3.1/2-1.3.1:1.0/0003:1050:0116.0011/input/input22/event9' succeeded.
IMPORT builtin 'hwdb' /lib/udev/rules.d/90-libinput-model-quirks.rules:38
IMPORT builtin 'hwdb' returned non-zero                               
value '[dmi/id]modalias' is 'dmi:bvnAppleInc.:bvrIM121.88Z.0047.B1E.1110201314:bd10/20/11:svnAppleInc.:pniMac12,2:pvr1.0:rvnAppleInc.:rnMac-942B59F58194171B:rvriMac12,2:cvnAppleInc.:ct13:cvrMac-942B59F58194171B:'
IMPORT builtin 'hwdb' /lib/udev/rules.d/90-libinput-model-quirks.rules:42
IMPORT builtin 'hwdb' returned non-zero                               
IMPORT builtin 'hwdb' /lib/udev/rules.d/90-libinput-model-quirks.rules:46
IMPORT builtin 'hwdb' returned non-zero                               
handling device node '/dev/input/event9', devnum=c13:73, mode=0660, uid=0,gid=106
preserve permissions /dev/input/event9, 020660, uid=0, gid=106        
preserve already existing symlink '/dev/char/13:73' to '../input/event9'
found 'c13:73' claiming '/run/udev/links/\x2finput\x2fby-id\x2fusb-Yubico_Yubikey_NEO_OTP+U2F+CCID-event-kbd'
creating link '/dev/input/by-id/usb-Yubico_Yubikey_NEO_OTP+U2F+CCID-event-kbd' to '/dev/input/event9'
preserve already existing symlink '/dev/input/by-id/usb-Yubico_Yubikey_NEO_OTP+U2F+CCID-event-kbd' to '../event9'
found 'c13:73' claiming '/run/udev/links/\x2finput\x2fby-path\x2fpci-0000:00:1d.7-usb-0:1.3.1:1.0-event-kbd'
creating link '/dev/input/by-path/pci-0000:00:1d.7-usb-0:1.3.1:1.0-event-kbd' to
'/dev/input/event9'
preserve already existing symlink '/dev/input/by-path/pci-0000:00:1d.7-usb-0:1.3.1:1.0-event-kbd' to '../event9'
created db file '/run/udev/data/c13:73' for '/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1.3/2-1.3.1/2-1.3.1:1.0/0003:1050:0116.0011/input/input22/event9'
.INPUT_CLASS=kbd                   
.MM_USBIFNUM=00                    
ACTION=add                         
BACKSPACE=guess                    
DEVLINKS=/dev/input/by-id/usb-Yubico_Yubikey_NEO_OTP+U2F+CCID-event-kbd /dev/input/by-path/pci-0000:00:1d.7-usb-0:1.3.1:1.0-event-kbd       
DEVNAME=/dev/input/event9          
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1.3/2-1.3.1/2-1.3.1:1.0/0003:1050:0116.0011/input/input22/event9
ID_BUS=usb                         
ID_FOR_SEAT=input-pci-0000_00_1d_7-usb-0_1_3_1_1_0                    
ID_INPUT=1                         
ID_INPUT_KEY=1                     
ID_INPUT_KEYBOARD=1                
ID_MODEL=Yubikey_NEO_OTP+U2F+CCID  
ID_MODEL_ENC=Yubikey\x20NEO\x20OTP+U2F+CCID                           
ID_MODEL_ID=0116                   
ID_PATH=pci-0000:00:1d.7-usb-0:1.3.1:1.0                              
ID_PATH_TAG=pci-0000_00_1d_7-usb-0_1_3_1_1_0                          
ID_REVISION=0333                   
ID_SECURITY_TOKEN=1                
ID_SERIAL=Yubico_Yubikey_NEO_OTP+U2F+CCID                             
ID_TYPE=hid                        
ID_USB_DRIVER=usbhid               
ID_USB_INTERFACES=:030101:030000:0b0000:                              
ID_USB_INTERFACE_NUM=00            
ID_VENDOR=Yubico                   
ID_VENDOR_ENC=Yubico               
ID_VENDOR_ID=1050                  
LIBINPUT_DEVICE_GROUP=3/1050/116/110:usb-0000:00:1d.7-1.3             
MAJOR=13                           
MINOR=73                           
SUBSYSTEM=input                    
TAGS=:seat:power-switch:uaccess:   
USEC_INITIALIZED=1090409060        
XKBLAYOUT=us                       
XKBMODEL=pc105                     
XKBOPTIONS=                        
XKBVARIANT=                        
XKB_FIXED_LAYOUT="us"              
XKB_FIXED_VARIANT=""               
run: 'keyboard'                    
run: 'uaccess'                     
Unload module index                
Unloaded link configuration context.    

Por fim, o script que a regra do udev deve ativar:

#!/bin/bash

USERNAME="sean"
action=

logger "YubiKey Removed or Inserted, ${action}"

Não importa qual combinação de KERNEL , SUBSYSTEM , ATTRS ou ENV na regra do udev que eu uso, o script nunca parece ser acionado. Eu acabei de colocar apenas SYSTEM=="hidraw|usb|input" e depois de recarregar as regras nada aparece em syslog . Eu tentei /etc/init.d/udev restart , udevadm control -R e service udev reload , nada parece obter as regras em /etc/udev/rules.d para acionar.

Tanto quanto eu posso dizer, o /etc/udev/rules.d/99-yubikey.rules não está sendo carregado ou visto pelo udev (ele não está aparecendo na saída udevadm test ).

Alguma idéia sobre coisas que eu posso tentar fazer com que isso funcione?

    
por Sean Hagen 06.12.2017 / 00:11

2 respostas

1

Sua regra udev não está incluída na sua pergunta, mas no fórum Eu copiei um e modifiquei:

$ cat /etc/udev/rules.d/45-yubikey.rules
ACTION=="add", ATTRS{idVendor}=="1050", ATTRS{idProduct}=="0116", RUN+="/path/to/screensaver-unlock.sh"
ACTION=="remove", ATTRS{idVendor}=="1050", ATTRS{idProduct}=="0010", RUN+="/path/to/screensaver-locksh"

Observação: a ID do produto 0010 foi alterada para 0116 para corresponder às suas informações de udev .

Os scripts no fórum para bloquear e desbloquear a tela não são muito seguros, como os comentaristas apontaram.

Olhando para os comentários de hoje, lembro-me de garantir que o seu script seja sinalizado como executável:

chmod a+x /path/to/script.sh
    
por WinEunuuchs2Unix 15.12.2017 / 13:18
0

Bem, parece claro para mim que é um problema de nome de arquivo de regras. : P um erro de digitação pode se esconder facilmente no código.

  1. Não carregado pelo udev.

    Reading rules file: /lib/udev/rules.d/97-hid2hci.rules                
    Reading rules file: /lib/udev/rules.d/99-systemd.rules                
    rules contain 393216 bytes tokens (32768 * 12 bytes), 36008 bytes strings
    
  2. Verifique o nome do arquivo aqui (saída por op do comentário)

    $ stat /etc/udev/rules.d/99-yubikey-rules
    File: /etc/udev/rules.d/99-yubikey-rules 
    Size: 546 Blocks: 8 IO Block: 4096 regular file
    Device: 802h/2050d Inode: 14818409 Links: 1
    Access: (0664/-rw-rw-r--) Uid: ( 0/ root) Gid: ( 0/ root)
    Access: 2017-12-18 10:49:08.526648161 -0800
    Modify: 2017-12-18 10:49:08.546647827 -0800
    Change: 2017-12-18 10:49:08.622646564 -0800
    Birth: -
    

Correção:

Wrong    99-yubikey-rules
Correct  99-yubikey.rules 
    
por user.dz 03.04.2018 / 03:13

Tags