lwsrv(8)              MAINTENANCE COMMANDS               lwsrv(8)



NAME
     lwsrv - simple LaserWriter spooling agent

SYNOPSIS
     lwsrv -n <object> -p <printer queue> -a  <dictionary  direc-
     tory> -f <FontFile> [ -e ] [ -h ] [ -k ] [ -A < on | off > ]
     [ -S ] [ -T < crtolf | quote8bit | makenondscconformant >  ]
     [ -X < directory name > ] [ -L<lprArg> ] [ -N ] [ -P ]

DESCRIPTION
     lwsrv is a multi-threaded LaserWriter spooler (e.g. multiple
     incoming  jobs  are  allowed)  that advertises itself on the
     AppleTalk internetwork and accepts print jobs from Macintosh
     computers  as  if  it were a real LaserWriter.  lwsrv allows
     these jobs to be queued for printing via the standard Berke-
     ley  lpd  spooling software (it is easily modified for other
     systems).  lwsrv assumes that it is spooling for a  particu-
     lar  type of LaserWriter printer as defined by an input file
     that specifies the font coordination list.

     A generic problem with  LaserWriter  spoolers  is  that  the
     proper  Apple  dictionary  must  be downloaded to the Laser-
     Writer.  An Apple dictionary is the "prologue" code termed a
     "Procedure Set" or "ProcSet", sent by the LaserWriter driver
     on a Macintosh (contained  in  LaserPrep),  that  defines  a
     "set" of routines for use by Macintosh applications.

     lwsrv attempts to resolve  this  problem  by  inserting  the
     proper dictionary in the incoming jobs before spooling them.
     Unfortunately, lwsrv does not know about  these  ProcSets  a
     priori.  They must be supplied to it, though it does attempt
     to retrieve them from the client.

     lwsrv will be able to record an unknown ProcSet if  it  fol-
     lows  Version  2  of  the  Adobe Systems PostScript Document
     Structuring Conventions (DSC).  Any Apple LaserPrep of  ver-
     sion 4.0 or higher should do this.  (Warning: the ProcSet as
     uploaded is not usable unless the "-e"  flag  is  used,  cf.
     Installation instructions).

     With System 7.0, the handling of ProcSets changes  somewhat.
     If  you  wish  to use lwsrv with System 7.0 Printer Drivers,
     you should run lwsrv with the -N option. This  causes  lwsrv
     to  not  capture  new  ProcSets  but  to  pass  them through
     unedited. If edited ProcSets for  earlier  versions  of  the
     Printer  Drivers are found, they will used where appropriate
     (edited System 7.0 Procsets from lwsrv sessions  without  -N
     should  be  removed).  The  result is that lwsrv can be used
     successfully in  a  mixed  driver  environment  without  the
     necessity of having the printer reinitialized each time.





Columbia University Last change: 24 July 1990                   1






lwsrv(8)              MAINTENANCE COMMANDS               lwsrv(8)



     lwsrv is normally started automatically at  boot  time  from
     /etc/rc.local.  Unless debug flags are set, it will automat-
     ically put itself into the background to run as a daemon.

REQUIRED ARGUMENTS
     -n <object>
               is used to specify the printer name that  will  be
               registered  (e.g.  that  will show up in Chooser).
               It may be up to 31 characters long.

     -p <printer queue>
               specifies the name of the Unix  printer  queue  to
               which  lwsrv will send the spooled print requests.
               <printer queue>  should  exist  in  /etc/printcap.
               Multiple  pairs  of -n and -p flags can be used to
               provide multiple printer queues per lwsrv process.

     -a <dictionary directory>
               specifies the name of the directory that will hold
               the  various Procedure Sets (of which an AppleDict
               in a LaserPrep is  a  particular  instance).   The
               first  line  of a ProcSet must be "%%BeginProcSet:
               <procsetname>".   In  addition,  unknown  ProcSets
               will  be  recorded  in this directory if possible.
               Received ProcSets will probably require some edit-
               ing.

     -f <FontFile>
               specifies the file that contains a Font  Coordina-
               tion  List.  It essentially tells the Macintosh or
               other devices spooling to lwsrv what  fonts  exist
               on  the actual print device.  Sample FontFiles are
               included with the source distribution.

OPTIONS
     -e        tells lwsrv that it should  allow  an  "eexec"  to
               occur  in  a ProcSet.  This option may cause prob-
               lems!  See the lwsrv  source  distribution  README
               file for more information.

     -h        means to suppress the printing  of  the  burst  or
               banner page by passing the "-h" option to lpr when
               printing the spooled file.

     -k        specifies that DDP checksums are not to  be  used,
               the field is set to zero.

     -C <Spool Command>
               specifies an alternate print spooler, the  default
               is normally "/usr/ucb/lpr" or "/usr/bin/lp".

     -A <on | off>



Columbia University Last change: 24 July 1990                   2






lwsrv(8)              MAINTENANCE COMMANDS               lwsrv(8)



               defines whether  lwsrv  should  suppose  that  all
               client  programs speaking to it will properly fol-
               low the Adobe Document Structuring Convention ver-
               sion  2.0.   For now, all it really does is define
               where the procedure set  definitions  are  loaded.
               Turning  this  on,  when there is a client program
               that doesn't quite  follow  the  conventions,  may
               cause  the procedure set not to be loaded or to be
               loaded in  the  wrong  place.   (Specifically,  it
               looks  for  an  IncludeProcSet  instruction).  The
               default value is set  at  installation  time  (see
               LOCAL CONFIGURATION section, below).

     -S        tells lwsrv that it should run in a  single  fork.
               Normally,  lwsrv  forks  off  a child to deal with
               each print request to minimize contention.  Unfor-
               tunately,   status  information  returned  to  the
               client programs is not as detailed when  lwsrv  is
               running multiforking.

     -N        tells lwsrv to not collect new ProcSets.  This  is
               required for use with System 7.0 (see above).

     -P        specifies that no Adobe pre-processing be  carried
               out.  Use this option on a print spooler dedicated
               to PC printing.

     -T <crtolf | quote8bit | makenondscconformant>
               are TransScript compatibility options.  Since  the
               names  are  so  long,  spaces, hyphens (-), under-
               scores (_), and tabs are allowed to enhance reada-
               bility, for example:
                    -T "cr to lf" -T "quote 8-bit"

               quote8bit is used to quote 8 bit characters  since
                         TransScript  masks characters to 7 bits.
                         Warning: this  could  potentially  cause
                         problems  if  the PostScript interpreter
                         does not decode the quoted characters in
                         some circumstances.

               crtolf    is used to translate the  Macintosh  end
                         of  line terminator CR (carriage return)
                         to the UNIX end of  line  terminator  LF
                         (line  feed).   This is necessary if the
                         spooled file will be run  through  Tran-
                         Script  filters  like psrv or psrev that
                         assume the UNIX end of line  terminator.
                         Warning:   this  can  potentially  cause
                         problems with binary data streams.

               makenondscconformant



Columbia University Last change: 24 July 1990                   3






lwsrv(8)              MAINTENANCE COMMANDS               lwsrv(8)



                         should be used when lwsrv is spooling to
                         a  UNIX printer queue that filters files
                         through psrv (a page  reversal  filter).
                         This  is  standard for serial TranScript
                         printers and may  have  been  configured
                         that  way  for papif. This option causes
                         the printed file to be prepended with  a
                         line  containing  "%!"  so that it looks
                         like it does not  conform  to  the  DSC.
                         The  problem  is  that in version 2.0 of
                         TranScript psrv leaves out part  of  the
                         file when handling DSC version 2.0 docu-
                         ments.

     -X <directory name>
               (must    be     specifically     included     with
               -DLWSRV_AUFS_SECURITY  at compile time) is used to
               allow access control such that  only  those  users
               who  have  mounted  an aufs volume will be able to
               print via the spooler.   The  directory  specified
               will  be  used  to  access  temporary  information
               stored there by aufs. That information is used  by
               lwsrv  to control who has permission to access the
               printer being spooled for. The Berkeley  lpr  pro-
               gram  is  invoked  as  the user that was specified
               when logging in through aufs. Aufs  must  also  be
               started  with  the  -X option, and the same direc-
               tory, otherwise no one will  have  access  to  the
               spooler.   Generally,  /tmp is the directory used.
               See the aufs (8) man page for the  setup  require-
               ments for the directory if you are not using /tmp.

     -L<lprArg>
               passes <lprArg> directly to lpr. Typically used to
               specify   the   -l  option  to  allow  gray  scale
               PostScript to be printed. Note: there is no  space
               between the -L and the lpr argument.

DEBUGGING OPTIONS
     -r        keeps the file  spooled  from  the  Macintosh  for
               inspection instead of removing it after printing.

     -t <TraceFile>
               is used to  record  all  data  received  from  the
               remote  side  in  <TraceFile>.  The remote side is
               also forced to send any ProcSets used.  The result
               is not printed.

     -l <LogFile>
               is used to specify an activity log file.

     -d <cap debug flags>



Columbia University Last change: 24 July 1990                   4






lwsrv(8)              MAINTENANCE COMMANDS               lwsrv(8)



               can be used to specify standard cap library debug-
               ging flags.  See CAP(3) for valid flags.

EXAMPLE
     For example, to publish a LaserWriter spooler  "Laser"  that
     prints on the UNIX printer "ps" with Procedure sets recorded
     in /usr/lib/adicts and  using  the  font  coordination  list
     /usr/lib/LW+Fonts, you would start lwsrv as follows:
          lwsrv -n Laser -p ps -a /usr/lib/adicts -f /usr/lib/LW+Fonts

LOCAL CONFIGURATION
NOTES
     The Apple LaserPrep ProcSets (dictionaries) are not supplied
     in  the CAP distribution as they are copyrighted property of
     Apple Computer.

     There are a number of "font list files" that are used in the
     dialog  with  the  spooling  client.   These tell the client
     (Macintosh) what  fonts  are  available  on  the  "supposed"
     printer.  The laser font files supplied may not work for all
     LaserPreps.  They are  known  to  work  for  LaserPreps  3.0
     through 4.0.

BUGS
     lwsrv cannot  properly  update  the  status  message.   When
     printing  from a Macintosh, you will see the message "Start-
     ing job" until it completes.

FILES
     Sample font list files in the CAP distribution:
     extras/LWFonts         fontfile list for LaserWriter
     extras/LWPlusFonts     fontfile list for LaserWriter Plus

AUTHOR
     lwsrv was written by Bill Schilit, Computer Science  Depart-
     ment, and Charlie C. Kim, User Services, Columbia University

SEE ALSO
     atis(8), CAP(3), CAP(8), lpr(1), papif(8)
















Columbia University Last change: 24 July 1990                   5