[cups.general] Jbase and cups and a stuck queue,hopefully someone recognizes this problem.

Kurt Pfeifle k1pfeifle at gmx.net
Thu Jul 12 08:29:01 PDT 2007


Mark Krenz wrote:
> Kurt Pfeifle wrote:
>> Mark Krenz wrote:
>>  
>>> Kurt Pfeifle wrote:
>>> It submits a job to cups by running lpr and piping the data to it.  The
>>> lpr process sits there forever (we've seen times as high as 2-3
>>> hours).     
>>
>> If so, your lpr may be waiting for the piped-in data. Can you rule out
>> that the db process supposed to pipe data to lpr does fail to do so?
>>   
> Its hard to tell because we have been stracing the processes after this
> problem starts and so all we see are the lpr processes stuck at recv(3,
> <unfinished ...>  and just waiting there.   I tried running cat - |
> strace lpr  and it actually stopped on read(0,  instead of recv(3,

You'll have to emulate piping data from STDIN to lpr without closing the
handle, but stop sending data. I bet you'll then see it hanging in recv()

> I agree, but it might not be possible to change that behavior as the
> jspprint processes that act as spoolers for jbase are compiled
> programs. 

So the jspprint thingies can only get rid of print data by piping them
to their STDOUT? And no other way, like "write to file"??

In that case: hail the jbase programmers!

> And I doubt we have access to the source code.  I can check
> though.

You can always use a shell script (or other program) and make it pretend
to be "lpr" that receives data via its STDIN and writes to file. And
then let the "lpr.orig" send the file to cupsd.

> When this problem occurs, I actually can run print jobs through lpr from
> the command line in the way you describe (from a file). 

So how do you make the original job to go into a file?

> Those go
> through fine.
> 
>  Could it be that we are sending jobs to cups that cups doesn't like? 

No.

As you said, cupsd never logs any connection into its access log
(concerning these foul jobs).

The problem is that lpr does not see an end of the data stream it
may have received partially. lpr stores that stream into a temp file,
completely, before it starts connecting and sending the job to cupsd.

> Are there any characters to look out for?  How is the jspprint process
> supposed to tell lpr that its done sending it data?  I seem to remember
> that there is some signal that is sent, but don't remember what.

Not sure what it exactly is that pipes use, maybe "ctrl+d". I'm pretty
sure that lpr does not use anything special. Just the standard code that
indicates "Over!"...

To rule out any "jspprint <--> lpr" issues, I'd make jspprint print to
file. And lpr print from file.

If a CUPS problem *then* occurs, you'll know for sure where to continue
digging.

-- 
Kurt Pfeifle
System & Network Printing Consultant ---- Linux/Unix/Windows/Samba/CUPS
Infotec Deutschland GmbH  .....................  Hedelfinger Strasse 58
A RICOH Company  ...........................  D-70327 Stuttgart/Germany




More information about the cups mailing list