View previous topic :: View next topic |
Author |
Message |
arendald Tux's lil' helper
Joined: 29 Nov 2003 Posts: 89
|
Posted: Wed Apr 20, 2005 6:36 pm Post subject: |
|
|
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 |
|
|
diastelo Guru
Joined: 23 Feb 2004 Posts: 521
|
Posted: Wed Apr 20, 2005 7:23 pm Post subject: |
|
|
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 |
|
|
arendald Tux's lil' helper
Joined: 29 Nov 2003 Posts: 89
|
Posted: Thu Apr 21, 2005 12:11 am Post subject: |
|
|
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 |
|
|
diastelo Guru
Joined: 23 Feb 2004 Posts: 521
|
Posted: Thu Apr 21, 2005 1:04 pm Post subject: |
|
|
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 |
|
|
arendald Tux's lil' helper
Joined: 29 Nov 2003 Posts: 89
|
Posted: Thu Apr 21, 2005 1:57 pm Post subject: |
|
|
I did some time ago. Testing now. |
|
Back to top |
|
|
arendald Tux's lil' helper
Joined: 29 Nov 2003 Posts: 89
|
Posted: Mon Apr 25, 2005 10:16 am Post subject: |
|
|
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 |
|
|
diastelo Guru
Joined: 23 Feb 2004 Posts: 521
|
Posted: Mon Apr 25, 2005 3:35 pm Post subject: |
|
|
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 |
|
|
Headrush Watchman
Joined: 06 Nov 2003 Posts: 5597 Location: Bizarro World
|
Posted: Wed Apr 27, 2005 8:40 pm Post subject: |
|
|
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 |
|
|
|