SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Grr! I thought this one had been fixed years ago, but it seems to be back in 14.....!
Its the usual problem, a USB scanner that can only be seen as root. The sane documentation tells you to install a rules file from the tools/udev directory in the source package - but there is no tools/udev directory in the source package, either in slackware or a freshly downloaded source.
Slackware has its own rules /lib/udev/rules.d/80-libsane.rules that includes a line with the correct ids for my scanner. According to this list, the group permission should be set to lp - of which I am a member - but it remains stubbornly set at root!
However, if I plug the scanner in *after* booting, it all works perfectly!
The last time I came across this was in the bad old days of hotplug, and it took a lot of digging to find the cure! I thought with udev it was all sorted - and indeed it has been until I upgraded to 14!
Please, someone put me out of my misery while I still have some hair left.....!
Sorry I can't help with the problem, except to say that it works for me. On Slackware-14 my USB scanner is detected and the group on its device /dev/bus/usb/###/### changed to "lp" correctly , at boot time. (I wanted to go back to using the "scanner" group, though, so I copied the line for my scanner from /lib/udev/rules.d/80-libsane.rules into /etc/udev/rules.d/95-local.rules and changed the group there.)
I think you are going to have to turn up udevd logging to see what rule file is or isn't working. The fact that it happens a boot time only, and not when you replug it, will make it harder.
ljb643: Knowing that it works for you tells me that it is something unique to me, which is helpful indirectly. One thing I should have added is that this is a 64-bit system, so it *may* be unique to 64 bit.
kingbeowulf: Yes, the scanner group used to be the case, but its now lp. In any case, I'm a member of both groups, but the device only shows up with root/root permissions.
If I unplug and re-plug it, the permissions get set correctly. It just fails on boot!
...
kingbeowulf: Yes, the scanner group used to be the case, but its now lp. In any case, I'm a member of both groups, but the device only shows up with root/root permissions.
Afaik the lp and scanner groups are now default for any new user in Slackware.
Quote:
If I unplug and re-plug it, the permissions get set correctly. It just fails on boot!
...
Could you please try the following: instead of unpluging and pluging the device, only restart udev or reload the rules. Reloading the rules is done with
Code:
udevadm control --reload
Markus
Last edited by markush; 10-25-2012 at 11:33 AM.
Reason: typo
As a quick hack you can run lsusb and find the bus and device for the scanner and add a line like this to /etc/rc.d/rc.local...
I don't think those numbers from lsusb are necessarily stable. Before doing that, I suggest making a local udev rules file that runs very late (/etc/udev/rules.d/99-local.rules for example), with your scanner idVendor and idProduct, and have it set MODE and GROUP.
But I suspect a new rule won't help in this case. I wonder if the scanner is really ready when udevd starts during bootup, and whether it provides the right information about what it is. I can't think why else it would work on re-connection but not at boot. (Boot-up messages from dmesg and /var/log/something should show if the scanner was identified at boot time.)
...
But I suspect a new rule won't help in this case. I wonder if the scanner is really ready when udevd starts during bootup, and whether it provides the right information about what it is. I can't think why else it would work on re-connection but not at boot. (Boot-up messages from dmesg and /var/log/something should show if the scanner was identified at boot time.)
This is a good hint. I remember some weeks ago I had a similar problem with a scanner (an older Umax) connected to a Windows-computer. The scanner could not come up from sleeping on it's own, one had at least to press one of the buttons or disconnect/connect the powerplug.
Maybe if the OP has another scanner available and checks if another scanner works properly with udev.
Neither re-loading udev rules, nor forcing a full re-start of udev did any good. My scanner (loaded at /dev/bus/usb/002/002) remained resolutely stuck with root/root permissions.
I therefore wrote a new udev rule 99-epsonscanner.rules containing:
This line is copied exactly from the 80-libsane.rules
On rebooting, my scanner now had the correct permissions (root/lp).
This indicates to me that 80-libsane.rules is not being read correctly on startup. It does seem to contain a number of different entry points depending on kernel version, and I wonder if this is the cause of the issue. I am running a "home-brew" kernel-3.6.3, but the issue is still there with the standard Slackware huge-3.2.29 kernel. I will investigate further, but thanks for the clues which have put me on the right track!
The only items in /etc/udev/rules.d refer to cd drives and network devices. Everything else is in /lib/udev/rules.d, which is where I've been looking. I did wonder if something else was over-writing the libsane rules after that file had been read, but I can't see anything obvious. And in any case, if that were happening, it should also apply to the new rule I've written, which has an even lower priority!
I've convinced myself that its something to do with the obfuscated entry points in libsane rules, and will be investigating later today.....
Well, the kernel definitely finds the scanner at boot time:
usb 2-7: new full-speed USB device number 2 using ohci_hcd
usb 2-7: New USB device found, idVendor=04b8, idProduct=011d
usb 2-7: New USB device strings: Mfr=64, Product=77, SerialNumber=0
usb 2-7: Product: EPSO
usb 2-7: Manufacturer: EPSON
but this doesn't seem to get picked up by the udev rules.
# Kernel >= 2.6.22 jumps here
LABEL="libsane_create_usb_dev"
# For Linux >= 2.6.22 without CONFIG_USB_DEVICE_CLASS=y
# If the following rule does not exist on your system yet, uncomment it
ENV{DEVTYPE}=="usb_device", MODE="0660", OWNER="root", GROUP="root"
# Kernel < 2.6.22 jumps here
LABEL="libsane_usb_rules_begin"
CONFIG_USB_DEVICE_CLASS is deprecated, and doesn't exist in 3.6.3 (or if it does, I can't find it!), so I've tried both un-commenting and commenting that line (it is commented out as standard) to no effect.
Something seems to be making the rules jump right to the end, and the only thing that looks like it could do that is that first line (ACTION!="add").
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.