Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
scanner troubles
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
arendald
Tux's lil' helper
Tux's lil' helper


Joined: 29 Nov 2003
Posts: 89

PostPosted: Wed Apr 20, 2005 6:36 pm    Post subject: Reply with quote

I've mistaken /etc/hotplug/usb/libscanner for /etc/hotplug/usb/libusbscanner. The permissions I gave in my last post were for /etc/hotplug/usb/libusbscanner.

Code:

ls -l
total 64
-rw-r--r--  1 root root 48085 Apr 12 16:52 libsane.usermap
-rwxr-xr-x  1 root root  1316 Apr 12 16:52 libusbscanner
-rwxr-xr-x  1 root root   948 Dec 31 14:44 tascam_fpga
-rwxr-xr-x  1 root root  1114 Dec 31 14:44 tascam_fw
-rwxr-xr-x  1 root root   414 Dec 31 14:44 tascam_fw.usermap
Back to top
View user's profile Send private message
diastelo
Guru
Guru


Joined: 23 Feb 2004
Posts: 521

PostPosted: Wed Apr 20, 2005 7:23 pm    Post subject: Reply with quote

I'm going to try again here. /etc/hotplug/usb/libusbscanner is a text file.

Open the file /etc/hotplug/usb/libusbscanner. Scroll to the bottom. Look at what permissions it is setting (not what permissions the file itself has).
_________________
"No question is so difficult to answer as that to which the answer is obvious" -- George Bernard Shaw
Back to top
View user's profile Send private message
arendald
Tux's lil' helper
Tux's lil' helper


Joined: 29 Nov 2003
Posts: 89

PostPosted: Thu Apr 21, 2005 12:11 am    Post subject: Reply with quote

Hum ok here is the content.

Code:

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


if [ -z "${DEVICE}" ] ; then
        IF=$(echo ${DEVPATH} | sed 's:\(bus/usb/devices/\)\(.*\)-\(.*\):\2:')
        if [ -r /sys/${DEVPATH}/devnum ]; then
             DEV=$(cat /sys/${DEVPATH}/devnum)
        else
             DEV=1 # you'll have to adjust this manually for kernel < 2.6.6
        fi
        DEVICE=$(printf '/proc/bus/usb/%.03d/%.03d' ${IF} ${DEV})
fi

if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then
  chown root:scanner "$DEVICE"
  chmod 0660 "$DEVICE"
fi


I'm not very familiar with shell script but I guess if I want to be able to use as user I should have something like

Code:

if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then
  chown myuser:scanner "$DEVICE"
  chmod 0660 "$DEVICE"
fi


right ?
Back to top
View user's profile Send private message
diastelo
Guru
Guru


Joined: 23 Feb 2004
Posts: 521

PostPosted: Thu Apr 21, 2005 1:04 pm    Post subject: Reply with quote

That should work. Just make sure you've added yourself to the scanner group first.
_________________
"No question is so difficult to answer as that to which the answer is obvious" -- George Bernard Shaw
Back to top
View user's profile Send private message
arendald
Tux's lil' helper
Tux's lil' helper


Joined: 29 Nov 2003
Posts: 89

PostPosted: Thu Apr 21, 2005 1:57 pm    Post subject: Reply with quote

I did some time ago. Testing now.
Back to top
View user's profile Send private message
arendald
Tux's lil' helper
Tux's lil' helper


Joined: 29 Nov 2003
Posts: 89

PostPosted: Mon Apr 25, 2005 10:16 am    Post subject: Reply with quote

I tried

Code:

if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then
  chown myuser:scanner "$DEVICE"
  chmod 0660 "$DEVICE"
fi


and

Code:

if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then
  chmod 0666 "$DEVICE"
fi


This last solution is mentionned in the file as "an insecure and simple alternative" for everyone access.

None of them works so far.
Back to top
View user's profile Send private message
diastelo
Guru
Guru


Joined: 23 Feb 2004
Posts: 521

PostPosted: Mon Apr 25, 2005 3:35 pm    Post subject: Reply with quote

Either the permissions are not getting applied correctly, or something else is blocking it.

While this link might not match your scanner exactly, it gives some advice on how you might get the permissions set up correctly using hotplug: http://khk.net/sane/libusb.html. You should be able to check the numbers it talks about with libusb.
_________________
"No question is so difficult to answer as that to which the answer is obvious" -- George Bernard Shaw
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Wed Apr 27, 2005 8:40 pm    Post subject: Reply with quote

Do you have usbutils installed?

There seems to be a conflict with it and libusb.
I had a scanner that worked for over a year and then recently disappeared. It showed up in lsusb but sane-find-scanner no longer saw it.

Unmerged usbutils and re-emerge libusb and all is well again.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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