* [gentoo-user] hotplug permissions xsane
@ 2005-07-17 13:01 Dave S
2005-07-17 18:04 ` [gentoo-user][SOLVED] " Dave S
2005-07-17 18:07 ` [gentoo-user] " Zac Medico
0 siblings, 2 replies; 3+ messages in thread
From: Dave S @ 2005-07-17 13:01 UTC (permalink / raw
To: Gentoo
Hello all,
My scanner was working OK till I did a 'emerge -uDv world'. xsane now
picks up my logitech webcam instead of my scanner and does not see my
scanner.
In root xsane sees both devices, asks me which one to use and all is OK,
so its a permissions problem.
vanda_comp dave # lsusb
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 006: ID 046d:08b2 Logitech, Inc. QuickCam Pro 4000
Bus 001 Device 005: ID 055f:0008 Mustek Systems, Inc. ScanExpress 1200
CU Plus
Bus 001 Device 004: ID 056a:0011 Wacom Co., Ltd Graphire 2
Bus 001 Device 003: ID 04b8:0005 Seiko Epson Corp. Stylus Printer
Bus 001 Device 002: ID 0409:0050 NEC Corp.
Bus 001 Device 001: ID 0000:0000
vanda_comp dave #
dave@vanda_comp /proc/bus/usb/001 $ ls -al
total 0
dr-xr-xr-x 2 root root 0 Jul 17 13:15 .
drwxr-xr-x 4 root root 0 Jul 17 13:15 ..
-rw-r--r-- 1 root root 43 Jul 17 13:15 001
-rw-r--r-- 1 root root 43 Jul 17 13:15 002
-rw-r--r-- 1 root root 50 Jul 17 13:15 003
-rw-r--r-- 1 root root 52 Jul 17 13:15 004
-rw-r--r-- 1 root root 57 Jul 17 13:15 005
-rw-r--r-- 1 root root 508 Jul 17 13:15 006
dave@vanda_comp /proc/bus/usb/001 $
Looking in hotplug I have stripped down the usermap to just my scanners
entry to make sure it is seen - it matches 055f 0008.
dave@vanda_comp /etc/hotplug/usb $ cat libsane.usermap
# This file is part of sane-backends.
#
# The entries below are used to detect a USB scanner when it's plugged in
# and then run the libusbscanner script to change the ownership and
# permissions on the "device node" used by libusb.
#
.....
#
#
# The following list already contains a lot of scanners. If your scanner
# isn't mentioned there, add it as explained above and mail the entry to
# the sane-devel mailing list.
#
# Hewlett-Packard|ScanJet 4100C
# Mustek Systems Inc.|ScanExpress 1200 CU Plus
libusbscanner 0x0003 0x055f 0x0008 0x0000
0x0000 0x00 0x00 0x00
0x00 0x00 0x00 0x00000000
dave@vanda_comp /etc/hotplug/usb $
dave@vanda_comp /etc/hotplug/usb $ cat libusbscanner
#!/bin/sh
# This file is part of sane-backends.
#
# This script changes the permissions and ownership of a USB device under
# /proc/bus/usb to grant access to this device to users in the scanner
group.
#
# Ownership is set to root:scanner, permissions are set to 0660.
#
# Arguments :
# -----------
# ACTION=[add|remove]
# DEVICE=/proc/bus/usb/BBB/DDD
# TYPE=usb
# latest hotplug doesn't set DEVICE on 2.6.x kernels
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
# That's an insecure but simple alternative
# Everyone has access to the scanner
# if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then
# chmod 0666 "$DEVICE"
# fi
dave@vanda_comp /etc/hotplug/usb $
Should set my scanner to the scanner group but does not. If I unplug my
scanner & re-plug it in I get ...
vanda_comp dave # lsusb
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 007: ID 055f:0008 Mustek Systems, Inc. ScanExpress 1200
CU Plus
Bus 001 Device 006: ID 046d:08b2 Logitech, Inc. QuickCam Pro 4000
Bus 001 Device 004: ID 056a:0011 Wacom Co., Ltd Graphire 2
Bus 001 Device 003: ID 04b8:0005 Seiko Epson Corp. Stylus Printer
Bus 001 Device 002: ID 0409:0050 NEC Corp.
Bus 001 Device 001: ID 0000:0000
vanda_comp dave #
dave@vanda_comp /proc/bus/usb/001 $ ls -al
total 0
dr-xr-xr-x 2 root root 0 Jul 17 13:15 .
drwxr-xr-x 4 root root 0 Jul 17 13:15 ..
-rw-r--r-- 1 root root 43 Jul 17 13:15 001
-rw-r--r-- 1 root root 43 Jul 17 13:15 002
-rw-r--r-- 1 root root 50 Jul 17 13:15 003
-rw-r--r-- 1 root root 52 Jul 17 13:15 004
-rw-r--r-- 1 root root 508 Jul 17 13:15 006
-rw-rw---- 1 root scanner 57 Jul 17 13:55 007
dave@vanda_comp /proc/bus/usb/001 $
Everything works AOK and I can scan. However unplugging & plugging in
scanners every time the machine starts is a pain.
Hotplug is started on bootup ...
vanda_comp 001 # rc-update add hotplug default
* hotplug already installed in runlevel default; skipping
vanda_comp 001 #
but does not seem to setup my scanner. I also found that just ...
vanda_comp 001 # /etc/init.d/hotplug restart
vanda_comp 001 #
does not setup my scanner, I do have to unplug & plug it in.
Any suggestions as to where to go from here ?
Dave
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [gentoo-user][SOLVED] hotplug permissions xsane
2005-07-17 13:01 [gentoo-user] hotplug permissions xsane Dave S
@ 2005-07-17 18:04 ` Dave S
2005-07-17 18:07 ` [gentoo-user] " Zac Medico
1 sibling, 0 replies; 3+ messages in thread
From: Dave S @ 2005-07-17 18:04 UTC (permalink / raw
To: gentoo-user
Dave S wrote:
>Hello all,
>
>My scanner was working OK till I did a 'emerge -uDv world'. xsane now
>picks up my logitech webcam instead of my scanner and does not see my
>scanner.
>
>In root xsane sees both devices, asks me which one to use and all is OK,
>so its a permissions problem.
>
>
>
>
>vanda_comp dave # lsusb
>Bus 002 Device 001: ID 0000:0000
>Bus 001 Device 006: ID 046d:08b2 Logitech, Inc. QuickCam Pro 4000
>Bus 001 Device 005: ID 055f:0008 Mustek Systems, Inc. ScanExpress 1200
>CU Plus
>Bus 001 Device 004: ID 056a:0011 Wacom Co., Ltd Graphire 2
>Bus 001 Device 003: ID 04b8:0005 Seiko Epson Corp. Stylus Printer
>Bus 001 Device 002: ID 0409:0050 NEC Corp.
>Bus 001 Device 001: ID 0000:0000
>vanda_comp dave #
>
>dave@vanda_comp /proc/bus/usb/001 $ ls -al
>total 0
>dr-xr-xr-x 2 root root 0 Jul 17 13:15 .
>drwxr-xr-x 4 root root 0 Jul 17 13:15 ..
>-rw-r--r-- 1 root root 43 Jul 17 13:15 001
>-rw-r--r-- 1 root root 43 Jul 17 13:15 002
>-rw-r--r-- 1 root root 50 Jul 17 13:15 003
>-rw-r--r-- 1 root root 52 Jul 17 13:15 004
>-rw-r--r-- 1 root root 57 Jul 17 13:15 005
>-rw-r--r-- 1 root root 508 Jul 17 13:15 006
>dave@vanda_comp /proc/bus/usb/001 $
>
>
>
>
>
>Looking in hotplug I have stripped down the usermap to just my scanners
>entry to make sure it is seen - it matches 055f 0008.
>
>
>
>
>
>dave@vanda_comp /etc/hotplug/usb $ cat libsane.usermap
># This file is part of sane-backends.
>#
># The entries below are used to detect a USB scanner when it's plugged in
># and then run the libusbscanner script to change the ownership and
># permissions on the "device node" used by libusb.
>#
>
>.....
>
>#
>#
># The following list already contains a lot of scanners. If your scanner
># isn't mentioned there, add it as explained above and mail the entry to
># the sane-devel mailing list.
>#
># Hewlett-Packard|ScanJet 4100C
># Mustek Systems Inc.|ScanExpress 1200 CU Plus
>libusbscanner 0x0003 0x055f 0x0008 0x0000
>0x0000 0x00 0x00 0x00
>0x00 0x00 0x00 0x00000000
>dave@vanda_comp /etc/hotplug/usb $
>
>
>
>
>
>dave@vanda_comp /etc/hotplug/usb $ cat libusbscanner
>#!/bin/sh
>
># This file is part of sane-backends.
>#
># This script changes the permissions and ownership of a USB device under
># /proc/bus/usb to grant access to this device to users in the scanner
>group.
>#
># Ownership is set to root:scanner, permissions are set to 0660.
>#
># Arguments :
># -----------
># ACTION=[add|remove]
># DEVICE=/proc/bus/usb/BBB/DDD
># TYPE=usb
>
># latest hotplug doesn't set DEVICE on 2.6.x kernels
>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
>
>
># That's an insecure but simple alternative
># Everyone has access to the scanner
>
># if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then
># chmod 0666 "$DEVICE"
># fi
>dave@vanda_comp /etc/hotplug/usb $
>
>
>
>
>Should set my scanner to the scanner group but does not. If I unplug my
>scanner & re-plug it in I get ...
>
>
>
>
>
>vanda_comp dave # lsusb
>Bus 002 Device 001: ID 0000:0000
>Bus 001 Device 007: ID 055f:0008 Mustek Systems, Inc. ScanExpress 1200
>CU Plus
>Bus 001 Device 006: ID 046d:08b2 Logitech, Inc. QuickCam Pro 4000
>Bus 001 Device 004: ID 056a:0011 Wacom Co., Ltd Graphire 2
>Bus 001 Device 003: ID 04b8:0005 Seiko Epson Corp. Stylus Printer
>Bus 001 Device 002: ID 0409:0050 NEC Corp.
>Bus 001 Device 001: ID 0000:0000
>vanda_comp dave #
>
>dave@vanda_comp /proc/bus/usb/001 $ ls -al
>total 0
>dr-xr-xr-x 2 root root 0 Jul 17 13:15 .
>drwxr-xr-x 4 root root 0 Jul 17 13:15 ..
>-rw-r--r-- 1 root root 43 Jul 17 13:15 001
>-rw-r--r-- 1 root root 43 Jul 17 13:15 002
>-rw-r--r-- 1 root root 50 Jul 17 13:15 003
>-rw-r--r-- 1 root root 52 Jul 17 13:15 004
>-rw-r--r-- 1 root root 508 Jul 17 13:15 006
>-rw-rw---- 1 root scanner 57 Jul 17 13:55 007
>dave@vanda_comp /proc/bus/usb/001 $
>
>
>
>
>
>Everything works AOK and I can scan. However unplugging & plugging in
>scanners every time the machine starts is a pain.
>
>Hotplug is started on bootup ...
>
>
>
>
>
>vanda_comp 001 # rc-update add hotplug default
> * hotplug already installed in runlevel default; skipping
>vanda_comp 001 #
>
>
>
>
>but does not seem to setup my scanner. I also found that just ...
>
>
>
>
>vanda_comp 001 # /etc/init.d/hotplug restart
>vanda_comp 001 #
>
>
>
>
>does not setup my scanner, I do have to unplug & plug it in.
>
>Any suggestions as to where to go from here ?
>
>Dave
>
>
>
>
emerge coldplug
rc-update add coldplug default
patch coldplug api bug 83738
re-boot & it works :-)
Dave
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [gentoo-user] hotplug permissions xsane
2005-07-17 13:01 [gentoo-user] hotplug permissions xsane Dave S
2005-07-17 18:04 ` [gentoo-user][SOLVED] " Dave S
@ 2005-07-17 18:07 ` Zac Medico
1 sibling, 0 replies; 3+ messages in thread
From: Zac Medico @ 2005-07-17 18:07 UTC (permalink / raw
To: gentoo-user
Dave S wrote:
[snip]
>
> does not setup my scanner, I do have to unplug & plug it in.
>
> Any suggestions as to where to go from here ?
>
> Dave
>
Sounds like maybe coldplug will do it.
emerge coldplug
rc-update add coldplug default
Zac
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-07-17 18:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-17 13:01 [gentoo-user] hotplug permissions xsane Dave S
2005-07-17 18:04 ` [gentoo-user][SOLVED] " Dave S
2005-07-17 18:07 ` [gentoo-user] " Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox