LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-11-2005, 11:47 AM   #1
justin_p
Member
 
Registered: Jan 2004
Location: Virginia, USA
Distribution: slack 13; I've used it all :)
Posts: 433

Rep: Reputation: 30
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
 
Old 06-11-2005, 12:00 PM   #2
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
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.
 
Old 06-11-2005, 12:23 PM   #3
justin_p
Member
 
Registered: Jan 2004
Location: Virginia, USA
Distribution: slack 13; I've used it all :)
Posts: 433

Original Poster
Rep: Reputation: 30
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?
 
Old 06-11-2005, 01:34 PM   #4
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 50
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.
 
Old 06-11-2005, 01:51 PM   #5
justin_p
Member
 
Registered: Jan 2004
Location: Virginia, USA
Distribution: slack 13; I've used it all :)
Posts: 433

Original Poster
Rep: Reputation: 30
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.

Last edited by justin_p; 06-11-2005 at 01:58 PM.
 
Old 06-11-2005, 02:10 PM   #6
justin_p
Member
 
Registered: Jan 2004
Location: Virginia, USA
Distribution: slack 13; I've used it all :)
Posts: 433

Original Poster
Rep: Reputation: 30
Fixed it. Check out this page. http://digikam.free.fr/hotplug/howto.html
 
Old 06-11-2005, 02:50 PM   #7
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 50
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?
 
Old 06-11-2005, 05:16 PM   #8
brokenflea
Member
 
Registered: Nov 2003
Distribution: Slackware 11.0, FreeBSD
Posts: 284

Rep: Reputation: 30
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.
 
Old 06-11-2005, 08:36 PM   #9
justin_p
Member
 
Registered: Jan 2004
Location: Virginia, USA
Distribution: slack 13; I've used it all :)
Posts: 433

Original Poster
Rep: Reputation: 30
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.


Last edited by justin_p; 06-11-2005 at 08:45 PM.
 
Old 06-28-2005, 08:04 PM   #10
fcaraballo
Member
 
Registered: Feb 2004
Location: WA
Distribution: Slackware
Posts: 230

Rep: Reputation: 31
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
 
Old 07-01-2005, 12:26 PM   #11
fcaraballo
Member
 
Registered: Feb 2004
Location: WA
Distribution: Slackware
Posts: 230

Rep: Reputation: 31
Still havn't got it to work. Suggestions. Anyone?

MagicMan

P.S. Happy 4th of July weekend all
 
Old 07-02-2005, 10:16 AM   #12
shepper
Member
 
Registered: Mar 2003
Location: Dry, Dusty and Conservative
Distribution: OpenBSD, Debian Wheezy/Jessie
Posts: 449

Rep: Reputation: 33
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
 
Old 07-05-2005, 11:46 AM   #13
fcaraballo
Member
 
Registered: Feb 2004
Location: WA
Distribution: Slackware
Posts: 230

Rep: Reputation: 31
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Digikam connecting as root/not connecting as regular user jayhel Slackware 5 09-29-2005 05:57 PM
CDRom works under /Root, not under non-/root junger Linux - Hardware 6 07-25-2005 07:26 PM
My sanner just works as root??? debora Slackware 3 09-29-2004 11:11 AM
IntelliMouse thumb buttons work as root, broken as non-root user, wheel works always digital vortex Linux - Hardware 7 03-02-2004 04:14 PM
Camera only works as root. ToolBoy Linux - Hardware 1 06-23-2003 07:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration