                        USING LPD PRINT SPOOLER WITH

                              HDS VIEWSTATIONS



HDS has generated a sample print spooler that lets you take advantage of the
local printing capability of the ViewStation FX.  Printing is generally a
system-wide function, so these files will have to be modified or adapted to
your particular situation. This print spooler is intended as a sample only.
Your system may be different, use different commands or syntax, so you will
have to make the necessary adjustments.

On UNIX systems, print spooling is handled by a daemon process known as LPD.
The shell command to print a file is usually "lp" or "lpr", which sends
messages to the LPD daemon indicating the names of the files to print, the
number of copies, etc.  The LPD daemon process is then responsible for opening
the path to the printer requested, passing the file through various filters,
maintaining the print queue, etc.

The LPD process is started by the system administrator.  At startup, it reads
a file called /etc/printcap which lists the printers available to the LPD
daemon and whether those printers are local or remote.  If the printer is a
remote printer, then transfering the print file also involves the LPD on the
local host communicating with the remote host's LPD.  In this case, the remote
host is responsible for temporarily storing the print file in its local file
system until it can be sent to the printer.

Since the HDS ViewStation FX may not have any local disk memory for this
temporary storage, one host's LPD should store and maintain the print job
queues for the printer attached to the ViewStation FX.  To make this
arrangement, the system administrator should configure the ViewStation FX's
printer as if it were locally connected to that controlling host.  This is done
by adding an entry into the controlling host's /etc/printcap file.  A sample
printcap file entry is included in this LPD directory. 

The key to making this arrangement work is the use of an input filter, such as
the hds-spool.sh file included in this directory.  This input filter is
specified in the /etc/printcap file as "if=<filter pathname>".  The LPD
daemon writes the contents of the print file to the standard input of this
filter.  The filter then performs several tasks; it opens a remote shell on
the ViewStation FX and transfers the print file to an "opendev" task, which
routes the data to the device specified on the opendev command line.  It also 
logs any errors generated to the filter's standard error channel and appends 
them to the log file (which was specified in the /etc/printcap entry 
"lf=<log file pathname>".

The sample input filter included in this directory, "hds-spool.sh", is written
as a Bourne shell script, which may be customized as needed.  As it appears
here, it is hardcoded to send its output to a specific ViewStation FX hostname
(or IP address) and to a specific hardware port.  (The ViewStation FX can
connect to printers on its parallel port or to printers on its two serial
ports.)  If you want to set up a system with a single host controlling printers
connected to more than one ViewStation FX, you will have to create separate
/etc/printcap entries for each printer, and the input filter script specified
for each printer must be modified so it connects to the correct ViewStation FX
and hardware port on the ViewStation.

Note that the ViewStation FX will not abort the print job if the printer is
off-line or out-of-paper.  Instead, the ViewStation FX will stop accepting
data on its "shell" TCP port, which in turn will cause the lpd process 
executing the input filter shell on the controlling host to block until the 
ViewStation FX resumes accepting data.  Print jobs may be aborted either by 
"killing" the opendev process on the ViewStation FX, or by using "lpc" or 
other print spooler administration tool on the controlling host.

Last update: 6/22/93

