Printing: lpd loses print jobs

Printing: lpd loses print jobs

Post by Eric Welto » Mon, 27 May 1996 04:00:00



Howdy,

I've an HP LaserJet 5MP (Postscript) attached to my linux
box's parallel port --- sometimes I can print multiple files,
other times I cannot.  For example

lpr tst.ps
lpr a.c

will _not_ print "a.c" even though it gets spooled ok.
If, however, I wait until "tst.ps" has printed, then I
can print a.c _no problem_.  I suspect that it has
something to do with the way the printer's internal
memory is caching things (2MB internal).  Possibly I
need to send some printer control codes at the end of
each job, perhaps using an output filter?

any suggestions would be greatly appreciated,
thanks,

        Eric Welton

 
 
 

Printing: lpd loses print jobs

Post by John Phillip » Tue, 28 May 1996 04:00:00



>I've an HP LaserJet 5MP (Postscript) attached to my linux
>box's parallel port --- sometimes I can print multiple files,
>other times I cannot.  ...

Here are a couple of extracts from my HP LaserJet 4ML (PostScript)
printer input filter.  It allows me to successfully print mixed files
immediately following each other in the queue.  Prior to using this
filter I too saw the same problem as you.

    #define RESET       "\033E"


    #define CTRLD       "\004"
    #define END_PJL     "\033%-12345X"
    ...
    void PrintPostScriptFile()
    {
        /* Choose language */
        fprintf(stdout,"%s%s%s",RESET,START_PJL,POSTSCRIPT);
        /* Transmit file transparently */
        putc(c0,stdout);
        for (bytes = 1; c != EOF; bytes++) { putc(c,stdout); c = getc(stdin); }
        /* Add newline, Ctrl-D, ... */
        fprintf(stdout,"\n%s",CTRLD);
        /* ... and reset printer at end */
        fprintf(stdout,"%s%s",END_PJL,RESET);
        /* Log results */
        syslog(LOG_DEBUG,"%s, PostScript file, %ld bytes",userinfo,bytes);
    }

I think just the control-D may be sufficient to terminate the printer's
PostScript interpreter and allow it to go back to auto-detecting the
text file.  Without it I suspect there's a time-out in the printer after
a PostScript file before text will be properly printed.
--


 
 
 

Printing: lpd loses print jobs

Post by Rob Janss » Tue, 28 May 1996 04:00:00



Quote:>Howdy,
>I've an HP LaserJet 5MP (Postscript) attached to my linux
>box's parallel port --- sometimes I can print multiple files,
>other times I cannot.  For example
>lpr tst.ps
>lpr a.c
>will _not_ print "a.c" even though it gets spooled ok.
>If, however, I wait until "tst.ps" has printed, then I
>can print a.c _no problem_.  I suspect that it has
>something to do with the way the printer's internal
>memory is caching things (2MB internal).  Possibly I
>need to send some printer control codes at the end of
>each job, perhaps using an output filter?

Maybe your printer only switches between postscript and normal text
after a short delay between jobs?
You could try converting everything you print to postscript first,
e.g using genscript.

Rob
--
+------------------------------------+--------------------------------------+


+------------------------------------+--------------------------------------+

 
 
 

1. lpd: lost connection leaving print jobs in spool area

Hi,

I am having a printing problem with an HP 4100N printer using a
JetDirect J4169A card, using RedHat 6.1.  Jobs sent to the printer
(using lpr command) will on occassion get hung in the spooler and
won't start until either another job comes into the spooler to force
the one's ahead of it out or by restarting the printer using lpc
restart.  I've tried it on a different printer/JetDirect Card (same
models for both though) with similar results.

Here is the relavent /etc/printcap information:
The IP address for print2 is defined in /etc/hosts.
print2|print2_raw:\
        :rm=print2:\
        :sd=/var/spool/lpd/print2:\
        :lf=/var/spool/lpd/print2/log:\
        :rp=lp:\
        :bk:mx#0:\
        :sh:

When I do an "lpc status", I get the following:
        print2:
                queuing is enabled
                printing is enabled
                3 entries in spool area
                no daemon present

In the /var/log/messages file, I see the following:
        Aug  9 08:51:56 ACMC_dsg lpd[31575]: print2: lost connection

What appears to be happening is that jobs get queued up, but for some
unknown reason the printer "loses connection", so the jobs remain in
the spool area until the printer is either restarted or when another
job comes in the queue (which appears to wake up the printer); but the
printer will again lose connection after some point in time, again
leaving jobs in the queue.  Any idea why the daemon dies before all
the jobs have left the spool area?
Pinging the printer for a lengthy period in time does not result in
any lost packets.  It appears to happen on small jobs as well as large
jobs.  I've used that printcap setup on other linux boxes (same Red
Hat version) without difficulties.  I've also tried using the actual
IP address for "rm" instead of the hosts name.
Any ideas on what causes the "lost connection" to occur?  Any
suggestions would be greatly appreciated.

Thanks,
Robert Hattori

2. modem hangup?

3. SVR4 doesn't print my LPD print jobs

4. Driver for a serial card : FASTCOM ESCC-P (include a Siemens 82532 controller)

5. lpd stops sending queued print jobs to remote Print Server.

6. Make HTTP request from Unix shell script

7. LPR/LPD setup: a way start printing before the job is received in full?

8. Speadsheet for X ??

9. Print server loses contact with lpd?

10. lpd don't accept remote print jobs

11. Xcd print server loses connection with lpd.

12. Solution: was LPD print jobs from AIX -> LINUX failing

13. SCO 5.0.2 - lpd printing to a Chase print server