LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 11-26-2008, 08:08 PM   #1
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,047

Rep: Reputation: 949Reputation: 949Reputation: 949Reputation: 949Reputation: 949Reputation: 949Reputation: 949Reputation: 949
Scanner works only as root - permissions issue


This is an old one, but it seems that at EVERY Debian upgrade the permission problem is implemented differently.

I use sane version 1.0.14-7 and libsane version 1.0.19-22
Kernel 2.6.26-1-686
Udev 0.125-7
Hotplug NOT INSTALLED
Debian Lenny

Scanner is seen as root, not as normal user.

This is what /etc/udev/rules.d/z60_libsane.rules says for my scanner:
SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="2220", MODE="0666", GROUP="scanner", ENV{libsane_matched}="yes"

The scanner shows up in /dev/usb/scanner with permissions
-rw-rw-rw root:scanner
That is correct as I changed this line in /etc/udev/rules.d/z60_libsane.rules. When I change it to 664, the scanner device is 664 as well.
I am using udev. Hotplug is not installed. The hotplug module is not loaded. I am member of the scanner group.

So far so good, but SANE does not use /dev/usb/scanner. It seems that is looks at:
/proc/bus/usb/002/005
This file has the permission:
-rw-r--r-- 1 root root 57 2008-11-26 21:42 005
As soon as I change the permissions of THIS file to 666, I CAN scan as normal user. But that is a workaround as at power cycling the device looses its permissions. I don't see any way how to change the permissions here. I used to be able to do so, but that was when hotplug was still in charge.

Conclusion: SANE looks at /proc/bus/usb/002/005 to access the device, not at /dev/usb/scanner.

How can I either:
Make sane use /dev/usb/scanner?
or
Change the permissions on /proc/bus/usb/002/005 whenever I plug my scanner? Who is reponsible for creating /proc/bus/usb/002/005 anyway?

jlinkels

Last edited by jlinkels; 11-27-2008 at 04:53 AM.
 
Old 11-27-2008, 04:32 AM   #2
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,950

Rep: Reputation: 1702Reputation: 1702Reputation: 1702Reputation: 1702Reputation: 1702Reputation: 1702Reputation: 1702Reputation: 1702Reputation: 1702Reputation: 1702Reputation: 1702
This is an old thread from the Slackware forum that may offer some clues.
http://www.linuxquestions.org/questi...urrent-594071/
 
Old 11-29-2008, 10:36 AM   #3
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,047

Original Poster
Rep: Reputation: 949Reputation: 949Reputation: 949Reputation: 949Reputation: 949Reputation: 949Reputation: 949Reputation: 949
Thanks, but actually it doesn't help.

Udev is creating /dev/bus/scannerxx, with the right permissions, but SANE doesn't use it. I know udev creates it because when I alter the permissions in the rules file they are reflected here.

Something is creating /proc/bus/usb/002/005 with the incorrect permissions. But SANE uses this /proc/bus/usb.

According to all documentation I have found on the web, udev creates /dev/usb/scanner or /dev/bus/usb/002/005, and hotplug does it in /proc.

But I am 100% sure I am not running hotplug, it is not installed and the executable doesn't exist. Would maybe udev run some old hotplug scripts?

Another strange this is that the udevinfo --root gives me the correct /dev root. But when I ask for the udev database: udevinfo --export-db then I get the reply the database is empty.

Weird uh? Udev does something, but only halfways...

jlinkels
 
Old 11-29-2008, 04:17 PM   #4
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,047

Original Poster
Rep: Reputation: 949Reputation: 949Reputation: 949Reputation: 949Reputation: 949Reputation: 949Reputation: 949Reputation: 949
Weird....

It works now as advertised, but I don't know why. Some issues I run through:

1. The udev database was empty
2. udevd wasn't running at all
3. Started udevd as a daemon
4. Nothing changed
5. Reinstalled udev package (apt-get --reinstall)
6. Nothing changed
7. Action #3 was stupid! Never heard of /etc/init.d/udev??
8. Killed udevd, started /etc/init.d/udev
9. Now I saw the /dev directory being repopulated!
10. Yes, now it works, I have all the /dev entries, I can see the scanner as user!
11. But... I am sure earlier I did /etc/init.d/udev restart, but nothing happened, certainly not repopulating the /dev directory



Why wasn't udev started at boot time? Why wasn't udev restarted after a reinstall? It is in rcS.d, not sure it was there all the time though. Dunno of this will survive a reboot, but since I have to turn off the machine in 3 days from now, I won't reboot today.

jlinkels
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
samba permissions issue? smb4k works, cli smbmount denies babag Linux - Networking 1 09-28-2008 05:47 PM
non-root crontab failure (permissions issue?) kngspook Linux - Software 3 05-17-2008 12:28 AM
Scanner/Printer Combo Unit - Scanner Works - Printer Does Not rrrssssss Linux - Hardware 1 03-04-2007 10:49 PM
FC4 xorg issue - 1280x1024 works for root, but not normal user account peitz11 Linux - Software 2 09-29-2005 08:40 AM
Permissions issue on hda1 as root Chivas3 Linux - Security 3 09-24-2005 09:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration