[comp.sys.sun] HELP-Printers under SunOS **LONG**

cgh018@rti.rti.org (Calvin Hayden ) (02/21/90)

THIS IS LONG, and it deals with the printing aspects of converting from a
single machine running Sys V Release 2 Ver 2 to a network of Suns running
4.0.x.  Printers currently shared with a VMS user community.

Scenario: Currently running Sys V Rel 2 Ver 2 on a Vax 8600.  Under this,
there are 4 print "queues" set up (lno3[abcd]).  A port is dedicated to
each of these queues.  Each port is connected to a Net Commander unit.
The net commanders are used to allow several computers to share a set of
output devices (in this case printers).  Basically, a net commander allows
input from several ports, and depending on the initial data from each
input port, routes that input to a specific output port (this is
programmable). In our case, the unit allows users on Unix and VMS to share
the same set of printers (the unix machine and vms machine are both
connected to a net commander on different input ports in this case, with
the common printer connected to an output port on the unit).  The
netcommander interprets a particular escape sequence on initial input to
decide which output the following data is to be routed to.  Here is the
way things are set up on our sys V machine now:  

Each net commander is used to connect printers in various areas (the
module a netcommander 'serves' printers in Module A of our plant, and so
on...).

The following printers are shared between vms and unix users: (generalized)
  lda[1-4], ldb[1-6], ldc[1-3], ldd[1-4]

We have moved the lp command to lpti, and replaced it with a lp shell
script.  This script is designed to take the printer destination (given by
a -ddestination option such as -dlda1) and convert this into a combination
of "-dlno3a -olda1".  A lpti command line is constructed in which all
other options are preserved (such as landscape, font size, paper tray
selection), and in which the destination is changed as just mentioned,
into a destination and option.  The new destination is the name of one of
the print queues (an interface script for each queue exists in
/usr/spool/lp/ interface directory - each interface is a shell script).
The interface script grabs each of the args passed to lp (lpti in our
case), and sends the appropriate escape codes for the action out the port
associated with the printer.  If you selected lda1 as your printer in your
command, this script will see the lda1 option, and echo the escape
sequence that will tell the netcommander which output port the following
data is to be sent to out the corresponding port.  Sound strange?  Works
great!   The lno3[abcd] queues are more queues for the netcommander than
actual printers. Heres an overview using printing to lda[???] (and queue
lno3a on unix) printer:

      Unix Machine                            VMS machine
         ports                                   ports
	| | | |                                 | | | |
        d c b a        print "queue"            a b c d
         \ \ \ \                                / / / /
          \ \ \ \                              / / / /
       .../ / /  \                            /  \ \ \...
        .../ /    \                          /    \ \...
         .../      \   |      |        |    /      \...
                    |  |  input ports  |   |
              ------------------------------------
              |NETCOMMANDER for lda[...] printers|
              ------------------------------------
                            |  | |  |
                          output ports
                            /  / \  \
                  lda1_____/  /   \  \_lda2
                             /     \______________lda3
                    lda4____/ 

On our Sys v system, suppose printer lno3a has been set up to use "port
a".  A user issues a print request via 'cat /etc/motd|lp -dlda1 -ohps'.
Our lp script would rearrange the later part of the piped command to 'lpti
-dlno3a -olda1 -ohps', which would call the /usr/spool/lp/interface/lno3a
interface script with these new arguments.  The interface would pick up
the lda1 option, and echo out the code to tell the netcommander to send
the following data out the port connected to lda1.  The script would also
pick up the option hps (for hole punch shift - cause the paper to be
shifted past 3 hole punches) and echo out the printer command to cause the
printer to shift printing to the right.
***********************************************************************
Now the biggie -- how do I do the same type of thing that I am now doing
on the Sys V machine on the Suns (for simplicity, how can I do it on A
single sun with 4 ports dedicated as above)????

Under SunOS, can you have 2 printers sharing the same physical port(print
cap file for lda1 and lda1 shows same output port  for instance)?  If so,
if a request is sent to each of these at the same time, will they be
intermingled, or queued up and come out one after another?  Is this the
way I need to go? 
***********************************************************************
I realize that this is long, and that it may not interest anyone, but at
the Sun admin class, I got nothing more than a few ideas - nothing solid.
If you have any ideas or suggestions, I'd appreciate the help and input.
By the way, I cannot dedicate the printers to Sun only, they have to be
used by both communities.  Thanks in advance for any help and advice I
get.  Please email, and I will summarize.  Thanks again, sorry so long.

Calvin Hayden
Texas Instruments, Johnson City, Tn.    
Voice (615)461-2254
UUCP:  ...mcnc!rti!tijc02!{root,cgh018}