[nflug] Print Spooling Problem in ubuntu

Cyber Source peter at thecybersource.com
Wed Nov 15 21:16:01 EST 2006


Joe wrote:
> Cyber Source wrote:
>> Joe wrote:
>>  
>>> I am setting up my usb printer on my notebook.  I have a new HP
>>> dv5020us notebook and an HPDeskjet 460c printer.  My notebook is dual
>>> boot kbuntu Dapper Drake and Windoze XP Pro.
>>> The printer works fine in XP, so the hardware is fine.
>>>
>>> In kubuntu, I enabled the cups web interface and defined the printer
>>> as Ritas_DJ460.  I can print a test page from cups and I can print
>>> from applications like kate or Open Office.
>>>
>>> The problem is that when I try to print from a shell script using lp
>>> <file> or lpr <file>, it writes the file to /var/spool/lpr/... , but
>>> then it complains that my printcap file has an error (see below).  It
>>> seems that the printer definition is circular instead of pointing to a
>>> device or queue.  The printcap file is automatically generated by
>>> cupsd(8) from the /etc/cups/printers.conf file - which was generated
>>> by the cups web interface..
>>>
>>> The problem seems to have two aspects:
>>> 1) The printcap file (and what generated it) is incorrect and fouls up
>>> the lp/lpstat system.
>>> 2) There may be two print queues /var/spool/lpr/Ritas_DJ460 and
>>> /var/spool/cups/...
>>>
>>> It looks like there's something to fix in my cups configuration and
>>> something else about how lp relates to cups.
>>>
>>> I used lp extensively on my Mandrake 9.1 system and it just worked.
>>> Something is "new and improved" here.
>>>
>>> FYI "./print" is just a file, a shell script that prints files a
>>> particular way.  My system is named "sananda".  I have no lan
>>> connections wired or wireless.
>>>
>>> TIA
>>>
>>> Joe
>>>
>>> bigbird at sananda:~/bin$ lpstat
>>> _Printer_: Ritas_DJ460 at sananda 'Ritas Portable Deskjet' (dest
>>> Ritas_DJ460 at sananda)
>>> Queue: 5 printable jobs
>>> Server: pid 4551 active
>>> Status: job 'bigbird at sananda+680' saved at 10:02:55.710
>>> Rank   Owner/ID               Pr/Class Job Files                 Size
>>> Time
>>> 1      bigbird at sananda+701          A   237 printcap               195
>>> 10:02:55
>>> 2      bigbird at sananda+21           A   238 (STDIN)              15694
>>> 10:02:55
>>> 3      bigbird at sananda+76           A   176 (STDIN)              14982
>>> 10:02:55
>>> 4      bigbird at sananda+76           A   177 (STDIN)              14982
>>> 10:02:55
>>> 5      bigbird at sananda+680          A   178 print                 2453
>>> 10:02:55
>>> done   bigbird at sananda+701          A   231 printcap               195
>>> 10:02:55
>>> Error: loop in printcap- Ritas_DJ460 at sananda -> Ritas_DJ460 at sananda
>>>
>>> bigbird at sananda:~/bin$ locate printcap
>>> /etc/printcap
>>> /etc/lprng/printcap
>>> /usr/share/doc/pnm2ppa/examples/lpd/printcap
>>> /usr/share/doc/lprng/examples/printcap.gz
>>> /usr/share/man/man5/printcap.5.gz
>>>
>>> bigbird at sananda:~/bin$ sudo diff /etc/printcap /etc/lprng/printcap
>>> Password:
>>>
>>> bigbird at sananda:~/bin$ cat /etc/printcap
>>> # This file was automatically generated by cupsd(8) from the
>>> # /etc/cups/printers.conf file.  All changes to this file
>>> # will be lost.
>>> Ritas_DJ460|Ritas Portable Deskjet:rm=sananda:rp=Ritas_DJ460:
>>>
>>> bigbird at sananda:~/bin$ lp ./print
>>> request id is bigbird at sananda+327
>>>
>>> bigbird at sananda:~/bin$ lpstat
>>> Printer: Ritas_DJ460 at sananda 'Ritas Portable Deskjet' (dest
>>> Ritas_DJ460 at sananda)
>>> Queue: 6 printable jobs
>>> Server: pid 4551 active
>>> Unspooler: pid 3130 active
>>> Status: done job 'bigbird at sananda+701' transfer to Ritas_DJ460 at sananda
>>> at 10:06:24.753
>>> Rank   Owner/ID               Pr/Class Job Files                 Size
>>> Time
>>> active bigbird at sananda+701          A   349 printcap               195
>>> 10:06:24
>>> 2      bigbird at sananda+21           A   390 (STDIN)              15694
>>> 10:06:24
>>> 3      bigbird at sananda+76           A   350 (STDIN)              14982
>>> 10:06:24
>>> 4      bigbird at sananda+76           A   391 (STDIN)              14982
>>> 10:06:24
>>> 5      bigbird at sananda+327          A   506 ./print               2453
>>> 10:06:24
>>> 6      bigbird at sananda+680          A   840 print                 2453
>>> 10:06:24
>>> done   bigbird at sananda+680          A   839 print                 2453
>>> 10:06:24
>>> Error: loop in printcap- Ritas_DJ460 at sananda -> Ritas_DJ460 at sananda
>>> bigbird at sananda:~/bin$
>>>
>>> /etc/cups/printers.conf:
>>>
>>> <Printer Ritas_DJ460>
>>> Info HP Deskjet 460 hpijs
>>> Location localhost
>>> DeviceURI usb;//HP/Deskjet%20460?serial=MY65N4Z340
>>> State Idle
>>> StateTime 1163286820
>>> Accepting Yes
>>> Shared Yes
>>> JobSheets none none
>>> QuotaPeriod 0
>>> PageLimit 0
>>> KLimit 0
>>> DenyUser None
>>> OpPolicy default
>>> ErrorPolicy stop-printer
>>> </printer>
>>>
>>>
>>> _______________________________________________
>>> nflug mailing list
>>> nflug at nflug.org
>>> http://www.nflug.org/mailman/listinfo/nflug
>>>
>>>     
>> Have you tried sending something via lp other than that file of yours?
>> In particular, I thought you were doing a dot slash in front of that
>> file, the file is actually named "./print"? The name of that file might
>> be pissing of lp (yea i know it may have worked before but you've
>> changed alot of things, who knows, try another file.
>> _______________________________________________
>> nflug mailing list
>> nflug at nflug.org
>> http://www.nflug.org/mailman/listinfo/nflug
>>
>>   
> No, the ./ isn't part of the name, just the path and I don't have
> another one named "rm -rf" LOL.  However lpstat with no arguments
> reports the error and my file does get written to the spool dir, so
> that's not a problem.  I read some old stuff about printcap and (at
> least in the old days circa 2000) each entry required a field sd= or
> something that told it where to write files for printing.  I don't
> think my printcap does that, but since it gets replaced at every boot,
> I'm not going to try to change it directly.
>
> Joe
> _______________________________________________
> nflug mailing list
> nflug at nflug.org
> http://www.nflug.org/mailman/listinfo/nflug
>
Why do that for the path? ./print would be the same as print, or "lp
print" would be the same as "lp ./print". I just was curious as to why
you would put the command like that.
_______________________________________________
nflug mailing list
nflug at nflug.org
http://www.nflug.org/mailman/listinfo/nflug



More information about the nflug mailing list