Skip to contentSkip to conversation

group is not set properly for usb printer for older kernels

DISCUSSION Andreas Radke 4 participants 20 messages Oct 8, 2009 – Oct 20, 2009

lore
Share & tools
lore
#0 lore raw

Hi, I'm maintaining the ArchLinux kernel 2.6.27.xx series + cups packages.

We added the git fix for libusb "lp" group required by new cups 1.4.x to our udev 146 pkg, this fix is working with kernels 2.6.30 and 2.6.31 but fails with our 2.6.27.xx kernels. The kernel config is modified only in a few parts.

With kernel 2.6.27.xx the rule is well applied on cold boot but whenever I switch power off and on the printer devices stays in root group. Every udev call done by hand like udevadm trigger or test "fixes" the group permission.

usb 4-2: new full speed USB device using ohci_hcd and address 2 usb 4-2: configuration #1 chosen from 1 choice [root@server64 andyrtr]# ls -lhR /dev/bus/usb/004/002 crw-rw-r-- 1 root root 189, 385 8. Okt 19:01 /dev/bus/usb/004/002 [root@server64 andyrtr]# udevadm trigger
[root@server64 andyrtr]# ls -lhR /dev/bus/usb/004/002 crw-rw---- 1 root lp 189, 385 8. Okt 19:01 /dev/bus/usb/004/002

Any idea what cause can this odd behaviour and how to fix it?

-Andy

run_command: calling: test
udevadm_test: version 146
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.

parse_file: reading '/lib/udev/rules.d/40-alsa.rules' as rules file
parse_file: reading '/lib/udev/rules.d/40-infiniband.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-pilot-links.rules' as rules file
parse_file: reading '/lib/udev/rules.d/40-zaptel.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 '/lib/udev/rules.d/53-sane.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-cdrom_id.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 '/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/70-acl.rules' as rules file
parse_file: reading '/lib/udev/rules.d/70-hid2hci.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-tty-description.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 '/lib/udev/rules.d/80-drivers.rules' as rules file
parse_file: reading '/lib/udev/rules.d/81-arch.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
udev_rules_new: rules use 60576 bytes tokens (5048 * 12 bytes), 15168 bytes buffer
udev_rules_new: temporary index used 24160 bytes (1208 * 20 bytes)
udev_device_new_from_syspath: device 0xb4c140 has devpath '/devices/pci0000:00/0000:00:04.0/usb4/4-2'
udev_device_new_from_syspath: device 0xb56000 has devpath '/devices/pci0000:00/0000:00:04.0/usb4/4-2'
udev_device_read_db: device 0xb56000 filled with db file data
udev_rules_apply_to_event: LINK 'char/189:386' /lib/udev/rules.d/50-udev-default.rules:4
udev_rules_apply_to_event: MODE 0664 /lib/udev/rules.d/50-udev-default.rules:54
udev_rules_apply_to_event: NAME 'bus/usb/004/003' /lib/udev/rules.d/50-udev-default.rules:54
udev_rules_apply_to_event: IMPORT 'usb_id --export /devices/pci0000:00/0000:00:04.0/usb4/4-2' /lib/udev/rules.d/50-udev-default.rules:65
util_run_program: 'usb_id --export /devices/pci0000:00/0000:00:04.0/usb4/4-2' started
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_VENDOR=Lexmark_International__Inc.'
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_VENDOR_ENC=Lexmark\x20International\x2c\x20Inc.'
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_VENDOR_ID3d'
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_MODEL=Lexmark_Optra_E312'
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_MODEL_ENC=Lexmark\x20Optra\x20E312'
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_MODEL_ID0c'
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_REVISION00'
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_SERIAL=Lexmark_International__Inc._Lexmark_Optra_E312_8050926'
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_SERIAL_SHORT€50926'
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_BUS=usb'
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_USB_INTERFACES=:070102:'
util_run_program: 'usb_id --export /devices/pci0000:00/0000:00:04.0/usb4/4-2' returned with exitcode 0
udev_rules_apply_to_event: GROUP 7 /lib/udev/rules.d/50-udev-default.rules:66
udev_rules_apply_to_event: MODE 0660 /lib/udev/rules.d/50-udev-default.rules:66
udev_device_new_from_syspath: device 0xb58a00 has devpath '/devices/pci0000:00/0000:00:04.0/usb4'
udev_device_new_from_syspath: device 0xb58ce0 has devpath '/devices/pci0000:00/0000:00:04.0'
udev_device_new_from_syspath: device 0xb58f90 has devpath '/devices/pci0000:00'
udev_device_update_db: created db file for '/devices/pci0000:00/0000:00:04.0/usb4/4-2' in '/dev/.udev/db/\x2fdevices\x2fpci0000:00\x2f0000:00:04.0\x2fusb4\x2f4-2'
udev_node_add: creating device node '/dev/bus/usb/004/003', devnum9:386, mode60, uid=0, gid=7
udev_node_mknod: preserve file '/dev/bus/usb/004/003', because it has correct dev_t
udev_node_mknod: chmod(/dev/bus/usb/004/003, 020660)
udev_node_mknod: chown(/dev/bus/usb/004/003, 0, 7)
update_link: found 2 devices with name '/dev/char/189:386'
udev_device_new_from_syspath: device 0xb59430 has devpath '/devices/pci0000:00/0000:00:04.0/usb4/4-2/usb_device/usbdev4.3'
udev_device_read_db: device 0xb59430 filled with db symlink data '/dev/usbdev4.3'
update_link: '/dev/char/189:386' with target '/dev/bus/usb/004/003' has the highest priority 0, create it
node_symlink: atomically replace '/dev/char/189:386'
udevadm_test: UDEV_LOG=6
udevadm_test: DEVPATH=/devices/pci0000:00/0000:00:04.0/usb4/4-2
udevadm_test: MAJOR9
udevadm_test: MINOR86
udevadm_test: DEVTYPE=usb_device
udevadm_test: DRIVER=usb
udevadm_test: DEVICE=/proc/bus/usb/004/003
udevadm_test: PRODUCTCd/c/100
udevadm_test: TYPE=0/0/0
udevadm_test: BUSNUM4
udevadm_test: DEVNUM3
udevadm_test: ACTION­d
udevadm_test: SUBSYSTEM=usb
udevadm_test: DEVLINKS=/dev/char/189:386
udevadm_test: ID_VENDOR=Lexmark_International__Inc.
udevadm_test: ID_VENDOR_ENC=Lexmark\x20International\x2c\x20Inc.
udevadm_test: ID_VENDOR_ID3d
udevadm_test: ID_MODEL=Lexmark_Optra_E312
udevadm_test: ID_MODEL_ENC=Lexmark\x20Optra\x20E312
udevadm_test: ID_MODEL_ID0c
udevadm_test: ID_REVISION00
udevadm_test: ID_SERIAL=Lexmark_International__Inc._Lexmark_Optra_E312_8050926
udevadm_test: ID_SERIAL_SHORT€50926
udevadm_test: ID_BUS=usb
udevadm_test: ID_USB_INTERFACES=:070102:
udevadm_test: DEVNAME=/dev/bus/usb/004/003
[root@server64 andyrtr]# uname -a
Linux server64 2.6.27.36-lts #1 SMP Tue Oct 6 17:43:43 UTC 2009 x86_64
AMD Athlon(tm) X2 Dual Core Processor BE-2300 AuthenticAMD GNU/Linux

#1 lore raw
Quoted 13 lines · Andreas Radke

Hi, I'm maintaining the ArchLinux kernel 2.6.27.xx series + cups packages.

We added the git fix for libusb "lp" group required by new cups 1.4.x to our udev 146 pkg, this fix is working with kernels 2.6.30 and 2.6.31 but fails with our 2.6.27.xx kernels. The kernel config is modified only in a few parts.

With kernel 2.6.27.xx the rule is well applied on cold boot but whenever I switch power off and on the printer devices stays in root group. Every udev call done by hand like udevadm trigger or test "fixes" the group permission.

Quoted 5 lines

update_link: found 2 devices with name '/dev/char/189:386'
udev_device_new_from_syspath: device 0xb59430 has devpath '/devices/pci0000:00/0000:00:04.0/usb4/4-2/usb_device/usbdev4.3'
udev_device_read_db: device 0xb59430 filled with db symlink data '/dev/usbdev4.3'
update_link: '/dev/char/189:386' with target '/dev/bus/usb/004/003' has the highest priority 0, create it
node_symlink: atomically replace '/dev/char/189:386'

Not sure if that is related, but it looks weird. How can two devices claim the same major/minor?

What's in /dev/.udev/names/ for that device node/symlink?

Kay

#2 lore raw
In reply to Andreas Radke

should be this:

[root@server64 andyrtr]# ls -1hR /dev/.udev/names/usbdev4.5 /dev/.udev/names/usbdev4.5:
\x2fdevices\x2fpci0000:00\x2f0000:00:04.0\x2fusb4\x2f4-2\x2fusb_device\x2fusbdev4.5

udevadm monitor -e --udev shows this:

UDEV [1255025639.950847] add /devices/pci0000:00/0000:00:04.0/usb4/4-2 (usb)
UDEV_LOG=0
ACTION­d DEVPATH=/devices/pci0000:00/0000:00:04.0/usb4/4-2 SUBSYSTEM=usb
DEVTYPE=usb_device
DEVICE=/proc/bus/usb/004/005
PRODUCTCd/c/100
TYPE=0/0/0
BUSNUM4
DEVNUM5
SEQNUM19
ID_VENDOR=Lexmark_International__Inc. ID_VENDOR_ENC=Lexmark\x20International\x2c\x20Inc. ID_VENDOR_ID3d
ID_MODEL=Lexmark_Optra_E312 ID_MODEL_ENC=Lexmark\x20Optra\x20E312
ID_MODEL_ID0c
ID_REVISION00 ID_SERIAL=Lexmark_International__Inc._Lexmark_Optra_E312_8050926 ID_SERIAL_SHORT€50926
ID_BUS=usb
ID_USB_INTERFACES=:070102:
DEVNAME=/dev/bus/usb/004/005
MAJOR9
MINOR88
DEVLINKS=/dev/char/189:388

UDEV [1255025639.952481] add /devices/pci0000:00/0000:00:04.0/usb4/4-2/usb_endpoint/usbdev4.5_ep00 (usb_endpoint)
UDEV_LOG=0
ACTION­d DEVPATH=/devices/pci0000:00/0000:00:04.0/usb4/4-2/usb_endpoint/usbdev4.5_ep00 SUBSYSTEM=usb_endpoint
SEQNUM24
DEVNAME=/dev/usbdev4.5_ep00
MAJOR%3
MINOR
DEVLINKS=/dev/char/253:10

UDEV [1255025639.959575] add /devices/pci0000:00/0000:00:04.0/usb4/4-2/usb_device/usbdev4.5 (usb_device)
UDEV_LOG=0
ACTION­d DEVPATH=/devices/pci0000:00/0000:00:04.0/usb4/4-2/usb_device/usbdev4.5 SUBSYSTEM=usb_device
SEQNUM23
DEVNAME=/dev/usbdev4.5
MAJOR9
MINOR88
DEVLINKS=/dev/char/189:388

UDEV [1255025639.986799] add /devices/pci0000:00/0000:00:04.0/usb4/4-2/4-2:1.0 (usb)
UDEV_LOG=0
ACTION­d DEVPATH=/devices/pci0000:00/0000:00:04.0/usb4/4-2/4-2:1.0 SUBSYSTEM=usb
DEVTYPE=usb_interface DEVICE=/proc/bus/usb/004/005
PRODUCTCd/c/100
TYPE=0/0/0
INTERFACE=7/1/2 MODALIAS=usb:v043Dp000Cd0100dc00dsc00dp00ic07isc01ip02 SEQNUM20

UDEV [1255025639.987745] add /devices/pci0000:00/0000:00:04.0/usb4/4-2/4-2:1.0/usb_endpoint/usbdev4.5_ep81 (usb_endpoint)
UDEV_LOG=0
ACTION­d DEVPATH=/devices/pci0000:00/0000:00:04.0/usb4/4-2/4-2:1.0/usb_endpoint/usbdev4.5_ep81 SUBSYSTEM=usb_endpoint
SEQNUM22
DEVNAME=/dev/usbdev4.5_ep81
MAJOR%3
MINOR=9
DEVLINKS=/dev/char/253:9

UDEV [1255025639.987812] add /devices/pci0000:00/0000:00:04.0/usb4/4-2/4-2:1.0/usb_endpoint/usbdev4.5_ep01 (usb_endpoint)
UDEV_LOG=0
ACTION­d DEVPATH=/devices/pci0000:00/0000:00:04.0/usb4/4-2/4-2:1.0/usb_endpoint/usbdev4.5_ep01 SUBSYSTEM=usb_endpoint
SEQNUM21
DEVNAME=/dev/usbdev4.5_ep01
MAJOR%3
MINOR=8
DEVLINKS=/dev/char/253:8

[root@server64 andyrtr]# ls -lhR /dev/bus/usb/004/005 crw-rw-r-- 1 root root 189, 388 8. Okt 20:13 /dev/bus/usb/004/005

...
Andy

#3 lore raw
In reply to Andreas Radke
Quoted 5 lines · Andreas Radke

should be this:

[root@server64 andyrtr]# ls -1hR /dev/.udev/names/usbdev4.5 /dev/.udev/names/usbdev4.5:
\x2fdevices\x2fpci0000:00\x2f0000:00:04.0\x2fusb4\x2f4-2\x2fusb_device\x2fusbdev4.5

usbdev4.5 should not exist with recent kernels, the device nodes are provided by the usb bus device directly. Do you have:
CONFIG_USB_CLASS_DEVICE enabled?

Kay

#4 lore raw
In reply to Andreas Radke

Am Thu, 8 Oct 2009 20:24:14 +0200
schrieb Kay Sievers <[email protected]>:

Quoted 7 lines · Andreas Radke
Quoted 5 lines

should be this:

[root@server64 andyrtr]# ls -1hR /dev/.udev/names/usbdev4.5 /dev/.udev/names/usbdev4.5:
\x2fdevices\x2fpci0000:00\x2f0000:00:04.0\x2fusb4\x2f4-2\x2fusb_device\x2fusbdev4.5

Quoted 6 lines

usbdev4.5 should not exist with recent kernels, the device nodes are provided by the usb bus device directly. Do you have:
CONFIG_USB_CLASS_DEVICE enabled?

Kay

Yes. It's enabled:

config 2.6.27.31:

#
# Miscellaneous USB options
#
CONFIG_USB_DEVICEFS=y
CONFIG_USB_DEVICE_CLASS=y
CONFIG_USB_DYNAMIC_MINORS=y
CONFIG_USB_SUSPEND=y
# CONFIG_USB_OTG is not set
CONFIG_USB_MON=y

config 2.6.31.2:

#
# Miscellaneous USB options
#
CONFIG_USB_DEVICEFS=y
CONFIG_USB_DEVICE_CLASS=y
CONFIG_USB_DYNAMIC_MINORS=y
CONFIG_USB_SUSPEND=y
# CONFIG_USB_OTG is not set
CONFIG_USB_MON=m
CONFIG_USB_WUSB=m
CONFIG_USB_WUSB_CBAF=m
# CONFIG_USB_WUSB_CBAF_DEBUG is not set

-Andy

#5 lore raw
In reply to Andreas Radke
Quoted 10 lines · Andreas Radke

Am Thu, 8 Oct 2009 20:24:14 +0200
schrieb Kay Sievers <[email protected]>:

Quoted 7 lines · Andreas Radke
Quoted 5 lines

should be this:

[root@server64 andyrtr]# ls -1hR /dev/.udev/names/usbdev4.5 /dev/.udev/names/usbdev4.5:
\x2fdevices\x2fpci0000:00\x2f0000:00:04.0\x2fusb4\x2f4-2\x2fusb_device\x2fusbdev4.5

Quoted 8 lines
Quoted 6 lines

usbdev4.5 should not exist with recent kernels, the device nodes are provided by the usb bus device directly. Do you have:
CONFIG_USB_CLASS_DEVICE enabled?

Kay

Yes. It's enabled:

If you get rid of it, all should work.

Kay

#6 lore raw
In reply to Andreas Radke

Am Thu, 8 Oct 2009 21:05:00 +0200
schrieb Kay Sievers <[email protected]>:

Quoted 16 lines · Andreas Radke
Quoted 15 lines

Am Thu, 8 Oct 2009 20:24:14 +0200
schrieb Kay Sievers <[email protected]>:

Quoted 12 lines
Quoted 5 lines · Andreas Radke

should be this:

[root@server64 andyrtr]# ls -1hR /dev/.udev/names/usbdev4.5 /dev/.udev/names/usbdev4.5:
\x2fdevices\x2fpci0000:00\x2f0000:00:04.0\x2fusb4\x2f4-2\x2fusb_device\x2fusbdev4.5

usbdev4.5 should not exist with recent kernels, the device nodes are provided by the usb bus device directly. Do you have:
CONFIG_USB_CLASS_DEVICE enabled?

Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

Kay

Yes. It's enabled:

If you get rid of it, all should work.

Kay

Sadly not.

#
# Miscellaneous USB options
#
CONFIG_USB_DEVICEFS=y
# CONFIG_USB_DEVICE_CLASS is not set
CONFIG_USB_DYNAMIC_MINORS=y
CONFIG_USB_SUSPEND=y
# CONFIG_USB_OTG is not set
CONFIG_USB_MON=y

[root@server64 andyrtr]# ls -lhR /dev/bus/usb/004/ /dev/bus/usb/004/:
insgesamt 0
crw-rw-r-- 1 root root 189, 384 8. Okt 22:03 001 crw-rw-r-- 1 root root 189, 387 8. Okt 22:09 004

UDEV [1255032558.475180] add /devices/pci0000:00/0000:00:04.0/usb4/4-2 (usb)
UDEV_LOG=0
ACTION­d DEVPATH=/devices/pci0000:00/0000:00:04.0/usb4/4-2 SUBSYSTEM=usb
DEVTYPE=usb_device
DEVICE=/proc/bus/usb/004/004
PRODUCTCd/c/100
TYPE=0/0/0
BUSNUM4
DEVNUM4
SEQNUM94
ID_VENDOR=Lexmark_International__Inc. ID_VENDOR_ENC=Lexmark\x20International\x2c\x20Inc. ID_VENDOR_ID3d
ID_MODEL=Lexmark_Optra_E312 ID_MODEL_ENC=Lexmark\x20Optra\x20E312
ID_MODEL_ID0c
ID_REVISION00 ID_SERIAL=Lexmark_International__Inc._Lexmark_Optra_E312_8050926 ID_SERIAL_SHORT€50926
ID_BUS=usb
ID_USB_INTERFACES=:070102:
DEVNAME=/dev/bus/usb/004/004
MAJOR9
MINOR87
DEVLINKS=/dev/char/189:387

UDEV [1255032558.475831] add /devices/pci0000:00/0000:00:04.0/usb4/4-2/usb_endpoint/usbdev4.4_ep00 (usb_endpoint)
UDEV_LOG=0
ACTION­d DEVPATH=/devices/pci0000:00/0000:00:04.0/usb4/4-2/usb_endpoint/usbdev4.4_ep00 SUBSYSTEM=usb_endpoint
SEQNUM98
DEVNAME=/dev/usbdev4.4_ep00
MAJOR%3
MINOR
DEVLINKS=/dev/char/253:10

UDEV [1255032558.504858] add /devices/pci0000:00/0000:00:04.0/usb4/4-2/4-2:1.0 (usb)
UDEV_LOG=0
ACTION­d DEVPATH=/devices/pci0000:00/0000:00:04.0/usb4/4-2/4-2:1.0 SUBSYSTEM=usb
DEVTYPE=usb_interface DEVICE=/proc/bus/usb/004/004
PRODUCTCd/c/100
TYPE=0/0/0
INTERFACE=7/1/2 MODALIAS=usb:v043Dp000Cd0100dc00dsc00dp00ic07isc01ip02 SEQNUM95

UDEV [1255032558.505436] add /devices/pci0000:00/0000:00:04.0/usb4/4-2/4-2:1.0/usb_endpoint/usbdev4.4_ep01 (usb_endpoint)
UDEV_LOG=0
ACTION­d DEVPATH=/devices/pci0000:00/0000:00:04.0/usb4/4-2/4-2:1.0/usb_endpoint/usbdev4.4_ep01 SUBSYSTEM=usb_endpoint
SEQNUM96
DEVNAME=/dev/usbdev4.4_ep01
MAJOR%3
MINOR=8
DEVLINKS=/dev/char/253:8

UDEV [1255032558.505498] add /devices/pci0000:00/0000:00:04.0/usb4/4-2/4-2:1.0/usb_endpoint/usbdev4.4_ep81 (usb_endpoint)
UDEV_LOG=0
ACTION­d DEVPATH=/devices/pci0000:00/0000:00:04.0/usb4/4-2/4-2:1.0/usb_endpoint/usbdev4.4_ep81 SUBSYSTEM=usb_endpoint
SEQNUM97
DEVNAME=/dev/usbdev4.4_ep81
MAJOR%3
MINOR=9
DEVLINKS=/dev/char/253:9

[root@server64 andyrtr]# ls -lhR /dev/.udev/names/usbdev4.4*
/dev/.udev/names/usbdev4.4_ep00:
insgesamt 0
-rw-r--r-- 1 root root 0 8. Okt 22:09 \x2fdevices\x2fpci0000:00\x2f0000:00:04.0\x2fusb4\x2f4-2\x2fusb_endpoint\x2fusbdev4.4_ep00

/dev/.udev/names/usbdev4.4_ep01:
insgesamt 0
-rw-r--r-- 1 root root 0 8. Okt 22:09 \x2fdevices\x2fpci0000:00\x2f0000:00:04.0\x2fusb4\x2f4-2\x2f4-2:1.0\x2fusb_endpoint\x2fusbdev4.4_ep01

/dev/.udev/names/usbdev4.4_ep81:
insgesamt 0
-rw-r--r-- 1 root root 0 8. Okt 22:09 \x2fdevices\x2fpci0000:00\x2f0000:00:04.0\x2fusb4\x2f4-2\x2f4-2:1.0\x2fusb_endpoint\x2fusbdev4.4_ep81

another idea?

-Andy

#7 lore raw
In reply to Andreas Radke
Quoted 133 lines · Andreas Radke

Am Thu, 8 Oct 2009 21:05:00 +0200
schrieb Kay Sievers <[email protected]>:

Quoted 16 lines · Andreas Radke
Quoted 15 lines

Am Thu, 8 Oct 2009 20:24:14 +0200
schrieb Kay Sievers <[email protected]>:

Quoted 12 lines
Quoted 5 lines · Andreas Radke

should be this:

[root@server64 andyrtr]# ls -1hR /dev/.udev/names/usbdev4.5 /dev/.udev/names/usbdev4.5:
\x2fdevices\x2fpci0000:00\x2f0000:00:04.0\x2fusb4\x2f4-2\x2fusb_device\x2fusbdev4.5

usbdev4.5 should not exist with recent kernels, the device nodes are provided by the usb bus device directly. Do you have:
CONFIG_USB_CLASS_DEVICE enabled?

Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

Kay

Yes. It's enabled:

If you get rid of it, all should work.

Kay

Sadly not.

#
# Miscellaneous USB options
#
CONFIG_USB_DEVICEFS=y
# CONFIG_USB_DEVICE_CLASS is not set
CONFIG_USB_DYNAMIC_MINORS=y
CONFIG_USB_SUSPEND=y
# CONFIG_USB_OTG is not set
CONFIG_USB_MON=y

[root@server64 andyrtr]# ls -lhR /dev/bus/usb/004/ /dev/bus/usb/004/:
insgesamt 0
crw-rw-r-- 1 root root 189, 384  8. Okt 22:03 001 crw-rw-r-- 1 root root 189, 387  8. Okt 22:09 004

UDEV  [1255032558.475180] add      /devices/pci0000:00/0000:00:04.0/usb4/4-2 (usb) UDEV_LOG=0
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:04.0/usb4/4-2
SUBSYSTEM=usb
DEVTYPE=usb_device
DEVICE=/proc/bus/usb/004/004
PRODUCTCd/c/100
TYPE=0/0/0
BUSNUM4
DEVNUM4
SEQNUM94
ID_VENDOR=Lexmark_International__Inc. ID_VENDOR_ENC=Lexmark\x20International\x2c\x20Inc.
ID_VENDOR_ID3d
ID_MODEL=Lexmark_Optra_E312
ID_MODEL_ENC=Lexmark\x20Optra\x20E312
ID_MODEL_ID0c
ID_REVISION00 ID_SERIAL=Lexmark_International__Inc._Lexmark_Optra_E312_8050926 ID_SERIAL_SHORT€50926
ID_BUS=usb
ID_USB_INTERFACES=:070102:
DEVNAME=/dev/bus/usb/004/004
MAJOR9
MINOR87
DEVLINKS=/dev/char/189:387

UDEV  [1255032558.475831] add      /devices/pci0000:00/0000:00:04.0/usb4/4-2/usb_endpoint/usbdev4.4_ep00 (usb_endpoint) UDEV_LOG=0
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:04.0/usb4/4-2/usb_endpoint/usbdev4.4_ep00
SUBSYSTEM=usb_endpoint
SEQNUM98
DEVNAME=/dev/usbdev4.4_ep00
MAJOR%3
MINOR
DEVLINKS=/dev/char/253:10

UDEV  [1255032558.504858] add      /devices/pci0000:00/0000:00:04.0/usb4/4-2/4-2:1.0 (usb) UDEV_LOG=0
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:04.0/usb4/4-2/4-2:1.0
SUBSYSTEM=usb
DEVTYPE=usb_interface
DEVICE=/proc/bus/usb/004/004
PRODUCTCd/c/100
TYPE=0/0/0
INTERFACE=7/1/2
MODALIAS=usb:v043Dp000Cd0100dc00dsc00dp00ic07isc01ip02
SEQNUM95

UDEV  [1255032558.505436] add      /devices/pci0000:00/0000:00:04.0/usb4/4-2/4-2:1.0/usb_endpoint/usbdev4.4_ep01 (usb_endpoint) UDEV_LOG=0
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:04.0/usb4/4-2/4-2:1.0/usb_endpoint/usbdev4.4_ep01
SUBSYSTEM=usb_endpoint
SEQNUM96
DEVNAME=/dev/usbdev4.4_ep01
MAJOR%3
MINOR=8
DEVLINKS=/dev/char/253:8

UDEV  [1255032558.505498] add      /devices/pci0000:00/0000:00:04.0/usb4/4-2/4-2:1.0/usb_endpoint/usbdev4.4_ep81 (usb_endpoint) UDEV_LOG=0
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:04.0/usb4/4-2/4-2:1.0/usb_endpoint/usbdev4.4_ep81
SUBSYSTEM=usb_endpoint
SEQNUM97
DEVNAME=/dev/usbdev4.4_ep81
MAJOR%3
MINOR=9
DEVLINKS=/dev/char/253:9

[root@server64 andyrtr]# ls -lhR  /dev/.udev/names/usbdev4.4*
/dev/.udev/names/usbdev4.4_ep00:
insgesamt 0
-rw-r--r-- 1 root root 0  8. Okt 22:09 \x2fdevices\x2fpci0000:00\x2f0000:00:04.0\x2fusb4\x2f4-2\x2fusb_endpoint\x2fusbdev4.4_ep00

/dev/.udev/names/usbdev4.4_ep01:
insgesamt 0
-rw-r--r-- 1 root root 0  8. Okt 22:09 \x2fdevices\x2fpci0000:00\x2f0000:00:04.0\x2fusb4\x2f4-2\x2f4-2:1.0\x2fusb_endpoint\x2fusbdev4.4_ep01

Quoted 6 lines

/dev/.udev/names/usbdev4.4_ep81:
insgesamt 0
-rw-r--r-- 1 root root 0  8. Okt 22:09 \x2fdevices\x2fpci0000:00\x2f0000:00:04.0\x2fusb4\x2f4-2\x2f4-2:1.0\x2fusb_endpoint\x2fusbdev4.4_ep81

another idea?

What does:
udevadm test /devices/pci0000:00/0000:00:04.0/usb4/4-2
print?

Kay

#8 lore raw
In reply to Andreas Radke

Am Fri, 9 Oct 2009 00:38:18 +0200
schrieb Kay Sievers <[email protected]>:

Quoted 6 lines

What does:
udevadm test /devices/pci0000:00/0000:00:04.0/usb4/4-2
print?

Kay

[root@server64 andyrtr]# udevadm test /devices/pci0000:00/0000:00:04.0/usb4/4-2
run_command: calling: test
udevadm_test: version 146
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.

parse_file: reading '/lib/udev/rules.d/40-alsa.rules' as rules file
parse_file: reading '/lib/udev/rules.d/40-infiniband.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-pilot-links.rules' as rules file
parse_file: reading '/lib/udev/rules.d/40-zaptel.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 '/lib/udev/rules.d/53-sane.rules' as rules file
parse_file: reading '/etc/udev/rules.d/54-gphoto.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-cdrom_id.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 '/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/70-acl.rules' as rules file
parse_file: reading '/lib/udev/rules.d/70-hid2hci.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-tty-description.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 '/lib/udev/rules.d/80-drivers.rules' as rules file
parse_file: reading '/lib/udev/rules.d/81-arch.rules' as rules file
parse_file: reading '/etc/udev/rules.d/90-hal.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/device-mapper.rules' as rules file
udev_rules_new: rules use 118668 bytes tokens (9889 * 12 bytes), 18685 bytes buffer
udev_rules_new: temporary index used 37200 bytes (1860 * 20 bytes)
udev_device_new_from_syspath: device 0x2328140 has devpath '/devices/pci0000:00/0000:00:04.0/usb4/4-2'
udev_device_new_from_syspath: device 0x2332dc0 has devpath '/devices/pci0000:00/0000:00:04.0/usb4/4-2'
udev_device_read_db: device 0x2332dc0 filled with db file data
udev_rules_apply_to_event: LINK 'char/189:388' /lib/udev/rules.d/50-udev-default.rules:4
udev_rules_apply_to_event: MODE 0664 /lib/udev/rules.d/50-udev-default.rules:54
udev_rules_apply_to_event: NAME 'bus/usb/004/005' /lib/udev/rules.d/50-udev-default.rules:54
udev_rules_apply_to_event: IMPORT 'usb_id --export /devices/pci0000:00/0000:00:04.0/usb4/4-2' /lib/udev/rules.d/50-udev-default.rules:65
util_run_program: 'usb_id --export /devices/pci0000:00/0000:00:04.0/usb4/4-2' started
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_VENDOR=Lexmark_International__Inc.'
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_VENDOR_ENC=Lexmark\x20International\x2c\x20Inc.'
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_VENDOR_ID3d'
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_MODEL=Lexmark_Optra_E312'
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_MODEL_ENC=Lexmark\x20Optra\x20E312'
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_MODEL_ID0c'
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_REVISION00'
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_SERIAL=Lexmark_International__Inc._Lexmark_Optra_E312_8050926'
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_SERIAL_SHORT€50926'
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_BUS=usb'
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_USB_INTERFACES=:070102:'
util_run_program: 'usb_id --export /devices/pci0000:00/0000:00:04.0/usb4/4-2' returned with exitcode 0
udev_rules_apply_to_event: GROUP 7 /lib/udev/rules.d/50-udev-default.rules:66
udev_rules_apply_to_event: MODE 0660 /lib/udev/rules.d/50-udev-default.rules:66
udev_device_new_from_syspath: device 0x23357c0 has devpath '/devices/pci0000:00/0000:00:04.0/usb4'
udev_device_new_from_syspath: device 0x2335aa0 has devpath '/devices/pci0000:00/0000:00:04.0'
udev_device_new_from_syspath: device 0x2335d50 has devpath '/devices/pci0000:00'
udev_rules_apply_to_event: PROGRAM 'check-ptp-camera 06/01/01' /etc/udev/rules.d/54-gphoto.rules:967
util_run_program: 'check-ptp-camera 06/01/01' started
util_run_program: 'check-ptp-camera 06/01/01' returned with exitcode 1
udev_rules_apply_to_event: RUN 'socket:@/org/freedesktop/hal/udev_event' /etc/udev/rules.d/90-hal.rules:2
udev_device_update_db: created db file for '/devices/pci0000:00/0000:00:04.0/usb4/4-2' in '/dev/.udev/db/\x2fdevices\x2fpci0000:00\x2f0000:00:04.0\x2fusb4\x2f4-2'
udev_node_add: creating device node '/dev/bus/usb/004/005', devnum9:388, mode60, uid=0, gid=7
udev_node_mknod: preserve file '/dev/bus/usb/004/005', because it has correct dev_t
udev_node_mknod: chmod(/dev/bus/usb/004/005, 020660)
udev_node_mknod: chown(/dev/bus/usb/004/005, 0, 7)
update_link: '/dev/char/189:388' with target '/dev/bus/usb/004/005' has the highest priority 0, create it
node_symlink: preserve already existing symlink '/dev/char/189:388' to '../bus/usb/004/005'
udevadm_test: UDEV_LOG=6
udevadm_test: DEVPATH=/devices/pci0000:00/0000:00:04.0/usb4/4-2
udevadm_test: MAJOR9
udevadm_test: MINOR88
udevadm_test: DEVTYPE=usb_device
udevadm_test: DRIVER=usb
udevadm_test: DEVICE=/proc/bus/usb/004/005
udevadm_test: PRODUCTCd/c/100
udevadm_test: TYPE=0/0/0
udevadm_test: BUSNUM4
udevadm_test: DEVNUM5
udevadm_test: ACTION­d
udevadm_test: SUBSYSTEM=usb
udevadm_test: DEVLINKS=/dev/char/189:388
udevadm_test: ID_VENDOR=Lexmark_International__Inc.
udevadm_test: ID_VENDOR_ENC=Lexmark\x20International\x2c\x20Inc.
udevadm_test: ID_VENDOR_ID3d
udevadm_test: ID_MODEL=Lexmark_Optra_E312
udevadm_test: ID_MODEL_ENC=Lexmark\x20Optra\x20E312
udevadm_test: ID_MODEL_ID0c
udevadm_test: ID_REVISION00
udevadm_test: ID_SERIAL=Lexmark_International__Inc._Lexmark_Optra_E312_8050926
udevadm_test: ID_SERIAL_SHORT€50926
udevadm_test: ID_BUS=usb
udevadm_test: ID_USB_INTERFACES=:070102:
udevadm_test: DEVNAME=/dev/bus/usb/004/005
udevadm_test: run: 'socket:@/org/freedesktop/hal/udev_event'
[root@server64 andyrtr]#

after that permission is fixed.

[root@server64 andyrtr]# ls -lhR /dev/bus/usb/004/ /dev/bus/usb/004/:
insgesamt 0
crw-rw-r-- 1 root root 189, 384 8. Okt 22:03 001
crw-rw---- 1 root lp 189, 388 9. Okt 05:34 005

Andy

#9 lore raw
In reply to Andreas Radke
Quoted 6 lines · Andreas Radke

Am Fri, 9 Oct 2009 00:38:18 +0200
schrieb Kay Sievers <[email protected]>:

Quoted 3 lines

What does:
  udevadm test /devices/pci0000:00/0000:00:04.0/usb4/4-2 print?

Quoted 6 lines

udev_node_add: creating device node '/dev/bus/usb/004/005', devnum9:388, mode60, uid=0, gid=7
udev_node_mknod: preserve file '/dev/bus/usb/004/005', because it has correct dev_t
udev_node_mknod: chmod(/dev/bus/usb/004/005, 020660)
udev_node_mknod: chown(/dev/bus/usb/004/005, 0, 7)

after that permission is fixed.

If the usbdev* devices, and /sys/class/usb_device/ are gone, are you sure you don't have anything else running that mangles permissions of device nodes?

Kay

#10 lore raw
In reply to Andreas Radke

Am Fri, 9 Oct 2009 11:29:55 +0200
schrieb Kay Sievers <[email protected]>:

Quoted 5 lines

If the usbdev* devices, and /sys/class/usb_device/ are gone, are you sure you don't have anything else running that mangles permissions of device nodes?

Kay

Sorry, I don't understand what you mean. There are not many services running on the server and no other devices connected to usb.

Please try to catch me on irc or jabber/icq/msn for a quick talk. thanks.

Andy

#11 lore raw
In reply to Andreas Radke

Am Fri, 9 Oct 2009 12:33:36 +0200
schrieb Andreas Radke <[email protected]>:

Quoted 12 lines

Am Fri, 9 Oct 2009 11:29:55 +0200
schrieb Kay Sievers <[email protected]>:

Quoted 5 lines

If the usbdev* devices, and /sys/class/usb_device/ are gone, are you sure you don't have anything else running that mangles permissions of device nodes?

Kay

Sorry, I don't understand what you mean. There are not many services running on the server and no other devices connected to usb.

Quoted 9 lines

Please try to catch me on irc or jabber/icq/msn for a quick talk. thanks.

Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Solved it now with a custom udev rule. Haven't found out why the generic one fails here.

SYSFS{idVendor}="043d", SYSFS{idProduct}="000c", GROUP="lp", MODE="0664"

Thanks anyway. If you have an idea how to find out the real reason drop me a mail.

-Andy

#12 lore raw
In reply to Andreas Radke

I set udev's loglevel to "debug" and saw something interesting in my logs [1] after turning on the printer. Specifically, the following line appears to be of interest:

  Oct 12 19:38:26 foutboxd udevd-work[7541]: '/lib/udev/usb_id' (stderr) 

'error opening USB device 'descriptors' file'

Maybe the 'descriptors' file hasn't been created when the udev rules fire? I think this would explain why subsequent calls to udevadm test/trigger apply the correct group to the printer.

Random coincidence, my Canon PIXMA iP3000's print head died soon after I noticed the above error, more than three years after the printer was bought. Time to get a cheap laser printer (I'm considering the Samsung ML-1640) I guess, since getting a new print head for my old inkjet printer would cost more. :<

PS: Sorry for going a bit off-topic about my dead printer, I felt like talking about it a little. :(

----
[1] http://omploader.org/vMmphMg

#13 lore raw
In reply to Andreas Radke
Quoted 10 lines · Evangelos Foutras

I set udev's loglevel to "debug" and saw something interesting in my logs
[1] after turning on the printer. Specifically, the following line appears to be of interest:

 Oct 12 19:38:26 foutboxd udevd-work[7541]: '/lib/udev/usb_id' (stderr) 'error opening USB device 'descriptors' file'

Maybe the 'descriptors' file hasn't been created when the udev rules fire? I think this would explain why subsequent calls to udevadm test/trigger apply the correct group to the printer.

Yes, that might be. There have been numerous fixes to recent kernel versions to address issues like this. You could try to set up rules with WAIT_FOR_SYSFS="..." to possibly work around that on older kernel versions.

The real fix though, is to run a kernel that matches the time the system-level tools are developed and used with in the major distros. Only these combinations are well tested and debugged. Mixing older kernel versions with newer system-level tools usually works fine, but there are many things that can go wrong, because nobody really tests the combinations in this direction. People usually only make sure, that newer kernels run on older systems, not the other way around.

Kay

#14 lore raw
In reply to Andreas Radke
Quoted 10 lines · Kay Sievers

On Tue, Oct 13, 2009 at 05:30, Evangelos Foutras <[email protected]> wrote:
The real fix though, is to run a kernel that matches the time the system-level tools are developed and used with in the major distros. Only these combinations are well tested and debugged. Mixing older kernel versions with newer system-level tools usually works fine, but there are many things that can go wrong, because nobody really tests the combinations in this direction. People usually only make sure, that newer kernels run on older systems, not the other way around.

Kay

Hm. I think a little different. I know developement goes fast but at least all officially supported kernels and especially the ones with long life support should also be supported by all userland tools.

IMHO minimum required kernel version should stay 2.6.27.xx until there will be a new long life kernel declared.

Please take care about rolling release distributions and people that want to take advantage of LTS kernels.

If you can't stay compatible in main developement tree separated frozen bugfix branches would be nice. But probably you will think this is a distributione task (that we small distributors cannot provide).

-Andy

#15 lore raw
In reply to Andreas Radke
Quoted 14 lines · Kay Sievers
Quoted 11 lines · Evangelos Foutras

I set udev's loglevel to "debug" and saw something interesting in my logs
[1] after turning on the printer. Specifically, the following line appears to be of interest:

 Oct 12 19:38:26 foutboxd udevd-work[7541]: '/lib/udev/usb_id' (stderr)

'error opening USB device 'descriptors' file'

Maybe the 'descriptors' file hasn't been created when the udev rules fire? I think this would explain why subsequent calls to udevadm test/trigger apply the correct group to the printer.

Quoted 5 lines

Yes, that might be. There have been numerous fixes to recent kernel versions to address issues like this. You could try to set up rules with WAIT_FOR_SYSFS="..." to possibly work around that on older kernel versions.

I tried your suggestion and placing WAIT_FOR_SYSFS="descriptors" before the IMPORT does produce the desired behavior (awesome!). If it's not clear, I'm referring to line 69 in 50-udev-default.rules [1].

Any chance of applying this modification to udev.git? :)

----
[1]
http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=rules/rules.d/50-udev-default.rules;h§9073b90e6f2d2e1c47d0daf02345f7726b3193;hb=HEAD#l69

#16 lore raw
In reply to Andreas Radke
Quoted 2 lines · Evangelos Foutras
Quoted 1 line · Kay Sievers

On Tue, Oct 13, 2009 at 05:30, Evangelos Foutras <[email protected]>

Quoted 16 lines · wrote:
Quoted 7 lines
Quoted 7 lines

I set udev's loglevel to "debug" and saw something interesting in my logs [1] after turning on the printer. Specifically, the following line appears to be of interest:

 Oct 12 19:38:26 foutboxd udevd-work[7541]: '/lib/udev/usb_id' (stderr)

'error opening USB device 'descriptors' file'

Quoted 8 lines
Quoted 3 lines

Maybe the 'descriptors' file hasn't been created when the udev rules fire? I think this would explain why subsequent calls to udevadm test/trigger apply the correct group to the printer.

Yes, that might be. There have been numerous fixes to recent kernel versions to address issues like this. You could try to set up rules with WAIT_FOR_SYSFS="..." to possibly work around that on older kernel versions.

Quoted 6 lines

I tried your suggestion and placing WAIT_FOR_SYSFS="descriptors" before the IMPORT does produce the desired behavior (awesome!). If it's not clear, I'm referring to line 69 in 50-udev-default.rules [1].

Any chance of applying this modification to udev.git? :)

So adding this rule anywhere before line 69 will help? SUBSYSTEM="usb", ENV{DEVTYPE}="usb_device", WAIT_FOR_SYSFS="descriptors"

If yes, I am going to add it to the gentoo ruleset.

Regards
Matthias

#17 lore raw
In reply to Andreas Radke
Quoted 31 lines · Matthias Schwarzott
Quoted 4 lines · Evangelos Foutras
Quoted 2 lines · Kay Sievers

On Tue, Oct 13, 2009 at 05:30, Evangelos Foutras <[email protected]>

Quoted 16 lines · wrote:
Quoted 7 lines
Quoted 7 lines

I set udev's loglevel to "debug" and saw something interesting in my logs [1] after turning on the printer. Specifically, the following line appears to be of interest:

 Oct 12 19:38:26 foutboxd udevd-work[7541]: '/lib/udev/usb_id' (stderr)

'error opening USB device 'descriptors' file'

Quoted 9 lines
Quoted 4 lines

Maybe the 'descriptors' file hasn't been created when the udev rules fire? I think this would explain why subsequent calls to udevadm test/trigger apply the correct group to the printer.

Yes, that might be. There have been numerous fixes to recent kernel versions to address issues like this. You could try to set up rules with WAIT_FOR_SYSFS="..." to possibly work around that on older kernel versions.

Quoted 7 lines

I tried your suggestion and placing WAIT_FOR_SYSFS="descriptors" before the IMPORT does produce the desired behavior (awesome!). If it's not clear, I'm referring to line 69 in 50-udev-default.rules [1].

Any chance of applying this modification to udev.git? :)

Quoted 8 lines

So adding this rule anywhere before line 69 will help? SUBSYSTEM="usb", ENV{DEVTYPE}="usb_device", WAIT_FOR_SYSFS="descriptors"

If yes, I am going to add it to the gentoo ruleset.

Regards
Matthias

That works too.

#18 lore raw
In reply to Andreas Radke
Quoted 9 lines · Evangelos Foutras
Quoted 8 lines · Matthias Schwarzott

On Donnerstag, 15. Oktober 2009, Evangelos Foutras wrote:

So adding this rule anywhere before line 69 will help? SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", WAIT_FOR_SYSFS="descriptors"

If yes, I am going to add it to the gentoo ruleset.

Hi Kay!

Please commit this patch.

Matthias

rules/gentoo/30-kernel-compat.rules +7 -0
@@ -3,6 +3,13 @@
 ACTION!="add|change", GOTO="kernel_compat_end"
 
 #
+# sysfs timing rules
+#
+
+# needed for kernels <2.6.30
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", WAIT_FOR_SYSFS="descriptors"
+
+#
 # naming device rules
 #
 
#19 lore raw
In reply to Andreas Radke
Quoted 4 lines · Matthias Schwarzott
Quoted 3 lines · Evangelos Foutras
Quoted 2 lines · Matthias Schwarzott

On Donnerstag, 15. Oktober 2009, Evangelos Foutras wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 6 lines

So adding this rule anywhere before line 69 will help? SUBSYSTEM="usb", ENV{DEVTYPE}="usb_device", WAIT_FOR_SYSFS="descriptors"

If yes, I am going to add it to the gentoo ruleset.

Hi Kay!

Done, but seems kernel.org does not accept git push requests at the moment. Will try again later.

Kay