You are not logged in.

#1 2009-10-16 22:00:46

Doehni
Member
From: Germany
Registered: 2007-05-19
Posts: 175

[Solved] CUPS 1.4.1: need help with udev rules

I already had a bug report: http://bugs.archlinux.org/task/16693

Since the update of cups to version 1.4.1-1 my printer doesn't print anymore.
I followed the instructions on the news and removed the usblp module.
Also tried to reinstall after the update.

The printer can be seen on the cups page (localhost:631);
but when printing a test page, the status says: "Waiting for printer to become available..."


My printer: Brother DCP 7010L
It is also a scanner, which works perfectly.

Installation was made using this wiki page (with the files for 7010): http://wiki.archlinux.org/index.php/Brother_DCP-7020

In the end it said this:

Comment by Andreas Radke (AndyRTR) - Friday, 16 October 2009, 17:43 GMT+1
you will need a custom udev rule to set proper "lp" permission. see all the threads in our forum. multi devices are not well detected by udev. this is not a packaging bug. it's upstream "design" :S sry.

Now my question: Could you please help me find the proper udev rules?
I already searched the forums and tried a lot, but nothing helped yet...

Last edited by Doehni (2009-10-17 18:38:47)

Offline

#2 2009-10-17 05:10:05

jt512
Member
Registered: 2009-02-19
Posts: 256

Re: [Solved] CUPS 1.4.1: need help with udev rules

I have an Epson Stylus NX400 Printer/Scanner that I couldn't access after the upgrade to CUPS 1.4.  In my case, the problem was that there was a udev rule that was assigning the printer to the 'scanner' group, whereas, apparently, CUPS 1.4 requires that it be in the 'lp' group. 

To fix the problem, I went to the /lib/udev/rules.d directory and found the udev rule that was assigning the printer to the 'scanner' group. I then copied the rule to a file '10-cups-usb.rules' in the /etc/udev/rules.d directory, and edited the rule to assign the printer to the 'lp' group. 

Here is the original rule, which I found in /lib/udev/rules.d/53-sane.rules:

ATTR{idVendor}=="04b8", ATTR{idProduct}=="084a", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"

And here is the edited rule that I put in /etc/udev/rules.d/10-cups-usb.rules:

ATTR{idVendor}=="04b8", ATTR{idProduct}=="084a", MODE:="0664", GROUP:="lp", ENV{libsane_matched}:="yes"

Note that in addition to changing the group to "lp", I changed the assignment operators from '=' to ':=', which, according to the udev documentation, prevents the assignment from being overridden by higher-numbered .rules files.

After writing the new udev rule, I unplugged my printer and plugged it back in, and it was automatically detected.

By some miracle, the scanner works in spite of the new group assignment.

Jay

Last edited by jt512 (2009-10-17 07:10:18)

Offline

#3 2009-10-17 11:29:11

owain
Member
Registered: 2009-08-24
Posts: 233

Re: [Solved] CUPS 1.4.1: need help with udev rules

jt512 wrote:

Note that in addition to changing the group to "lp", I changed the assignment operators from '=' to ':=', which, according to the udev documentation, prevents the assignment from being overridden by higher-numbered .rules files.

Thanks, that got my own rule working as I intended here.  (Hasn't solved my other problem there, though!)

Offline

#4 2009-10-17 14:16:11

Doehni
Member
From: Germany
Registered: 2007-05-19
Posts: 175

Re: [Solved] CUPS 1.4.1: need help with udev rules

@ jt512: Thanks for your help! smile
But it still doesn't work.

What I did: I found the udev rules for my scanner in /etc/udev/rules.d/91-local.rules:

BUS=="usb", SYSFS{product}=="DCP-7010", GROUP="scanner", MODE="0660"

I copied that to /etc/udev/rules.d/10-printer.rules and changed it:

BUS=="usb", SYSFS{product}=="DCP-7010", GROUP:="lp", MODE:="0660"

Also treid setting the MODE to 0664, which didn't help.

Btw, I restarted every time after changing the rules.

Offline

#5 2009-10-17 18:37:21

Doehni
Member
From: Germany
Registered: 2007-05-19
Posts: 175

Re: [Solved] CUPS 1.4.1: need help with udev rules

I got it working again! big_smile
The solution:

This is what I put in 10-cups-usb.rules:

 ATTR{idVendor}=="04f9", ATTR{idProduct}=="0182", MODE:="0664", GROUP:="lp", ENV{libsane_matched}:="yes"

Hope it helps someone smile

(Thanks a lot, qb1base!!)

Last edited by Doehni (2009-10-17 18:38:09)

Offline

#6 2009-10-17 18:57:12

jt512
Member
Registered: 2009-02-19
Posts: 256

Re: [Solved] CUPS 1.4.1: need help with udev rules

OOPS -- Our posts crossed.

@Doehni: Before adding the new rule, did you check to see if your scanner actually had the wrong group?  If you haven't, then you can find the bus/device numbers for your scanner by running `lsusb`.  Then you can run `ls -l /dev/bus/usb/<your-bus-number> and check that the device with your printer's device number has the 'scanner' group or the 'lp' group.  If it in fact has the 'scanner' group, then check it again with the new udev rule to see if the new rule has assigned the 'lp' group.  (First, unplug and replug the printer from the usb port to generate a udev event.)  If the group gets changed to 'lp' and your printer still doesn't work, then you have a second problem to find. 

If the group does not get changed, then the rule you wrote was wrong.  The printer installation instructions you referenced include installing sane.  If you have sane installed, then I would think that you would have a 53-sane.rules file like I do, probably in /lib/udev/rules.d. 

Here's the rule for your printer in my 53-sane-rules.d file

# Brother DCP-7010
ATTR{idVendor}=="04f9", ATTR{idProduct}=="0182", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"

You might want to see if you have the same rule, and use a modified version of it, instead of the rule you came up with.

Jay

Last edited by jt512 (2009-10-17 19:00:40)

Offline

#7 2009-10-17 19:07:15

Doehni
Member
From: Germany
Registered: 2007-05-19
Posts: 175

Re: [Solved] CUPS 1.4.1: need help with udev rules

@jt512: User qb1base has the same printer as I do and he send me an email with the rule I gave above.
Thank you very much for your help!! big_smile

Offline

#8 2009-10-18 09:36:54

Gnux
Member
Registered: 2006-09-27
Posts: 26

Re: [Solved] CUPS 1.4.1: need help with udev rules

Hello
I've got all the same problem with a Brother-HL2030. I posted here how I solve the problem if it could help.

First, I blacklist my usblp module in /etc/rc.conf/

MODULES=(usbcore !usblp)

After that (and a check to my cupsd.conf file) I thought it will be ok..It wasnt in fact, I've got a message telling me that the printer was waiting to be avail or sth like that

So I got to change an udev rule. I create in /etc/udev/rules.d a special file for my printer (10-cups-usb.rules)

[root@deskann rules.d]# cat 10-cups-usb.rules
# Brother HL-2030
ATTR{idVendor}=="04f9", ATTR{idProduct}=="0027", MODE:="0664", GROUP:="lp", ENV{libsane_matched}:="yes"

I found the ATTR values by looking at the lsusb output, in my case:

#lsusb
Bus 004 Device 004: ID 04f9:0027 Brother Industries, Ltd HL-2030 Laser Printer

With that it should work, BUT be very careful, it's := not = . The mode 664 was recommended here, but in a first round, it didn't work.

Finally I got to

#gpasswd my_user lp

and after that it works finally for a test page...

So to sum up:
1 - blacklist usblp and check if cupsd.conf is in his new form (else cp cupsd.conf.pacnew cupsd.conf)
2 - create a custom udev rules in /etc/udev/rules.d for your device (the ATTR values in lsusb + 664 mode). Unplugged your printer and check if your hack works thanks to a #ls -al /dev/bus/usb/<your_bus_number>/
It should give sth like :

[root@deskann rules.d]# ls -al /dev/bus/usb/004/
total 0
drwxr-xr-x  2 root root       80 oct.  18 11:20 .
drwxr-xr-x  7 root root      140 oct.  18 11:06 ..
crw-rw-r--  1 root root 189, 384 oct.  18 11:06 001
crw-rw-r--+ 1 root lp   189, 387 oct.  18 11:28 004

3 - gpasswd your_user lp

Hope it will help ppl sparing some time...

Offline

#9 2009-10-18 19:47:18

*david_a*
Member
Registered: 2009-06-19
Posts: 80

Re: [Solved] CUPS 1.4.1: need help with udev rules

Thank you Gnux - your method worked for me.

Offline

#10 2009-10-19 10:26:40

Dead Code
Member
Registered: 2009-01-18
Posts: 227

Re: [Solved] CUPS 1.4.1: need help with udev rules

thanks Gnux, it worked like a charm

Offline

#11 2009-10-21 03:52:40

Convergence
Member
Registered: 2005-07-02
Posts: 370

Re: [Solved] CUPS 1.4.1: need help with udev rules

Gnux: can you show what the rule looks like once you modified it.  Not sure which part of the lsusb output I should put in there.


It's a very deadly weapon to know what you're doing
---  William Murderface

Offline

#12 2009-10-21 04:26:13

Convergence
Member
Registered: 2005-07-02
Posts: 370

Re: [Solved] CUPS 1.4.1: need help with udev rules

maybe I misunderstood something.   This is what I tried:

#lsusb
Bus 001 Device 004: ID 0781:b7b9 SanDisk Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 046d:c404 Logitech, Inc. TrackMan Wheel
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 03f0:4811 Hewlett-Packard PSC 1600
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
cat /etc/udev/rules.d/10-cups-usb.rules
# HP PSC 1610 
ATTR{Hewlett-Packard}=="03f0", ATTR{PSC 1600}=="4811", MODE:="0664", GROUP:="lp", ENV{libsane_matched}:="yes"

please tell me if I made any mistakes.  Maybe something else should go in the ENV area?

well, in the mean time, maybe I should read other udev rules


It's a very deadly weapon to know what you're doing
---  William Murderface

Offline

#13 2009-10-21 04:30:38

Convergence
Member
Registered: 2005-07-02
Posts: 370

Re: [Solved] CUPS 1.4.1: need help with udev rules

Now trying this string:

ATTR{idVendor}=="03f0", ATTR{idProduct}=="4811", MODE:="0664", GROUP:="lp", ENV{libsane_matched}:="yes"

It's a very deadly weapon to know what you're doing
---  William Murderface

Offline

#14 2009-10-21 17:12:51

Gnux
Member
Registered: 2006-09-27
Posts: 26

Re: [Solved] CUPS 1.4.1: need help with udev rules

Convergence wrote:

Gnux: can you show what the rule looks like once you modified it.  Not sure which part of the lsusb output I should put in there.

I copied the original rule from a generic rule located in /lib/udev/rules.d/* . Then I modified the idvendor and product + the mode (from 0660 to 0664)

As far as I can see, your rule seems correct ie with the right ids: the one I used in fact. The first id is for the idVendor variable and the second for the idProduct var.

Does it work for you finally? And if not, what's your problem?

Last edited by Gnux (2009-10-21 17:14:44)

Offline

#15 2009-10-21 17:47:36

ddamnmess
Member
Registered: 2008-12-27
Posts: 3

Re: [Solved] CUPS 1.4.1: need help with udev rules

Ive also some problems here - but I'm not sure whether I have the right cupsd.conf. Could someone upload his/her cupsd.conf.pacnew so I can check?

Anyway, this

# Epson Stylus DX-5050
ATTR{idVendor}=="04b8", ATTR{idProduct}=="082b", MODE="0664", GROUP="lp", ENV{libsane_matched}:="yes"

is my /etc/udev/rules.d/10-cups-usb.rules, but the printer still is in the group "scanner", not "lp".

[root@rottencore ddamnmess]# ls -l /dev/bus/usb/001
insgesamt 0
crw-rw-r-- 1 root root    189, 0 21. Okt 18:54 001
crw-rw-r-- 1 root root    189, 1 21. Okt 18:54 002
crw-rw-r-- 1 root scanner 189, 2 21. Okt 18:54 003
crw-rw-r-- 1 root root    189, 3 21. Okt 18:54 004

Im in the group lp, usblp is blacklisted, the rule should be correct

# lsusb
Bus 001 Device 003: ID 04b8:082b Seiko Epson Corp. Stylus DX5050

and I unplugged the printer several times, even did a reboot. Still, nothing. The printer seems to be ready, but whenever I want to print something "waiting for printer to be available blabla"

Offline

#16 2009-10-21 19:05:03

grey
Member
From: Europe
Registered: 2007-08-23
Posts: 679

Re: [Solved] CUPS 1.4.1: need help with udev rules

The ownership of the printer device is root:scanner. It needs to be root:lp. Your rule is probably overwritten by a sane rule.
Try

MODE:="0664", GROUP:="lp"

Good ideas do not need lots of lies told about them in order to gain public acceptance.

Offline

#17 2009-10-22 06:15:38

Convergence
Member
Registered: 2005-07-02
Posts: 370

Re: [Solved] CUPS 1.4.1: need help with udev rules

grey: what do you mean?  dd and I used that same snippet in our rule.  I just did a cat /etc/gshadow, and it doesn't have a group called 'lp'.  Do I need to add my users to that group?


It's a very deadly weapon to know what you're doing
---  William Murderface

Offline

#18 2009-10-22 07:25:57

jt512
Member
Registered: 2009-02-19
Posts: 256

Re: [Solved] CUPS 1.4.1: need help with udev rules

@comvergence: If your system really doesn't have an lp group (check the /etc/group file) then you'll have to add it (see 'man groupadd' if unfamiliar).  And, yes, you'll have to add your users to the lp group.  My lp group also has the user "daemon" in it, which, presumably, is important.

Offline

#19 2009-10-22 07:40:38

jt512
Member
Registered: 2009-02-19
Posts: 256

Re: [Solved] CUPS 1.4.1: need help with udev rules

ddamnmess wrote:

Ive also some problems here - but I'm not sure whether I have the right cupsd.conf. Could someone upload his/her cupsd.conf.pacnew so I can check?

Anyway, this

# Epson Stylus DX-5050
ATTR{idVendor}=="04b8", ATTR{idProduct}=="082b", MODE="0664", GROUP="lp", ENV{libsane_matched}:="yes"

As I wrote in my original post to this thread, AFAIK, the assignment operators for MODE and GROUP, as well as for ENV{libsane_matched}, should be ':='.

Jay

Offline

#20 2009-10-28 02:34:43

Convergence
Member
Registered: 2005-07-02
Posts: 370

Re: [Solved] CUPS 1.4.1: need help with udev rules

I have added my users to the lp group, and my printer still won't print.  Should I start a new thread since this thread is marked "resolved" and the fix did not work for me?  It is kind of important.


It's a very deadly weapon to know what you're doing
---  William Murderface

Offline

#21 2009-10-29 20:50:18

ddamnmess
Member
Registered: 2008-12-27
Posts: 3

Re: [Solved] CUPS 1.4.1: need help with udev rules

@grey,jt512: Oh, thanks, you're right. I've changed it, but - still not working. Hm. if noone else has an idea, a new thread would be a good idea... .

Offline

#22 2010-01-03 14:26:35

bnm
Member
Registered: 2010-01-03
Posts: 1

Re: [Solved] CUPS 1.4.1: need help with udev rules

hi everyone

I'm trying to install a DCP 7010L on a freshly installed arch and having the printer working on it would be much apreciated.

I used the wiki page and everything went ok, except it won't print, like Doehni describe it. Anyway I found this topic and did this to my system :

# lsusb 
Bus 002 Device 002: ID 04f9:0182 Brother Industries, Ltd Composite Device
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 005: ID 0bc2:3101 Seagate RSS LLC 
Bus 001 Device 004: ID 058f:6362 Alcor Micro Corp. Hi-Speed 21-in-1 Flash Card Reader/Writer (Internal/External)
Bus 001 Device 003: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
# ls -al /dev/bus/usb/002
total 0
drwxr-xr-x 2 root root          80 janv.  2 19:08 .
drwxr-xr-x 4 root root          80 janv.  2 19:08 ..
crw-rw-r-- 1 root root    189, 128 janv.  2 19:08 001
crw-rw-r-- 1 root scanner 189, 129 janv.  2 19:08 002

#53-sane.rules

# Brother DCP-7010
ATTR{idVendor}=="04f9", ATTR{idProduct}=="0182", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"

#/etc/udev/rules.d/10-cups-usb.rules (created)

 ATTR{idVendor}=="04f9", ATTR{idProduct}=="0182", MODE:="0664", GROUP:="scanner", ENV{libsane_matched}:="yes"

I'm using cups 1.4 and my user is in the lp and scanner groups ...

what am I doing wrong ?

thanx for the help

bnm

Offline

Board footer

Powered by FluxBB