Re: cups & lp0 problem

2009-12-12 Thread Christopher Sawtell
2009/12/12 Barry 

> Nick Rout wrote:
>
>> On Fri, Dec 11, 2009 at 5:02 PM, Barry  wrote:
>>
>>> I have a old printer which gets used once per month and is unplugged and
>>> stored most of the time.
>>>
>>> When I plug it in cups recognises it but produces 'permission denied'
>>> messages even though I have added myself to the lp and lpadmin groups.
>>>
>>> Stopping and restarting the cups daemon does not work
>>>
>>> To get output I have to alter the permissions on /dev/lp0 from 660 to
>>> 666.
>>>
>>
>> who owns the file /dev/lp0? (if it is a symlink then who owns the file
>> it ultimately points to?)
>>
>>
> lp0 is owned by root and group is lp. This is not a link
>
> The cmd to print a file is issued by the user.
>
> In cups the allowed users for this printer are set to 'root,barry'. Just a
> thought, users are not set for my usb printer, should users be unset?
>

It would help considerably if we knew, definitively, the full ownerships of
both the device, and that of the lpd and cups processes.

Please can you execute the following commands and report what is printed.
In the interest of avoiding typo errors it would be best if you could cut
and paste the one-liners to and from your mail agent and a console.

ls -l /dev/lp0

ps aux | egrep "cups|lpd" | grep -v grep

imho, in actual practice, i.e. once a month, the use of the cups printing
system in this case is total overkill.

cd ~/the/data/dir/of//the/print/labels_file

cat labels_file | lpr -Pdmp# dmp = the name of the dot matrix printer

should do the trick.

At a guess it looks as if the udev system allocates the ownership of the
/dev/lp0 file incorrectly.

For a "pure and decent" fix, you will probably need to dive into the
appropriate udev rules file and alter the ownership or permissions mode of
the /dev/lp0 device node appropriately.

otoh for a "quick and very dirty" fix you could put a chmod or chown command
in your rc.local file.

Your distributor needs to be told about the bug provided you are using a
very recent version of Linux.

-- 
Sincerely etc.
Christopher Sawtell


Re: cups & lp0 problem

2009-12-12 Thread Barry

Nick Rout wrote:

On Fri, Dec 11, 2009 at 5:02 PM, Barry  wrote:

I have a old printer which gets used once per month and is unplugged and
stored most of the time.

When I plug it in cups recognises it but produces 'permission denied'
messages even though I have added myself to the lp and lpadmin groups.

Stopping and restarting the cups daemon does not work

To get output I have to alter the permissions on /dev/lp0 from 660 to 666.


who owns the file /dev/lp0? (if it is a symlink then who owns the file
it ultimately points to?)



lp0 is owned by root and group is lp. This is not a link

The cmd to print a file is issued by the user.

In cups the allowed users for this printer are set to 'root,barry'. Just 
a thought, users are not set for my usb printer, should users be unset?