Adding shared printers

This topic presents instructions for adding shared printers.

When adding a shared printer, watch for these caveats:

  • Test the UNIX printer command to verify that the /etc/inittab file went to a specific printer, for example:

    lpr -Pprinter19
    /etc/inittab
  • Before issuing the startshp2 command, type the command:

    pid {port#}

    The PID should be 0 (zero) and nothing should be started on that port yet. Make sure port# is a real, usable port not a phantom PIB. The port# must be a port number less than the spooler port number.

  • Always use lp.unix as the form queue device name because that device is what appends the text End of Job to each D3 spooler job.

    The End of Job text tells the lppick daemon when to route the job to the proper UNIX print queue, the same UNIX print queue tested in Step 1 above.

    Note: If the UNIX print queue is the default UNIX print queue (for example, you can type lpr /etc/inittab), the lpr... argument is not needed in the startshp command.
  • Printer should start successfully after the startshp command is issued.

  • Typing pid {port#} should return a process ID.

    Shared printers must specify a device name for the printer. lp.unix (located in the file devices in the account dm) is provided for simple ASCII printers. The purpose of this form queue is to define an inter-job sequence that the filter uses to cut the D3 printer process data stream into UNIX print jobs. The inter-job sequence is defined as function @(-269).

Procedure

  1. Ensure that the UNIX spooler is started and at least one UNIX queue is started. Type:
    lpstat 
    
  2. Ensure that the printer works with UNIX. For example, type:
    For example, type:
    lpr -P[ unix.formqueue.name] unix.file.name

    When the unix.file.name prints on the printer, the printer is shared in UNIX and is ready to be shared in D3.

  3. Insert these statements in the user-coldstart macro in the dm account:
    startshp 1,1,0,s126,lp.unix
    startshp 2,2,0,s127,lp.unix,(lpr -Plp1)
    • These statements use the previous example to show how two shared printers are set up.

      • First statement starts the printer on the shared printer servicing the default UNIX queue (lp0 in this example, which is the default).

      • Second statement specifies a complete lpr command since the output is sent to the non-default UNIX queue.

    • The startshp command uses the syntax:

      printer#, formqueue#, page.eject,S{ port#}, lp.unix,( lpr command)

      where printer#,formqueue#,page.eject,S{port#} are all the same values as used with a regular startptr command. For more information, see the D3 Reference Manual.

      Note: In UNIX, it is always a Serial (S) printer, and the port# must be less than npibs (never put a printer on D3 port 0).

    The startshp command:

    • Creates a process on port#.

    • Assigns the form queue lp.unix to that shared printer.

    • Sets up the routing of print jobs to whatever UNIX print command was specified.

    Tip: To use a more complex printer definition item:
    1. Locate the line containing =x in the item.

      This entry corresponds to @(-99).

    2. Locate the line which should be associated to @(-269), 170 entries later.

      Note that a line starting with an exclamation mark is a comment and does not count.

    3. Add the line:

      d,c'End of Job',< -269
      
    4. Compile the form queue item, then enter:

      assignfq formqueue,device (c

      With this setting, the printer process sends an End of Job string between each job. The filter scans the data stream, looking for this inter-job sequence to separate the data into different UNIX print jobs.

      The inter-job sequence can be any character or sequence of characters that does not occur in a normal print job.

      Note:
      • It is strongly advised to include a nonprintable character in the inter-job sequence, such as:

        d,x'ff',c'End of Job',x'ff',< -269
      • Never use the TCL command startptr on a shared printer as it does not spawn the necessary filter process.