Re: lp5250d dies when a printjob starts

James Rich <[email protected]>
Newsgroups gmane.comp.emulators.tn5250
Message-ID <[email protected]>
On Fri, 30 Apr 2010, [email protected] wrote:

> The config:
>
> print-30 {
>         host= 192.168.0.10
>         map= 273
>         env.DEVNAME= D30
>         outputcommand= scs2pdf >> /tmp/as400pdf/d30-$$.pdf
> }
>
> The trace looks like this:
>
> lp5250d version 0.17.5, built on Apr 21 2010

It looks like you have a very recent version of tn5250 built from cvs. 
Some time ago a change went in to cvs that fixes a problem with page sizes 
and various SCS protocol options.  That change requires an initialization 
file.  I tested without the initialization file and it crashed lp5250d. 
Looks like I have a bug to fix.

To fix your problem (and improve the results for scs2pdf) create an empty 
file somewhere (like /tmp/pdfprintinit) and then use the -i option to 
scs2pdf like this:

outputcommand = scs2pdf -i /tmp/pdfprintinit >> /tmp/as400pdf/d30-$$.pdf

scs2pdf will populate this file with the data it needs.  This should stop 
lp5250d from crashing.

Note on why scs2pdf needs an initialization file:
The System i (AS/400, iSeries, etc.) only sends page configuration 
information when a writer is first started and on every form type change. 
Since lp5250d spawns a new instance of scs2pdf every time it receives a 
print job, scs2pdf needs some way to remember what the previous page 
configuration was since most likely that information won't be sent. 
lp5250d doesn't have any SCS protocol handling code itself, it simply 
passes the print stream directly to whatever command is specified in the 
outputcommand parameter.  Without a way to remember what the last page 
configuration is, scs2pdf can only guess what the current page size should 
be and usually that guess is wrong.  If scs2pdf receives the page 
configuration from the host, it writes it to the file specified using the 
-i argument.  When lp5250d first starts, it starts the writer and page 
information will be sent and scs2pdf can simply fill an empty file with 
page data.

I'm sure there is a better way to do this.  Obviously a crash in lp5250d 
is not the right thing to do.  I'll see if I can get a patch this weekend 
to make this better.  In the mean time, simply create the file as 
instructed and you'll be fine (and your PDFs will be sized correctly).

James Rich

if you want to understand why that is, there are many good books on
the design of operating systems. please pass them along to redmond
when you're done reading them :)
 	- Paul Davis on ardour-dev
-- 
This is the Linux 5250 Development Project (LINUX5250) mailing list
To post a message email: LINUX5250-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/linux5250
or email: LINUX5250-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/linux5250.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.