← Back to team overview

sslug-teknik team mailing list archive

Re: xsane kan ikke finde min scanner

 

Inden vi går for vidt: prøv lige som root.

MVH Torben

Jens Bang wrote:

On Wednesday 24 November 2004 13:51, Torben Andersen wrote:
Min FC 2 havde en fejl i /etc/hotplug/usb/libusbscanner, som jeg var
nødt til at modificere med
chmod 0666 "$DEVICE"

i bunden. Tricket skulle være godt nok på enkeltbruger systemer. Prøv at
trække usb kablet ud og sætte det ind igen. Hvis xsane virker, er det
her du skal sætte ind.

Hmm, jeg ved ikke præcis hvordan jeg skal rette i mit script. Det ser sådan ud:

#!/bin/bash
# $Id: libusbscanner,v 1.1 2004/05/04 13:05:27 twaugh Exp $
#
# /etc/hotplug/usb/libusbscanner
#
# Sets up newly plugged in USB scanner so that the user who owns
# the console according to pam_console can access it from user space
#
# Note that for this script to work, you'll need all of the following:
# a) a line in the file /etc/hotplug/usermap that corresponds to the
#    camera you are using.
# b) a setup using pam_console creates the respective lock files
#    containing the name of the respective user. You can check for that
#    by executing "echo `cat /var/{run,lock}/console.lock`" and
#    verifying the appropriate user is mentioned somewhere there.
# c) a Linux kernel supporting hotplug and usbdevfs
# d) the hotplug package (http://linux-hotplug.sourceforge.net/)
#
# In the usermap file, the first field "usb module" should be named
# "libusbscanner" like this script.
#

if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
then
   # New code, using lock files instead of copying /dev/console permissions
   # This also works with non-gdm logins (e.g. on a virtual terminal)
   # Idea and code from Nalin Dahyabhai <nalin@xxxxxxxxxx>
   if [ -f /var/run/console.lock ]
   then
       CONSOLEOWNER=`cat /var/run/console.lock`
   elif [ -f /var/lock/console.lock ]
   then
       CONSOLEOWNER=`cat /var/lock/console.lock`
   else
       CONSOLEOWNER=
   fi
   if [ -n "$CONSOLEOWNER" ]
   then
       chmod 0000 "${DEVICE}"
       chown "$CONSOLEOWNER" "${DEVICE}"
       chmod 0600 "${DEVICE}"
   fi
fi



Er det OK bare at rette 0600 til 0666 i den sidste chmod linie? Eller skal der være en linie helt til sidst i scriptet (efter den sidste fi), der udfører den chmod du nævnte lige meget hvad?



--
"It's trivial to make fun of Microsoft products,
but it takes a real man to make them work,
and a god to make them do anything useful."



Follow ups

References