LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   digikam only works as root... (https://www.linuxquestions.org/questions/slackware-14/digikam-only-works-as-root-332485/)

justin_p 06-11-2005 11:47 AM

digikam only works as root...
 
Before I am told to search the forum, I have tried and it keep failing. Anyhow, the questions remains the same. Gphoto and digikam will only work as root. How do I fix it? Thanks

johnson_steve 06-11-2005 12:00 PM

when something only works as root usually its a permission problem. they are trying to access something that your user doesn't have access to. try running these programs from inside an xterm and maybe it'll spit out an error that you couldn't see running them by clicking.

justin_p 06-11-2005 12:23 PM

digikam works. As a user and as root. Same with gphoto. Both wil detect the camera as root and a user. But neither will access the camera as a normal user. with digikam there is no output as the gui just says "Failed to connect to camera". This is the output of gphoto:

justin@lola:~$ gphoto2 -P

*** Error ***
An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (Operation not permitted). Make sure no other program or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device.
*** Error (-53: 'Could not claim the USB device') ***

For debugging messages, please use the --debug option.
Debugging messages may help finding a solution to your problem.
If you intend to send any error or debug messages to the gphoto
developer mailing list <gphoto-devel@lists.sourceforge.net>, please run
gphoto2 as follows:

env LANG=C gphoto2 --debug -P

Please make sure there is sufficient quoting around the arguments.


I know it is a permissions issue. My question is, how do i fix it?

shilo 06-11-2005 01:34 PM

I used to have this problem. If I remember right, the fix was to make sure that you have /etc/hotplug/usb/usbcam and that it looks like this:

Code:

#!/bin/bash
# $Id: usbcam.console,v 1.4 2002/09/12 16:50:18 hun Exp $
#
# /etc/hotplug/usb/usbcam
#
# Sets up newly plugged in USB camera 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. You can get the correct lines for all cameras
#    supported by libgphoto2 by running "print-usb-usermap".
# 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
# "usbcam" 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@redhat.com>
    if [ -f /var/run/console/console.lock ]
    then
        CONSOLEOWNER=`cat /var/run/console/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

If I remember right, hte file I had before was pointing to the wrong location for console.lock.

justin_p 06-11-2005 01:51 PM

That did not work. What should the permission be set at in /etc/hotplug/usb/usbcam?

Also, I tried to chnage the permission of the usb devices in proc. Still no luck.

justin_p 06-11-2005 02:10 PM

Fixed it. Check out this page. http://digikam.free.fr/hotplug/howto.html

shilo 06-11-2005 02:50 PM

Quote:

What should the permission be set at in /etc/hotplug/usb/usbcam?
With the usbcam file that I have, the permissions of the camera are set to 600, witrh the owner being whoever is listed in /var/run/console/console.lock. You plug in the camera, you have the console.lock, you are able to use the camera.

It's possible that this is only able to work because of PAM. I am running Dropline.

What is the output of:
Code:

echo `cat /var/run/console/console.lock`
For me, it is the name of the user currently on the desktop.

Quote:

Also, I tried to chnage the permission of the usb devices in proc. Still no luck.
Did you have the right one? This works every time for me. There is no reason it shouldn't.

Quote:

Fixed it. Check out this page. http://digikam.free.fr/hotplug/howto.html
But that will only work for you as long as you are running KDE, right?

brokenflea 06-11-2005 05:16 PM

here's what worked for me but i give no guarantees if this would work for you or not. but try it anyways.

1. Create a group called "camera" (without the quotes...)

2. Still as root - add your user to that group (the non-root user)

3. Log out and then back in (to reset your groups).

4. Either rename /etc/hotplug/usb.usermap.new to usb.usermap or copy its contents across (cat usb.usermap.new >> usb.usermap).

Now, when you plug in the camera it should appear under /proc/bus/usb/devices and you should be able to access it through gphoto2/digikam/whatever other front-end you choose.

justin_p 06-11-2005 08:36 PM

Actually I changed them both, the permissions on the usb devices in proc. But you both are right, I need to make sure that things are set the correct way incase I elect not run KDE in the future. I'll keep plugging away at it. Thanks for the help.

EDIT: Brokenflea, got it. Worked great. Thanks.


fcaraballo 06-28-2005 08:04 PM

Having the same problem. Works fine as root, not as user. Tried all of the suggestions here but still can't get it to work. Can someone please tell me what permissions you had to change?

MagicMan

fcaraballo 07-01-2005 12:26 PM

Still havn't got it to work. Suggestions. Anyone?

MagicMan

P.S. Happy 4th of July weekend all :D

shepper 07-02-2005 10:16 AM

In reference to Shilo's post on usbcam in hotplug the base Slackware install does not come with PAM. There are a total of 4 usbcam scripts available in Gphoto2.

I make a camera group and add myself to it.

Then use the usbcam.group script which I copy to /etc/hotplug/usb and rename usbcam. There are also usbcam.user and usbcam.X11_app scripts.

The instructions are available on the gphoto2 website.

Gphoto2 USB permissions

fcaraballo 07-05-2005 11:46 AM

Thank you shepper. Worked great. I know I should have done a little more research and found the answer myself, but I think my brain had left for the 4th of July weekend before I did. lol.

MagicMan

P.S. I hope everyone enjoyed their 4th as much as I did. :D


All times are GMT -5. The time now is 11:24 PM.