Quel est le problème avec cette règle udev?

Je lis à travers ce lien en essayant de faire la règle appropriée pour que les nœuds de périphériques BSG aient la propriété de groupe de la roue et des permissions de 0660. C'est la règle que j'ai:

[user@mylinux ~]$ cat /etc/udev/rules.d/bsg.rules NAME=="bsg/[0-9]:[0-9]:[0-9]:[0-9]", SUBSYSTEM=="bsg", GROUP=wheel, MODE=0660 

Mais ça ne fonctionne pas, comme cela montre:

 [user@mylinux ~]$ ls -l /dev/bsg total 0 crw-rw---- 1 root root 252, 0 Oct 30 06:02 0:0:0:0 

Voici la sortie de udevadm info -q all -n /dev/bsg/0:0:0:0 sur lequel je vais:

 P: /devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/bsg/0:0:0:0 N: bsg/0:0:0:0 S: char/252:0 E: UDEV_LOG=3 E: DEVPATH=/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/bsg/0:0:0:0 E: MAJOR=252 E: MINOR=0 E: DEVNAME=/dev/bsg/0:0:0:0 E: SUBSYSTEM=bsg E: DEVLINKS=/dev/char/252:0 

Maintenant, je suppose que la valeur N: bsg/0:0:0:0 est la key NAME que udev attend dans le file de règles. En fin de count, j'ai besoin d'avoir cette règle assez générique pour que n'importe quel nombre de périphériques BSG sera modifié de manière appropriée pour les permissions. Le nom NAME="bsg/[0-9]*:[0-9]*:[0-9]*:[0-9]*" . Cela ne marchait pas non plus.

Au cas où cela count, c'est sur CentOS 6.2.


Mise à jour de la question pour montrer la sortie du udevadm test comme suggéré par slm ci-dessous. J'ai changé le nom de mon file de règles en /etc/udev/rules.d/80-bsg.rules . Le nom du file semble être unique. Aucun changement pour le contenu du file. Voici la sortie du udevadm test :

 parse_file: reading '/lib/udev/rules.d/10-console.rules' as rules file parse_file: reading '/lib/udev/rules.d/10-dm.rules' as rules file parse_file: reading '/lib/udev/rules.d/11-dm-lvm.rules' as rules file parse_file: reading '/lib/udev/rules.d/13-dm-disk.rules' as rules file parse_file: reading '/etc/udev/rules.d/40-hplip.rules' as rules file parse_file: reading '/lib/udev/rules.d/40-isdn.rules' as rules file parse_file: reading '/lib/udev/rules.d/40-libgphoto2.rules' as rules file parse_file: reading '/lib/udev/rules.d/40-multipath.rules' as rules file parse_file: reading '/lib/udev/rules.d/40-redhat.rules' as rules file parse_file: reading '/lib/udev/rules.d/50-firmware.rules' as rules file parse_file: reading '/lib/udev/rules.d/50-udev-default.rules' as rules file parse_file: reading '/etc/udev/rules.d/56-hpmud_support.rules' as rules file parse_file: reading '/lib/udev/rules.d/60-cdrom_id.rules' as rules file parse_file: reading '/etc/udev/rules.d/60-fprint-autosuspend.rules' as rules file parse_file: reading '/lib/udev/rules.d/60-net.rules' as rules file parse_file: reading '/etc/udev/rules.d/60-pcmcia.rules' as rules file parse_file: reading '/lib/udev/rules.d/60-persistent-alsa.rules' as rules file parse_file: reading '/lib/udev/rules.d/60-persistent-input.rules' as rules file parse_file: reading '/lib/udev/rules.d/60-persistent-serial.rules' as rules file parse_file: reading '/lib/udev/rules.d/60-persistent-storage-tape.rules' as rules file parse_file: reading '/lib/udev/rules.d/60-persistent-storage.rules' as rules file parse_file: reading '/lib/udev/rules.d/60-persistent-v4l.rules' as rules file parse_file: reading '/etc/udev/rules.d/60-raw.rules' as rules file parse_file: reading '/lib/udev/rules.d/61-mobile-action.rules' as rules file parse_file: reading '/lib/udev/rules.d/61-option-modem-modeswitch.rules' as rules file parse_file: reading '/lib/udev/rules.d/61-persistent-storage-edd.rules' as rules file parse_file: reading '/lib/udev/rules.d/64-device-mapper.rules' as rules file parse_file: reading '/lib/udev/rules.d/64-md-raid.rules' as rules file parse_file: reading '/lib/udev/rules.d/65-libsane.rules' as rules file parse_file: reading '/lib/udev/rules.d/65-md-incremental.rules' as rules file parse_file: reading '/lib/udev/rules.d/70-acl.rules' as rules file parse_file: reading '/lib/udev/rules.d/70-anaconda.rules' as rules file parse_file: reading '/etc/udev/rules.d/70-cups-libusb.rules' as rules file parse_file: reading '/lib/udev/rules.d/70-hid2hci.rules' as rules file parse_file: reading '/etc/udev/rules.d/70-persistent-net.rules' as rules file parse_file: reading '/lib/udev/rules.d/70-printers.rules' as rules file parse_file: reading '/lib/udev/rules.d/75-cd-aliases-generator.rules' as rules file parse_file: reading '/lib/udev/rules.d/75-net-description.rules' as rules file parse_file: reading '/lib/udev/rules.d/75-persistent-net-generator.rules' as rules file parse_file: reading '/lib/udev/rules.d/75-tty-description.rules' as rules file parse_file: reading '/lib/udev/rules.d/77-mm-ericsson-mbm.rules' as rules file parse_file: reading '/lib/udev/rules.d/77-mm-longcheer-port-types.rules' as rules file parse_file: reading '/lib/udev/rules.d/77-mm-pcmcia-device-blacklist.rules' as rules file parse_file: reading '/lib/udev/rules.d/77-mm-platform-serial-whitelist.rules' as rules file parse_file: reading '/lib/udev/rules.d/77-mm-simtech-port-types.rules' as rules file parse_file: reading '/lib/udev/rules.d/77-mm-usb-device-blacklist.rules' as rules file parse_file: reading '/lib/udev/rules.d/77-mm-zte-port-types.rules' as rules file parse_file: reading '/lib/udev/rules.d/77-nm-olpc-mesh.rules' as rules file parse_file: reading '/lib/udev/rules.d/78-sound-card.rules' as rules file parse_file: reading '/lib/udev/rules.d/79-fstab_import.rules' as rules file parse_file: reading '/etc/udev/rules.d/80-bsg.rules' as rules file parse_file: reading '/lib/udev/rules.d/80-drivers.rules' as rules file parse_file: reading '/lib/udev/rules.d/80-udisks.rules' as rules file parse_file: reading '/lib/udev/rules.d/85-regulatory.rules' as rules file parse_file: reading '/lib/udev/rules.d/88-clock.rules' as rules file parse_file: reading '/etc/udev/rules.d/90-alsa.rules' as rules file parse_file: reading '/etc/udev/rules.d/90-hal.rules' as rules file parse_file: reading '/lib/udev/rules.d/90-pulseaudio.rules' as rules file parse_file: reading '/etc/udev/rules.d/91-drm-modeset.rules' as rules file parse_file: reading '/lib/udev/rules.d/95-devkit-power-battery-recall-dell.rules' as rules file parse_file: reading '/lib/udev/rules.d/95-devkit-power-battery-recall-fujitsu.rules' as rules file parse_file: reading '/lib/udev/rules.d/95-devkit-power-battery-recall-gateway.rules' as rules file parse_file: reading '/lib/udev/rules.d/95-devkit-power-battery-recall-ibm.rules' as rules file parse_file: reading '/lib/udev/rules.d/95-devkit-power-battery-recall-lenovo.rules' as rules file parse_file: reading '/lib/udev/rules.d/95-devkit-power-battery-recall-toshiba.rules' as rules file parse_file: reading '/lib/udev/rules.d/95-devkit-power-csr.rules' as rules file parse_file: reading '/lib/udev/rules.d/95-devkit-power-hid.rules' as rules file parse_file: reading '/lib/udev/rules.d/95-devkit-power-wup.rules' as rules file parse_file: reading '/lib/udev/rules.d/95-dm-notify.rules' as rules file parse_file: reading '/lib/udev/rules.d/95-keymap.rules' as rules file parse_file: reading '/lib/udev/rules.d/95-udev-late.rules' as rules file parse_file: reading '/etc/udev/rules.d/98-kexec.rules' as rules file parse_file: reading '/etc/udev/rules.d/99-fuse.rules' as rules file parse_file: reading '/dev/.udev/rules.d/99-root.rules' as rules file udev_rules_new: rules use 141480 bytes tokens (11790 * 12 bytes), 29125 bytes buffer udev_rules_new: temporary index used 50200 bytes (2510 * 20 bytes) udev_device_new_from_syspath: device 0x89af120 has devpath '/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/bsg/0:0:0:0' udev_device_new_from_syspath: device 0x89c7ac0 has devpath '/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/bsg/0:0:0:0' udev_device_read_db: device 0x89c7ac0 filled with db symlink data '/dev/bsg/0:0:0:0' udev_rules_apply_to_event: LINK 'char/252:0' /lib/udev/rules.d/50-udev-default.rules:4 udev_device_new_from_syspath: device 0x89b0d48 has devpath '/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0' udev_rules_apply_to_event: RUN 'socket:@/org/freedesktop/hal/udev_event' /etc/udev/rules.d/90-hal.rules:2 udev_event_execute_rules: no node name set, will use kernel supplied name 'bsg/0:0:0:0' udev_device_update_db: create db link (bsg/0:0:0:0 char/252:0) udev_device_update_db: unable to create db file '/dev/.udev/db/bsg:0:0:0:0': No such file or directory udev_node_add: creating device node '/dev/bsg/0:0:0:0', devnum=252:0, mode=0660, uid=0, gid=0 udev_node_mknod: preserve file '/dev/bsg/0:0:0:0', because it has correct dev_t udev_node_mknod: preserve permissions /dev/bsg/0:0:0:0, 020660, uid=0, gid=0 node_symlink: preserve already existing symlink '/dev/char/252:0' to '../bsg/0:0:0:0' udevadm_test: UDEV_LOG=6 udevadm_test: DEVPATH=/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/bsg/0:0:0:0 udevadm_test: MAJOR=252 udevadm_test: MINOR=0 udevadm_test: DEVNAME=/dev/bsg/0:0:0:0 udevadm_test: ACTION=add udevadm_test: SUBSYSTEM=bsg udevadm_test: DEVLINKS=/dev/char/252:0 udevadm_test: run: 'socket:@/org/freedesktop/hal/udev_event' 

Essayez de changer le nom de votre file de règles afin qu'il soit préfixé avec un nombre. Peut-être quelque chose comme ça:

 /etc/udev/rules.d/99-bsg.rules 

Vous pouvez également tester votre file de règles en utilisant le udevadm test :

 $ udevadm test /devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/bsg/0:0:0:0 

Les references

  • udev – Wiki ArchLinux