I installed libusb and sane-backends to get my usb scanner (Cannon D660U) to work, and since then I was receiving errors on start up during the "USB hotplugging" stage. chown: cannot access "/proc/bus/usb/002/004": No such file or directory chmod: cannot access "/proc/bus/usb/002/004": No such file or directory On my computer there is no 004 file in /proc/bus/usb/002 since the file "003" is the last one within the directory. The problem ended up being in /etc/hotplug/usb/libusbscanner where line 20 is: DEV=$(expr $DEV + 1) which produces the above mentioned errors. The bug is is fixed by changing the plus into minus. DEV=$(expr $DEV - 1) or by commenting out everything except if [ -z "$DEVICE" ] ; then IF=$(echo $DEVPATH | sed 's:\(bus/usb/devices/\)\(.*\)-\(.*\):\2:') DEV=$(echo $DEVPATH | sed 's:\(bus/usb/devices/\)\(.*\)-\(.*\):\3:') DEV=$(expr $DEV - 1) DEVICE=$(printf '/proc/bus/usb/%.03d/%.03d' $IF $DEV) fi Reproducible: Always Steps to Reproduce: 1. Use udev and hotplug 2. Install sane-backends and libusb 3. Get your scanner to work and restart or run /etc/init.d/hotplug restart 4. Observe usb hotplugging Im not sure if this bug is unique for my computer Actual Results: During boot up appears this message (the numbers 002/004 might be different for your computer but you get the point) chown: cannot access "/proc/bus/usb/002/004": No such file or directory chmod: cannot access "/proc/bus/usb/002/004": No such file or directory Expected Results: Expected result is of course no error message during USB hotplugging
Dear devs can read the thread that lead to this report at http://forums.gentoo.org/viewtopic.php?p=1136869
The file /etc/hotplug/usb/libusbscanner is not part of the main hotplug packages. I suggest you refile this bug based on the package that owns this file. Oh, and udev has nothing to do with it :)
/etc/hotplug/usb/libusbscanner is not part of the main hotplug package indeed, it is part of sane-backends and is called by hotplug. It's been added recently. sane-backends is mentioned on the first line of the poster's report BTW. The problem is still alive and the solution that seems to work on Petr's udev setup does not work on mine (2.6 kernel, still devfs) and others'. I don't know whether udev really has an influence. More info is available in the thread mentioned above. Another similar thread is still going on in the French forum. In short, when /etc/init.d/hotplug is (re)started, it passes an empty DEVICE and some DEVPATH to the /etc/hotplug/usb/libusbscanner script. That's what is tested by the if [ -z "$DEVICE" ]. In my case, the scanner is on /proc/bus/usb/002/003 at startup and IF (bus number) is assigned 2 which is right, but DEV (device number) is assigned 1 (because DEVPATH="bus/usb/devices/2-1") and should become 3. Clearly the +1 is not the right way ;-) In petr's case, DEV was 4 and had to be decreased. On the other hand, when I switch my scanner off and back on, the script gets a proper value for DEVICE ("/proc/bus/usb/002/004", then 005, and on) and works OK; DEVPATH="/devices/pci0000:00/0000:00:0c.0/usb2/2-1/2-1:1.0" not being used in that case. I had a quick look into the sys file system and could not find any info that could lead to the right /proc/bus/usb/BBB/DDD entry. Either have hotplug pass consistent information to the sane-backends script, or have the script cope for all possible inputs. Another issue, a less important one, is that sane-backends now installs its own libsane.usermap next to its libusbscanner, but when the user already had the scanner listed in his own usb.usermap (as suggested in hotplug's documentation iirc) and uses a script called anything else but libusbscanner (like scanner e.g.), _both_ scripts are run by hotplug. That is IMO a normal behaviour, but few users will be aware of that and will be very confused when trying to configure their scanner. Please do feel free to assign to whoever can solve this bug or change the title to anything you like. Kind regards.
This needs to go to the sane developers.
For me it looks like /etc/hotplug/usb/libusbscanner is either not called at all, or it gets empty variables as an input. I've added simple debug echo line to the script, but after restarting hotplug I got no additional output. So for now (I also use devfs) I had to edit /etc/hotplug/usb.agent and add some lines that parse $PRODUCT - if it matches my device id, I use chmod/chown to change permissions. It's not too clean, but it works.
Artur: what do you chmod/chown ? In short, when hotplug is (re)started, the script IS called with DEVICE undefined DEVPATH="bus/usb/devices/2-1" but when you switch your scanner off and back on, the script IS called with DEVICE="/proc/bus/usb/002/004" DEVPATH="/devices/pci0000:00/0000:00:0c.0/usb2/2-1/2-1:1.0" See the aformentioned thread in the forums for more info. BTW, I have read you could make your life easier by mounting usbfs with options gid=100,mode=660. I haven't tried but why shouldn't it work?
Those mount options to not work on 2.6 due to this bug: http://bugme.osdl.org/show_bug.cgi?id=1418 Sorry :(
Xavier: when DEVICE is empty I get right path like this: DEV_ID=`echo "$DEVPATH" | sed -e 's/.*\([0-9]\)\-\([0-9]\)/\/proc\/bus\/usb\/00\1\/00\2/'`
That's what the code inside the if [ -z "$DEVICE" ] ; then does, except it increments the device number. In your case, values should not be changed, on other cases, the device number needs to be decremented or +=2. In other words, you're just lucky the numbers match.
Anyways, it should be fixed in portage and/or upstream. Did developers already take care of this?
"You're just lucky the numbers match" does not sound like a candidate for portage... that wouldn't be any better than the current status. There should be some clean solution, so let's try to find it.
*** Bug 53950 has been marked as a duplicate of this bug. ***
Btw, the hotplug script that makes the trouble comes from bug #49815
i have the same problem with a Canon U1240 scanner works as root but (on a fully udev system) shows the error: chown: cannot access `/proc/bus/usb/003/003': No such file or directory chmod: cannot access `/proc/bus/usb/003/003': No such file or directory A copy of /proc/bus/usb/devices shows: T: Bus=05 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0 D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=0000 ProdID=0000 Rev= 2.06 S: Manufacturer=Linux 2.6.7-rc3-love1 uhci_hcd S: Product=Intel Corp. 82801EB/ER (ICH5/ICH5R) USB UHCI #4 S: SerialNumber=0000:00:1d.3 C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms T: Bus=04 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0 D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=0000 ProdID=0000 Rev= 2.06 S: Manufacturer=Linux 2.6.7-rc3-love1 uhci_hcd S: Product=Intel Corp. 82801EB/ER (ICH5/ICH5R) USB UHCI #3 S: SerialNumber=0000:00:1d.2 C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms T: Bus=03 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0 D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=0000 ProdID=0000 Rev= 2.06 S: Manufacturer=Linux 2.6.7-rc3-love1 uhci_hcd S: Product=Intel Corp. 82801EB/ER (ICH5/ICH5R) USB UHCI #2 S: SerialNumber=0000:00:1d.1 C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms T: Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=ff(vend.) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=04a9 ProdID=220e Rev= 1.00 S: Manufacturer=Canon S: Product=CanoScan C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=ff Driver=(none) E: Ad=81(I) Atr=03(Int.) MxPS= 1 Ivl=16ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0 D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=0000 ProdID=0000 Rev= 2.06 S: Manufacturer=Linux 2.6.7-rc3-love1 uhci_hcd S: Product=Intel Corp. 82801EB/ER (ICH5/ICH5R) USB UHCI #1 S: SerialNumber=0000:00:1d.0 C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 8 B: Alloc= 0/800 us ( 0%), #Int= 0, #Iso= 0 D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS= 8 #Cfgs= 1 P: Vendor=0000 ProdID=0000 Rev= 2.06 S: Manufacturer=Linux 2.6.7-rc3-love1 ehci_hcd S: Product=Intel Corp. 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller S: SerialNumber=0000:00:1d.7 C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=256ms
Could some of you please try if setting DEV=$(cat /sys/$DEVPATH/devnum) does the trick?
Here we go again. I just switched my scanner on and hotplug called my usbscanner script with the following vars: ACTION=add DEVICE=/proc/bus/usb/002/005 DEVPATH=/devices/pci0000:00/0000:00:0c.0/usb2/2-1/2-1:1.0 The script granted expected rights on $DEVICE, all is fine. Then I restarted hotplug (scanner is still on and device is still /proc/bus/usb/002/005) and I get # /etc/init.d/hotplug start * Starting input hotplugging... [ ok ] * Starting pci hotplugging... [ ok ] * Starting usb hotplugging... chown: cannot access `/proc/bus/usb/002/003': No such file or directory chmod: cannot access `/proc/bus/usb/002/003': No such file or directory [ ok ] The script has been called with the following vars: ACTION=add DEVICE= DEVPATH=bus/usb/devices/2-1 Why can't hotplug give us the right device? /sys/$DEVPATH does not contain any devnum file # ls -lR /sys/bus/usb/devices/2-1 lrwxrwxrwx 1 root root 49 Jun 17 14:50 /sys/bus/usb/devices/2-1 -> ../../../devices/pci0000:00/0000:00:0c.0/usb2/2-1 The file contents do not seem to point to /proc/bus...005 in any way: Here is the list of files and their content: # for ff in `find . -type f`; do echo $ff|paste $ff -;done 00 ./2-1:1.0/iInterface ff ./2-1:1.0/bInterfaceProtocol ff ./2-1:1.0/bInterfaceSubClass ff ./2-1:1.0/bInterfaceClass 02 ./2-1:1.0/bNumEndpoints 0 ./2-1:1.0/bAlternateSetting 00 ./2-1:1.0/bInterfaceNumber 0 ./2-1:1.0/power/state 0 ./2-1:1.0/detach_state Perfection1640 ./product EPSON ./manufacturer 12 ./speed 1 ./bNumConfigurations ff ./bDeviceProtocol ff ./bDeviceSubClass ff ./bDeviceClass 0104 ./bcdDevice 010a ./idProduct 04b8 ./idVendor 2mA ./bMaxPower 40 ./bmAttributes 1 ./bConfigurationValue 1 ./bNumInterfaces 0 ./power/state 0 ./detach_state FYI, # sane-find-scanner found USB scanner (vendor=0x04b8 [EPSON], product=0x010a [Perfection1640]) at libusb:002:005 basil 2-1 # scanimage -L device `epson:libusb:002:005' is a Epson Perfection1640 flatbed scanner
Created attachment 33423 [details] modified to check /sys when $DEVICE is not set I'm afraid you mixed some things up. The device number from sys/$DEVPATH is only relevant if DEVICE is empty. So please try the attached file as your /etc/hotplug/usb/libusbscanner
No mix up at all. Please read my previous comment again. /sys/$DEVPATH/devnum does not exist. Here is the list of files, again, see above for their content: /sys/bus/usb/devices/2-1/: total 0 drwxr-xr-x 3 root root 0 Jun 17 15:27 2-1:1.0 -r--r--r-- 1 root root 4096 Jun 17 15:22 bcdDevice -rw-r--r-- 1 root root 4096 Jun 17 15:22 bConfigurationValue -r--r--r-- 1 root root 4096 Jun 17 15:22 bDeviceClass -r--r--r-- 1 root root 4096 Jun 17 15:22 bDeviceProtocol -r--r--r-- 1 root root 4096 Jun 17 15:22 bDeviceSubClass -r--r--r-- 1 root root 4096 Jun 17 15:22 bmAttributes -r--r--r-- 1 root root 4096 Jun 17 15:22 bMaxPower -r--r--r-- 1 root root 4096 Jun 17 15:22 bNumConfigurations -r--r--r-- 1 root root 4096 Jun 17 15:22 bNumInterfaces -rw-r--r-- 1 root root 4096 Jun 17 15:22 detach_state -r--r--r-- 1 root root 4096 Jun 17 15:22 idProduct -r--r--r-- 1 root root 4096 Jun 17 15:22 idVendor -r--r--r-- 1 root root 4096 Jun 17 15:22 manufacturer drwxr-xr-x 2 root root 0 Jun 17 15:22 power -r--r--r-- 1 root root 4096 Jun 17 15:22 product -r--r--r-- 1 root root 4096 Jun 17 15:22 speed /sys/bus/usb/devices/2-1/2-1:1.0: total 0 -r--r--r-- 1 root root 4096 Jun 17 15:27 bAlternateSetting -r--r--r-- 1 root root 4096 Jun 17 15:27 bInterfaceClass -r--r--r-- 1 root root 4096 Jun 17 15:27 bInterfaceNumber -r--r--r-- 1 root root 4096 Jun 17 15:27 bInterfaceProtocol -r--r--r-- 1 root root 4096 Jun 17 15:27 bInterfaceSubClass -r--r--r-- 1 root root 4096 Jun 17 15:27 bNumEndpoints -rw-r--r-- 1 root root 4096 Jun 17 15:27 detach_state -r--r--r-- 1 root root 4096 Jun 17 15:27 iInterface drwxr-xr-x 2 root root 0 Jun 17 15:27 power /sys/bus/usb/devices/2-1/2-1:1.0/power: total 0 -rw-r--r-- 1 root root 4096 Jun 17 15:27 state /sys/bus/usb/devices/2-1/power: total 0 -rw-r--r-- 1 root root 4096 Jun 17 15:22 state
Created attachment 33425 [details] /etc/hotplug/usb/usbscanner This the script I use to dump debug info into /tmp/toto Crude hack, but well enough for the task.
Xavier, the source of the irritation is maybe that the guy from bug #53950 and me have a "devnum" file in that directory and you haven't - which kernel version are you using? Mine is 2.6.6 (vanilla)
# uname -a Linux basil 2.6.3 #2 SMP Thu Feb 26 15:12:10 CET 2004 i686 AMD Athlon(tm) Processor AuthenticAMD GNU/Linux
That's the problem. Google pointed me to the ChangeLog of 2.6.6-rc1: <rml@ximian.com> [PATCH] USB: add missing usb entries to sysfs We have found in the course of hacking on HAL that some information that is in /proc/bus/usb/devices is not in sysfs. It would be nice to rely only on sysfs, so the attached patch adds three files to usb devices in sysfs: devnum, maxChild, and version. So it looks indeed like sysfs does _not_ give the necessary information in previous kernel versions. Would be really kind if hotplug provided this. So I'd say I put the modified script into -r3 since I don't see an easy way to get this right for older 2.6 versions. With the old version it breaks for most people, witht the new version it works at least for those with a current kernel.
I've just tried a with a vanilla 2.6.7 and devnum is there. The funny thing is the script is called 4 times when hotplug is started, twice with the right $DEVICE but before it is created and twice with an empty $DEVICE after the /proc/bus/usb/xxx/yyy entry has been created. The devnum file exists and can be used. _But_ it will only work if the scanner is on when hotplug is started. If you switch the scanner on later or if you switch it off and then on only when you need it again, the script only gets called twice with the right value in $DEVICE but before it is created under /proc/bus/usb which makes it impossible to chown/chmod it: +------------+ +In epson1640+ +------------+ ACTION=add DEVICE=/proc/bus/usb/003/003 DEVPATH=/devices/pci0000:00/0000:00:10.2/usb3/3-1/3-1:1.0 TYPE=usb /proc/bus/usb/003/: total 0 -rw-r--r-- 1 root root 43 Jun 17 18:20 001 +------------+ +In epson1640+ +------------+ ACTION=add DEVICE=/proc/bus/usb/003/003 DEVPATH=/devices/pci0000:00/0000:00:10.2/usb3/3-1/3-1:1.0 TYPE=usb /proc/bus/usb/003/: total 0 -rw-r--r-- 1 root root 43 Jun 17 18:20 001 which brings us to square one, scanning will only work for the root users.
Am I the only one who considers this crazy?
I am still having the problem: chown: cannot access `/proc/bus/usb/003/003': No such file or directory chmod: cannot access `/proc/bus/usb/003/003': No such file or directory I am running Love Sources 2.6.7-rc3-love1 (the lastest bar one) The scanner is always plugged in. I have tried a few suggested fixes (re permissions) but can still only access the scanner as root. Have I missed something or am I hearing that there is no fix for this? I am confused...
Isn't it crazy indeed? Arthur: can you try the following script and look what params the script gets and what files exist? Rename it if you like. Tracing is appended to /tmp/toto #!/bin/bash # # /etc/hotplug/usb/epson1640 # GROUP=users #!/bin/sh echo "+------------+" >> /tmp/toto echo "+In epson1640+" >> /tmp/toto echo "+------------+" >> /tmp/toto echo "ACTION=$ACTION" >> /tmp/toto echo "DEVICE=$DEVICE" >> /tmp/toto echo "DEVPATH=$DEVPATH" >> /tmp/toto echo "TYPE=$TYPE" >> /tmp/toto ls -R /proc/bus/usb/ >> /tmp/toto if [ -z "$DEVICE" ] ; then echo "ls -R /sys/$DEVPATH/" >> /tmp/toto ls -lR /sys/$DEVPATH/ >> /tmp/toto cat /sys/$DEVPATH/devnum >> /tmp/toto IF=$(echo $DEVPATH | sed 's:\(bus/usb/devices/\)\(.*\)-\(.*\):\2:') DEV=$(cat /sys/$DEVPATH/devnum) DEVICE=$(printf '/proc/bus/usb/%.03d/%.03d' $IF $DEV) echo "new DEVICE=$DEVICE" >> /tmp/toto fi if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then chown root:"$GROUP" "$DEVICE" chmod 0660 "$DEVICE" fi
Um, this shouldn't be assigned to me. It's a sane issue, not a hotplug issue. Who is the maintainer of the sane package?
*** Bug 71180 has been marked as a duplicate of this bug. ***
*** Bug 72676 has been marked as a duplicate of this bug. ***
I am another user with the same issue. I have a USB Canon LIDE 30 flatbed that worked perfectly on a previous install but not this time around... even using the same configs from the previous install. My error is below: root@epitaph usb # /etc/init.d/coldplug restart * Coldplugging input devices... [ ok ] * Coldplugging isapnp devices... [ ok ] * Coldplugging pci devices... [ ok ] * Coldplugging pnp devices... [ ok ] * Coldplugging usb devices... chown: cannot access `/proc/bus/usb/001/003': No such file or directory chmod: cannot access `/proc/bus/usb/001/003': No such file or directory chown: cannot access `/proc/bus/usb/001/003': No such file or directory chmod: cannot access `/proc/bus/usb/001/003': No such file or directory [ ok ]
I would also like to add that I can get rid of the error if I do the following: Comment out Line #99 and add the following line below: DEVICE="/proc/bus/usb/003/$devdev" My scanner always seems to be on bus 003. So, it just seems coldplug isn't scanning the correct bus. I fail to see how this is a sane bug and not a hotplug/coldplug bug.
My apologies... The file to modify (as described by me in post #31) is: /etc/hotplug/usb.rc
Let's try to prove that SANE is not the problem, shall we? I've done some debugging of the coldplug/hotplug scripts in bug 72676, but some folks aren't taking it. Partial setup, USB stuff: 3 root USB hubs (1,2,3) 1 Sandisk 8-in-1 card reader 1 Sharp Zaurus 5500SL 1 Canon LiDE 30 1 Epson Stylus C82 The reader and the Zaurus are on hub #1, and read off as 1-2 and 1-3 respectively. The scanner is on hub #2, and reads off as 2-2 The printer is on hub #3, and reads off as 3-2 The Zaurus, intresting enough, I can switch around to 2-3. Let's make a new file called "usbnet" in /etc/hotplug/usb/ and put in this: #!/bin/sh logger -s $ACTION $DEVICE Save that and chmod it 755 (I'm the only user, anyway). Now let's reboot and see what it says: logger: add /proc/bus/usb/001/003 Okay, now I'll switch the Zaurus to the second hub... errrr... nnnnnggghhhh.... damn why did I have to build it that way... Ahhhh. There. Switched, the system recognizes it. Time to reboot. System says the Zaurus is on 2-3, but usbnet reports: logger: add /proc/bus/usb/001/003 That's a direct copy, folks! If it was correct, it'll read /proc/bus/usb/002/003. Sane is not at fault. Back to my bug!
Greg, would you please comment on comment #33? Looks rather convincing to me.
There were/are two similar but distinct bugs in scanner init scripts. The first one (described in the first post here) was caused by an off-by-one error in device enumeration code. This was sane-backends' issue. The second bug, described by Kelly and in #71180, is related to incorrect USB bus detection in coldplug. If scanner is detected as '/proc/bus/usb/XXX/YYY', and the 'XXX' part is wrong, then it's probably #71180.
No fix yet?
Bug 83738 has a fix for hotplug/coldplug that makes things work.
Thanks. Patch pretty much works with one exception. For some reason, when permissions on the scanner is set to 0660, no one in the users group can access it. My fix is setting permissions to 0770. In the past, it has worked with a 0660 permission. I'm not sure why it doesn't now. I'm 100% sure that my user is in the users group.
*** Bug 98206 has been marked as a duplicate of this bug. ***
I've tried adding the patch from both Bug 83738 (usb.rc diff) and the provided usbscanner script here, but it still doesn't work. Running scanimage -L as the normal user shows no scanner after initial boot. If I unplug and replug the scanner and re-run the command everything is fine. This is with an Agfa SnapScan e50. Coldboot is active and put in the boot runlevel. I noticed that the file /tmp/toto wasn't created at all, which leads me to think that the file never got executed in the coldboot process. BTW: I renamed the file to /etc/hotplug/usb/libusbscanner, as this is the file mentioned in the map file for this specific scanner.
Created attachment 86468 [details] udev-usbgentoo.diff This patch changes udev so usb devices in /dev/bus/usb are owned by root:usb with permissions "664". May be hackish, I don't know if it's safe, but it worked fine for me. A temp fix with same method without involving patch is at: http://forums.gentoo.org/viewtopic-p-3305680.html#3305680
*** Bug 132806 has been marked as a duplicate of this bug. ***
a better way to handle may be to add in 50-local.rules: BUS="usb", SYSFS{product}=="*Scanner*", GROUP="scanner", MODE="664" just after usb_device rule, this may need to be repeated for "*scanner*" (without capital s). Changing permissions.d files didn't did nothing.
Just realized this is working for me but would NOT for CanoScan (see above). What about using a script fix like the one I posted in http://forums.gentoo.org/viewtopic-p-3311185.html#3311185 and adding to udev or sane package? (I can refine it to be more useable and to work for more than 1 scanner at time).....
I have also been hit by this bug, with the hackish solution of modifying the permissions of /dev/bus/usb/001/008 (my scanner). The permissions of /proc/bus/usb/ are set correctly but I cannot access the scanner as my user without modifying the permissions in /dev. Then all works as expected. I have been talking with Matteo on IRC and we have figured this much out although I don't usually mess with /dev and /proc unless I have to :) So I could well be missing something obvious you guys know about.
Created attachment 88593 [details] newusbscanner I tried modifying /etc/hotplug/usb/libusbscanner ,but without any result. Also what's in /etc/hotplug/usb.agent line 448 (Action unsupported) made me wonder if this method isn't useable anymore. However, here's my newusbscanner script, perfected, that could be added to sane-backends with : einfo "usb scanners will need to run newusbscanner script as root" einfo "just first time,to be used by users in scanner group". The script handles udev rules to hook scanners, works for one or more scanner/s at time, and if invoked with "newusbscanner auto" will do all automatically.
Matteo's script did me no good with an old Umax Astra 2200, though explicitly looking for that model of scanner worked: BUS=="usb", SYSFS{idVendor}=="1606", SYSFS{idProduct}=="0230", GROUP="scanner", MODE="664"
Please give sane-backends-1.0.18-r2 a try. I automatically generates udev rules for all supported scanners.
So, if nobody still has a problem with sane-backends-1.0.18-r2, let's close this bug.
Didn't get chance to comment earlier but it is working great for me now. Why WONTFIX though? It seems fixed to me but may be I missed something. Thanks for sorting this out though as scanning was becomingly increasingly frustrating.
WONTFIX or FIXED... I just wanted to state that there will be no change to this version of the package.