LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (http://www.linuxquestions.org/questions/debian-26/)
-   -   printer scanner permission problem (http://www.linuxquestions.org/questions/debian-26/printer-scanner-permission-problem-769750/)

radiodee1 11-17-2009 02:24 PM

printer scanner permission problem
 
I have an all-in-one scanner/printer from HP. I used to be able to scan and print without problem. Now I can print but only scan if I use xsane as root. Xsane says "no devices available". I went to the 'Users and Groups' app under 'System -> Administration' and my user *is* in the scanner group. The checkbox next to 'Use Scanners' is already checked.

I recently removed hpoj, then more recently I tried to reinstall it and aptitude tried to remove hpijs and hplip ... in the past I think I had both installed. hpoj doesn't allow me to select my printer from cups so I'd rather stick with hpijs. I don't know if this effects things at all though.

Thanks in advance. Any help would be appreciated.

Meson 11-17-2009 02:44 PM

I happen to dealing with the problem myself. The problem is that udev is setting the permissions on the usb device /dev/bus/usb/###/### to 0660 with the user root and the group either lp or scanner.

There is a rule in /lib/udev/rules.d/50-udev-default.rules which sets the printer info:
Code:

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="", IMPORT{program}="usb_id --export %p"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}==":0701*:", GROUP="lp", MODE="660"

And anther rule in /lib/udev/rules.d/53-sane.rules which sets the scanner info, there is one rule for each scanner model...

My solution for the moment is to create a custom rule in /etc/udev/rules.d/99-custom.rules:
Code:

ATTR{idVendor}=="04b8", ATTR{idProduct}=="0813", MODE="0666", GROUP="lp"
You need to replace your vendor and product id's, you can find them like this:
Code:

lsusb
Bus 001 Device 002: ID 04b8:0813 Seiko Epson Corp. Stylus CX6500/6600

I don't consider this a good fix though. You could have sane run as group lp (or cups run as group scanner), or create some lpscanner group for the bother of them. I'm not really sure how to reconcile the need for the two groups at the moment.

radiodee1 11-17-2009 03:44 PM

Thanks for the fast reply. I tried this and it works.

BTW, I tried other things after your post that didn't work. There's a file in /etc/default/ called saned. It has an option for "RUN_AS_USER" which I set to "lp". After setting another option "RUN" to "yes" I executed "/etc/init.d/saned restart" but this resulted in nothing useful. Your solution seems to produce the desired effect. If you come across something more elegant, please do post it as it would interest me. Thanks.

Also, do you think this is an error in some particular piece of software? As I stated, the xsane program used to work for me just fine until a few days ago.

tredegar 11-17-2009 04:29 PM

Quote:

Thanks for the fast reply. I tried this and it works.
Good. I am happy for you :)

But ... .. . (and read this to the end, please)

Quote:

As I stated, the xsane program used to work for me just fine until a few days ago.
So, what did you change?

What distro are you running this on ? [Your profile, at Left says "Distribution: Debian etch, lenny, squeeze", so which, exactly, is it?]

Quote:

I have an all-in-one scanner/printer from HP
Ok, but
- What model is it, exactly?
- What is its USB ID, if it is connected by USB ?
- Where's the link to the manufacturer's PDF manual for it?

Etc... .. .

Apologies if you see me as whining at you, but you'll appreciate that LQ is a valuable resource. Google re-indexes it about every minute (so they clearly see it as a useful resource of information).

If you don't include vital search terms ( your scanner's model number, its USB IDs (or other unique identification) your distro... ) then we are less able to help you personally (perhaps by doing searches for you) and the internet search engines will be unable to help other people running your distro with your specific HP scanner problems.

Maybe you have by now solved your problems, with Meson's inspired help but how has that helped the wider community?

Does that matter to you?

Please think about this, and then add a reply to this thread with the DETAILS, so those search-engines can index it to help others searching for a resolution to the same problem.

It's painless
And it all helps ;)

Meson 11-17-2009 04:34 PM

Quote:

Originally Posted by radiodee1 (Post 3760487)
It has an option for "RUN_AS_USER" which I set to "lp".

We are working with GROUPS here, not USERS.

radiodee1 11-17-2009 04:38 PM

Quote:

Originally Posted by Meson (Post 3760528)
We are working with GROUPS here, not USERS.

Thanks. It didn't work, but I tried that so I wrote that I tried that. It was obviously dumb.

radiodee1 11-17-2009 04:51 PM

Quote:

Originally Posted by tredegar (Post 3760521)
Good. I am happy for you :)

So, what did you change?

I think I said that I tried to uninstall 'hpoj' and found that I couldn't re-install it without removing other vital print oriented packages. I believe that at an earlier time I had all of those packages installed, hpoj, hpijs, and hplip. I may be wrong but I thought I was clear.
Quote:

What distro are you running this on ? [Your profile, at Left says "Distribution: Debian etch, lenny, squeeze", so which, exactly, is it?]
Right now I use Debian Squeeze. I used to run Etch and Lenny. I've reinstalled once because I changed hardware (if that makes sense...)
Quote:

Ok, but
- What model is it, exactly?
- What is its USB ID, if it is connected by USB ?
- Where's the link to the manufacturer's PDF manual for it?
Sorry about that.
HP Photosmart C3180 All-in-one
Bus 003 Device 002: ID 03f0:5611 Hewlett-Packard PhotoSmart C3180
I don't have a link for the manufacturer's manual.
Quote:

Please think about this, and then add a reply to this thread with the DETAILS, so those search-engines can index it to help others searching for a resolution to the same problem.

It's painless
And it all helps ;)
I didn't think my original post was that bad.

JanHeldal 12-08-2009 05:17 PM

Scanner permission problem: A simple solution that worked for me.
 
Hi.
I have recently installed Arch Linux. However, my multipurpose printer-scanner (a HP Deskjet F2280 ) would not scan unless I ran xsane as root. (Sane could only find a scanner if it ran with root permissions.) A friend helped me track down the problem. It was not sufficient for the user to be in the "scanner" group, but adding the user to the "lp" group as well, solved the problem. (A user can be a member of many groups simultaneously.)
Hope this info will help someone out there.

Meson 12-09-2009 11:58 PM

Quote:

Originally Posted by JanHeldal (Post 3784626)
I have recently installed Arch Linux.

Nice choice =)

fynstee 12-14-2009 11:27 AM

Does anyone know why udev (or sane?) sometimes seems to ignore the rules in the /lib/udev/rules.d directory?

Mensons post (#2) is a good example of what I mean. He had to create a custom rule in /etc/udev/rules.d/99-custom.rules to get his scanner working. I've had to do the same in the past too. Even though both scanner devices were in the /lib/udev/rules.d/53-sane.rules file.

In the end I just copied and pasted everything from the 53-sane.rules file to a custom file /etc/udev/rules.d/96-scanner.rules

Now xsane detects the three different scanners my laptop has access to with no problem (a Mustek 1200, Canoscan n1240u & another which is not mine). But shouldn't 53-sane.rules have allowed that anyway? All three scanners were given rules in 53-sane.rules, so why was a custom file needed in a different directory?

PS. am running Arch-linux also ;)


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