ident: SCCSID = "@(#)README	1.1 6/9/94"


                          USING LP PRINT SERVICE WITH

                                HDS VIEWSTATIONS



HDS has generated a sample printer model that lets you take advantage of the
local printing capability of the ViewStation.  Printing is generally a
system-wide function, so this file will have to be modified or adapted to
your particular situation.  This printer model 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 System V systems, printing support is handled by the LP print service.
The shell command to print a file is usually "lp".  The LP print service is
responsible for opening the path to the printer requested, passing the file
through various filters, maintaining the print queue, etc.

The LP print service supports both local and remote printers.  If a printer
is a remote printer, then the print file is sent to the remote printer host's
print service.  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 may not have any local disk memory for this
temporary storage, one host's LP print service should store and maintain the
print job queues for the printer attached to the ViewStation.  To make this
arrangement, the system administrator should configure the ViewStation's
printer as if it were locally connected to that controlling host.  This is done
by adding a new printer model to the controlling host's lp/model directory.
A sample printer model file entry, hds-model.sh, is included in this LP
directory. 

The key to making this arrangement work is the use of a printer model, such as
the hds-model.sh file included in this directory.  This HDS printer model is
specified in the "lpadmin" command when adding a new printer or modifying an
existing printer.  When printing a file, the LP print service calls the HDS
printer model script with multiple arguments, including the file names to
print.  The HDS printer model calls the normal printer model (configured by
the user) and captures the output.  This output is then transferred to the
ViewStation via remote shell execution of an "opendev" task.  The HDS
printer model logs any errors generated to the standard error channel.

The sample printer model included in this directory, "hds-model.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 hostname
(or IP address) and to a specific hardware port.  (The ViewStation 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, you will have to create separate
printer model entries for each printer.

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


Procedure to add a ViewStation printer to the LP print service:

o Attach the printer to the desired ViewStation's serial or parallel port.
  If using a serial printer, make sure the communications settings and
  cable are correct.


o Make sure there is a hostname corresponding to the ViewStation's IP
  address in the host's IP database.  (For example, /etc/hosts.)


o Choose a name for the printer.  This probably should be the same as
  the hostname of the ViewStation, but need not be.

  Example: hdsfx1


o Copy and rename the hds-model.sh script to the lp/model directory.  Set the
  owner and execute permission on the model script.

  <path> is the path to the lp/model directory, usually /usr/spool/lp/model

  cp hds-model.sh <path>/<printername>
  cd <path>
  chown lp <printername>
  chmod +x <printername>

  Example: cp hds-model.sh /usr/spool/lp/model/hdsfx1
	   cd /usr/spool/lp/model
	   chown lp hdsfx1
	   chmod +x hdsfx1


o Set the X terminal name (XTERM), the parallel or serial port (DEV), and the
  printer model (MODEL) variables for the printer in the model script.  Also
  set the path to the remote shell command (RSH_CMD) and whether or not NEWLINE
  characters should be replaced with CARRIAGE RETURN / NEWLINE characters
  (NFILTER).  All of these configurations are at the beginning of the model
  script.

  Example:
	RSH_CMD=/usr/bin/rcmd
	DEV=/dev/pp0
	XTERM=mshfx
	MODEL=/usr/spool/lp/model/HPDeskJet500
	NFILTER="cat -"

o Add the printer with the 'lpadmin' command.  Specify the printer device
  as '/dev/null' using the '-v' option.  Specify the model as <printername>
  using the '-m' option.  Specify the printer as <printername> using the '-p'
  option.  Also specify any other desired options, such as '-o nobanner'.
  Check the 'lpadmin' manual page for supported options and meanings.

  Example:
	/usr/lib/lpadmin -p hdsfx1 -v /dev/null -m hdsfx1


o Start the new printer with the "accept" and "enable" commands.

  Example:
	accept hdsfx1
	enable hdsfx1


o Print some test files to the printer.

  Example:
	lp -d hdsfx1 /etc/motd

  You can monitor the printing with the ViewStation's local Console 'ports'
  command.


