Find the answer to your Linux question:
Results 1 to 7 of 7
My scanner works perfectly for my wife and me if EITHER she OR me are logged on. But if we both are logged on (same box with different sessions) only ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2005
    Posts
    5

    udev and group permission


    My scanner works perfectly for my wife and me if EITHER she OR me are logged on.

    But if we both are logged on (same box with different sessions) only the one of us who has logged in first owns the device and the other one isn't allowed to use it.

    I thougt a solution might be to add a 00-local.rules in the /etc/udev/rules.d directory with the line
    __________________________________________________ _____
    BUS="usb", SYSFS{idProduct}="220e", SYSFS{idVendor}="04a9", NAME="usb/%k", MODE="660", GROUP="users"
    __________________________________________________ _____
    in it but without success (we are both member of the users group of course).

    Using "strace scanimage -L" I found the difference. For the one logged on first the relevant portion is
    __________________________________________________ _____
    open("/proc/bus/usb/001/006", O_RDWR) = -1 EACCES (Permission denied)
    socket(PF_FILE, SOCK_STREAM, 0) = 3
    connect(3, {sa_family=AF_FILE, path="/var/run/.resmgr_socket"}, 25) = 0
    fcntl(3, F_SETFD, FD_CLOEXEC) = 0
    rt_sigaction(SIGPIPE, {SIG_IGN}, {SIG_DFL}, = 0
    sendmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"open usb:001,006\n", 18}], msg_controllen=0, msg_flags=0}, 0) = 18
    rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, = 0
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"1", 1}], msg_controllen=24, {cmsg_len=20, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, {4}}, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"0", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"0", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{" ", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"s", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"u", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"c", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"c", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"e", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"s", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"s", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"\n", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    close(3) = 0
    __________________________________________________ _____

    which reads as '100 success' and the output is

    __________________________________________________ _____
    peter@baer:~> scanimage -L
    device `plustek:libusb:001:006' is a Canon N1240U/LiDE30 USB flatbed scanner
    device `plustek:libusb:001:006' is a Canon N1240U/LiDE30 USB flatbed scanner
    __________________________________________________ _____

    For the one logged on thereafter the same lines are
    __________________________________________________ _____
    open("/proc/bus/usb/001/006", O_RDWR) = -1 EACCES (Permission denied)
    socket(PF_FILE, SOCK_STREAM, 0) = 3
    connect(3, {sa_family=AF_FILE, path="/var/run/.resmgr_socket"}, 25) = 0
    fcntl(3, F_SETFD, FD_CLOEXEC) = 0
    rt_sigaction(SIGPIPE, {SIG_IGN}, {SIG_DFL}, = 0
    sendmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"open usb:001,006\n", 18}], msg_controllen=0, msg_flags=0}, 0) = 18
    rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, = 0
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"5", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"0", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"2", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{" ", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"p", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"e", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"r", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"m", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"i", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"s", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"s", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"i", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"o", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"n", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{" ", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"d", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"e", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"n", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"i", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"e", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"d", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"\n", 1}], msg_controllen=0, msg_flags=0}, 0) = 1
    close(3) = 0
    __________________________________________________ _____

    which means '502 permission denied' and the output is

    __________________________________________________ _____
    steffi@baer:~> scanimage -L

    No scanners were identified. If you were expecting something different,
    check that the scanner is plugged in, turned on and detected by the
    sane-find-scanner tool (if appropriate). Please read the documentation
    which came with this software (README, FAQ, manpages).
    __________________________________________________ _____

    What do I have to check/change?

    PS:

    Disto: SUSE 9.3 64bit

    baer:~ # kernelversion
    2.6

  2. #2
    Linux User eugrus's Avatar
    Join Date
    Dec 2004
    Location
    Russia
    Posts
    391
    With udev you can change device permissions in /etc/udev/permissions.d/*udev.permissions config-file.

  3. #3
    Just Joined!
    Join Date
    Apr 2005
    Posts
    5
    Maybe its distro dependent or u have an older udev version. Here the directory permissions.d lies directly under /etc and contains no such file:

    peter@baer:/etc/permissions.d> ls
    apache2 cups-client postfix susehelp tetex tetex.paranoid

    Other relevant directories are:
    peter@baer:/etc/udev> ls
    rules.d scripts udev.conf

    peter@baer:/etc/udev/rules.d> ls
    00-local.rules 20-cdrom.rules 45-volume_label.rules
    00-local.rules~ 41-usb.rules 50-udev.rules

    Thx for your help

  4. $spacer_open
    $spacer_close
  5. #4
    Linux User eugrus's Avatar
    Join Date
    Dec 2004
    Location
    Russia
    Posts
    391
    Code:
    locate udev.permissions

  6. #5
    Just Joined!
    Join Date
    Apr 2005
    Posts
    5
    must be distro/release differences. Since I don't use locate I did a

    baer:/home/peter # find / -name udev.permissions 2>/dev/null
    /usr/share/doc/packages/udev/examples/udev.permissions

    So the only udev.permissions is an example file.

    Thx again for your help

  7. #6
    Linux User eugrus's Avatar
    Join Date
    Dec 2004
    Location
    Russia
    Posts
    391
    What distro do you use?

  8. #7
    Just Joined!
    Join Date
    Apr 2005
    Posts
    5
    Suse 9.3 as I stated in my profile and in my original posting

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •