Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Scanner works only as root [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 489

PostPosted: Wed Aug 15, 2007 6:37 pm    Post subject: Scanner works only as root [solved] Reply with quote

Hi,

xsane and scanimage -L don't find my scanner. When I'm root scanimage -L returns
Quote:
device `snapscan:libusb:001:002' is a EPSON EPSON Scanner flatbed scanner

/etc/udev/rules.d/10-udev.rules looks like this:
Quote:
BUS=="usb", SYSFS{product}=="EPSON Scanner", NAME="usb/scanner", MODE="660", GROUP="scanner"

The node is created as follows:
Quote:
# ls -l /dev/usb
insgesamt 0
crw-rw---- 1 root scanner 254, 7 15. Aug 20:31 scanner

Does someone knows what's wrong?


Last edited by samo on Mon Aug 20, 2007 7:47 pm; edited 2 times in total
Back to top
View user's profile Send private message
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3792
Location: sleeping in the bathtub

PostPosted: Wed Aug 15, 2007 6:47 pm    Post subject: Reply with quote

Is the user you're running as a member of the "scanner" group?
_________________
"You have to invite me in"
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 489

PostPosted: Wed Aug 15, 2007 6:48 pm    Post subject: Reply with quote

Yes, the user is in the scanner group.
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 489

PostPosted: Thu Aug 16, 2007 4:42 pm    Post subject: Reply with quote

Does someone have an idea?
Back to top
View user's profile Send private message
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3792
Location: sleeping in the bathtub

PostPosted: Thu Aug 16, 2007 6:32 pm    Post subject: Reply with quote

Sorry, meant to get back to you sooner, but I had to go fish my scanner out of my closet. :wink:
Damn thing's dusty as hell.

Anyway, it's working fine for me, but strangely non of the /dev/usb* nodes are owned by the scanner group.

I don't mean to be condescending, but is your user in the usb group too?

what does `mount | grep usbfs` return?

Also, does /usr/sbin/lsusb list the scanner (when run as a normal user)?

There have been a lot of posts about this before, apparently there are quite a few possible causes so you should definitely look through some older forum posts.

Two more questions; what version of udev do you have installed, and are you using pam?

(pam was a typical culprit, IIRC).
_________________
"You have to invite me in"
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 489

PostPosted: Thu Aug 16, 2007 8:09 pm    Post subject: Reply with quote

My user is in the scanner group.
Quote:
$ mount | grep usbfs
none on /proc/bus/usb type usbfs (rw)

Quote:
$ /usr/sbin/lsusb
Bus 002 Device 003: ID 046a:0001 Cherry GmbH My3000 Keyboard
Bus 002 Device 002: ID 046a:0003 Cherry GmbH My3000 Hub
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 002: ID 04b8:011f Seiko Epson Corp. Perfection 1670
Bus 001 Device 001: ID 0000:0000

I'm using udev 104-r13 and pam 0.78-r5.
Back to top
View user's profile Send private message
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3792
Location: sleeping in the bathtub

PostPosted: Thu Aug 16, 2007 8:30 pm    Post subject: Reply with quote

samo wrote:
My user is in the scanner group.
Quote:
$ mount | grep usbfs
none on /proc/bus/usb type usbfs (rw)
You mean the usb group?

Anyway, `mount | grep usbfs` here gives
Code:
usbfs on /proc/bus/usb type usbfs (rw,noexec,nosuid,devmode=0664,devgid=85)

Looks like a likely cause to me.

Try running `mount -o remount,rw,noexec,nosuid,devmode=0664,devgid=85 /proc/bus/usb`
_________________
"You have to invite me in"
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 489

PostPosted: Thu Aug 16, 2007 8:53 pm    Post subject: Reply with quote

My user is in both groups
Quote:
# groups
root bin daemon sys adm disk lp wheel floppy audio dialout tape video mysql
After the following chance the scanner works also for my user
Quote:
# chmod a+rw /proc/bus/usb/001/002
The following line also works
Quote:
# mount -o remount,rw,noexec,nosuid,devmode=0664,devgid=85 /proc/bus/usb/
So how can I chance the permissions automatically?

Last edited by samo on Fri Aug 17, 2007 5:20 am; edited 2 times in total
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Thu Aug 16, 2007 10:23 pm    Post subject: Reply with quote

samo wrote:
# groups
root ...

That's wrong. Run it when you're not the root user.
Code:
whoami
groups
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 489

PostPosted: Fri Aug 17, 2007 5:23 am    Post subject: Reply with quote

Sorry, correct is
Quote:
$ groups
tty lp wheel audio cdrom dialout video games usb users portage burning scanner plugdev
Back to top
View user's profile Send private message
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3792
Location: sleeping in the bathtub

PostPosted: Fri Aug 17, 2007 6:08 am    Post subject: Reply with quote

Samo, are you happy with this, or are you still looking for the root cause?

You could put the remount command into /etv/conf.d/local.start
_________________
"You have to invite me in"
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 489

PostPosted: Mon Aug 20, 2007 6:18 pm    Post subject: Reply with quote

The described workaround is not really practical. I don't understand why the scanner works for users, after
Quote:
chmod g+rw /proc/bus/usb/001/002
Why users need write access?
Quote:
# lsusb
Bus 002 Device 004: ID 0d7d:0100 Phison Electronics Corp. PS1001/1011/1006/1026 Flash Disk
Bus 002 Device 003: ID 046a:0001 Cherry GmbH My3000 Keyboard
Bus 002 Device 002: ID 046a:0003 Cherry GmbH My3000 Hub
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 003: ID 04a9:106b Canon, Inc. S520 Printer
Bus 001 Device 002: ID 04b8:011f Seiko Epson Corp. Perfection 1670
Bus 001 Device 001: ID 0000:0000
# ls -l /proc/bus/usb/001/
insgesamt 0
-rw-r--r-- 1 root root 43 20. Aug 2007 001
-rw-rw-r-- 1 root root 57 20. Aug 20:01 002
-rw-r--r-- 1 root root 50 20. Aug 20:05 003
# ls -l /proc/bus/usb/002/
insgesamt 0
-rw-r--r-- 1 root root 43 20. Aug 2007 001
-rw-r--r-- 1 root root 43 20. Aug 2007 002
-rw-r--r-- 1 root root 52 20. Aug 2007 003
-rw-r--r-- 1 root root 57 20. Aug 20:06 004
Why does the scanner need write access for users, but all other devices not?
Back to top
View user's profile Send private message
Rob1n
l33t
l33t


Joined: 29 Nov 2003
Posts: 714
Location: Cambridge, UK

PostPosted: Mon Aug 20, 2007 6:37 pm    Post subject: Reply with quote

samo wrote:
Why does the scanner need write access for users, but all other devices not?

Are you sure everything else is working fully? The scanner needs write permissions on the USB device because you need to send scan requests, etc. over the USB bus. The keyboard & mouse probably don't (though I would've thought you'd need write permissions to toggle the keyboard LEDs) as they're purely input devices. I'm very surprised that the flash disk works without write permissions.

More of a question is why the /proc/bus/usb filesystem isn't being mounted with full permissions - from looking at /etc/init.d/localmount (where it's mounted from) it looks like it should add the mount options providing have a usb group defined ("getent group usb" is the command it uses to get this).
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 489

PostPosted: Mon Aug 20, 2007 7:35 pm    Post subject: Reply with quote

I just updated udev to version 114 and now the scanner is not recognized by root
Quote:
# dmesg | grep -i usb
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
ohci_hcd: 2006 August 04 USB 1.1 'Open' Host Controller (OHCI) Driver
ohci_hcd 0000:00:02.0: new USB bus registered, assigned bus number 1
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
ohci_hcd 0000:00:02.1: new USB bus registered, assigned bus number 2
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
usb 1-2: new full speed USB device using ohci_hcd and address 2
usb 1-2: configuration #1 chosen from 1 choice
usb 2-2: new full speed USB device using ohci_hcd and address 2
usb 2-2: configuration #1 chosen from 1 choice
hub 2-2:1.0: USB hub found
usb 2-2.4: new full speed USB device using ohci_hcd and address 3
usb 2-2.4: configuration #1 chosen from 1 choice
input: USB HID v1.00 Keyboard [HID 046a:0001] on usb-0000:00:02.1-2.4
usbcore: registered new interface driver usbhid
drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver

# lsusb
Bus 002 Device 003: ID 046a:0001 Cherry GmbH My3000 Keyboard
Bus 002 Device 002: ID 046a:0003 Cherry GmbH My3000 Hub
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000

# ls -l /proc/bus/usb/001
insgesamt 0
-rw-r--r-- 1 root root 43 21. Aug 2007 001
-rw-r--r-- 1 root root 57 21. Aug 2007 002

gentoo thomas # ls -l /proc/bus/usb/002
insgesamt 0
-rw-r--r-- 1 root root 43 21. Aug 2007 001
-rw-r--r-- 1 root root 43 21. Aug 2007 002
-rw-r--r-- 1 root root 52 21. Aug 2007 003

sane-find-scanner doesn't find anything.
So now I have to solve this problem first.
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 489

PostPosted: Mon Aug 20, 2007 7:46 pm    Post subject: Reply with quote

After removing the following rule from 10-udev.rules, the scanner was recognized again and now the scanner works also for users.
Quote:
BUS=="usb", SYSFS{product}=="EPSON Scanner", NAME="usb/scanner", SYMLINK="scanner", GROUP="scanner", MODE="0660"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum