-*- Mode: Text -*- Version as of 08/15/89

"Copyright (c) 1987, 1988, 1989 by J. Christoffel. All rights reserved."

This software is provided for free on a as is basis. Permission to copy
is given provided that the copy is not sold and this copyright notice is
included. The author requests that this documentation accompanies the
sources in any redistribution.

D,#TD1PsT[Begin using 006 escapes](1 0 (NIL 0) (NIL :BOLD NIL) "CPTFONTCB")	LPD-Server -- Spooling for Unix machines via TCP/IP

(2 0 (NIL 0) (NIL NIL NIL) "CPTFONT")This software provides a network server for the BSD Unix LPD protocol to
allow Unix hosts access to a LaserWriter connected to a Symbolics Lisp
Machine.

The LPD-Server understands the LPD protocol used by systems derived from
BSD 4.2 UNIX (popular derivates include SUN-OS and DEC-Ultrix). It
handles both simple text and PostScript jobs but is no substitute for a
PostScript conversion software (e.g. the TransScript package from Adobe)
on the Unix side.



1Prerequisites:

2	1) You must be running Genera 7.x and the Symbolics Print
	   Spooler software for the LGP-2/LGP-3
	2) You must be running TCP/IP
	3) Your Unix host must be registered in the namespace
	   (because the Symbolics Print Spooler will attempt to parse
	    the host's name)
	4) Your Unix host needs approriate printcap entries to tell it
	   that the lispm serves for LPD. See the Unix documentation for
	   more information aboout this topic.

	5) In order to print something other than simple text, you'll
	   need the transcript s/w package from Adobe or SUN.


(3 0 (NIL 0) (NIL :ITALIC NIL) "CPTFONTI")Unix documentation you might want to look at:

2	- lpr(1)
	- printcap(5)
	- lpc(8) and lpd(8)
	- 4.2BSD Line Printer Spooler Manual


1Installation:

2	1) Edit the file lw-spooler.lisp:
		
	- variable *lpd-spool-directory* should point to a directory
	  where to keep temporary files for spooling

	- variable *lpd-spool-device* should be bound to the namespace
	  object representing your preferred printer

	2) Save the edited file back onto disk

	3) Compile and load file lw-spooler.lisp

	   This file contains the lisp code which does the parsing of
requests sent by the client. For information about the format refer to
the 4.2BSD Line Printer Spooler Manual and, if you have them, the
sources in printjob.c on the Unix host

	4) Compile and load file lw-server.lisp

	   This file contains the lisp code which interfaces to
Symbolics' generic networking stuff. It spawns a process and runs the
LPD server.

	5) If you want to run the spooler immediately, instead of saving it in
the current world via disk save, you have to either of

		- :ENABLE SERVICES in the command processor

		- (SETQ LPD:*LPD-SERVING-ENABLED* T)

	6) Install approriate printcap entries on the client machine(s)
in file /etc/printcap. You may need the help of your Unix system
manager, because this file is not publically writable.



1Short Description of the LPD Protocol:

2The client sends chunks of data, terminated by ascii null chars.

   After each chunk the Unix client waits for an acknowledgement (i.e.
an ascii null char) from the LPD server before sending any more data.
First it will transmit the name of the requested printer. This name
currently is simply ignored by the LPD-server. Then for each file to be
printed it starts sending the data terminated by a null char. Finally it
sends control information telling such things like the requestor, title
options and so on.

   If in any case the connection breaks, the Unix host normally starts
sending the complete job again. Attempts to read from the TCP connection
while the Unbix client waits for an acknowledge will make the reader
hang.


1Symbolics documentation:

2   Don't trust the Symbolics documentation (Genera 7.1 DOC as I write
this). A lot of the keywords mentioned in Book 5, pp. 26++ are unknown
to the hardcopy functions. More valueable are the sources (which are
more and more classified)


1Format for /etc/printcap entries:

2[Comments are in italics, plain text is from /etc/printcap]

   3define some local names for the UNIX side
2lp|Bodoni|bodoni|Postscript net printer:\
   3this printer is remote (rm), the host it is connected to is sysiphos,
   the remote printer's (rp) name is Bodoni (that's the name the lispm
2   3uses,2 3the2 3Unix host might name it foo instead locally)
2	:lp=:rm=sysiphos:rp=Bodoni:\
3   spool directory to be used on the UNIX side
2	:sd=/usr/spool/Bodoni:\
3   log file to use on the UNIX side
2	:lf=/usr/adm/Bodoni.log:


How UNIX determines the printer to be used:

	1) use command line option, e.g. 'lpr -PBodoni'
	2)   else use value of environment variable $PRINTER
	3)   else use printer with the canonical name lp



Example printcap from our installation:

# Please don't use this printer for large (>250kB) jobs!
lw.gutenberg|gutenberg|Gutenberg|LaserWriter.gutenberg:\
        :lp=/tmp/.gutenberg.lock:mx#250:sf:tr=\f:sb:\
        :sd=/usr/spool/lw.gutenberg:\
        :lf=/usr/spool/lw.gutenberg/lw-log:\
        :if=/usr/local/cap/lib/gutenberg.papif:\
        :of=/usr/local/cap/lib/papof:
#
# remote PostScript printers
#
Bodoni|bodoni|lw-ntx|PostScript net printer:\
        :rm=sysiphos:rp=Bodoni:lp=:mx#0:\
        :sd=/usr/spool/bodoni:\
        :lf=/usr/spool/bodoni/lw-log:


1Known Bugs and Misfeatures:

2	- Needs better print option handling, e.g. sensible handling of
	  running heads and titles.

	- If you pipe into lpr, this will give the less informative
	  header "stdin" on your output.

	- If you get single requests queued fast enough on your machine,
	  they'll be sent as one job to the lispm. This 'optimization'
	  done by the Unix spooler will produce ugly long headers.

		
;;; EOF.
