tcl.startshp Verb: Access/Spooler

tcl.startshp

Command tcl.startshp Verb: Access/Spooler
Applicable release versions: AP/Unix
Category Spooler (24)
Description starts a shared printer under Unix. The output of the Pick printer process is routed to the Unix spooler.

This command combines the "startptr" command and the necessary "assignfq".

Keeping track of shared printers can be achieved by the "shp-status" TCL command. Terminating a shared printer should be done by the "shp-kill" TCL command.

Once a job has been submitted to Unix, the (Unix) "lpstat" command may be used to keep track of the running jobs. The printer devices associated with the form queues must have a special interjob sequence so that the Unix spooler can distinguish the end of the job.

bhe following parameters can be specified:

"ptr.number"
The (integer) printer number.

"q1", "q2", and "q3"
The output queue numbers.

"eject.pages"
An integer number which specifies the number of pages to eject at the end of each job.

"type/address"
Printer type and port number. The printer type can be "S" or "P." All printers are treated internally as serial devices, even when (as in the case of a shared printer) the 'device' is a pseudo device.

"pd1", "pd2", and "pd3"
These indicate printer devices. To each form queue, a printer device, defined in "dm,devices," must be associated to define the printer characteristics as well as the interjob sequence. The interjob sequence is defined in the function "@(-269)". If the number of printer devices is less than the number of form queues defined, the last device is used for the remaining form queue(s).

lp This is a Unix command used to spool the Pick print job. If not specified, lp is used by default. If the Unix command has more than one word (separated by spaces), the command must be enclosed in parentheses.

When the printer is successfully started, a Unix log file is created in the directory "/tmp/lppick" which is used to keep track of the shared printer activity. The name of the file in this directory is formated as follows:

vmn _ prt _ port

Where:

vmn : Virtual machine name,
prt : Pick printer number,
port : Port number.

The log file contains the following elements, separated by attribute marks:

pid ^ cmd ^ eoj ^

Where:

pid : PID of the lppick process,
cmd : Unix command used to send data to the spooler,
eoj : End of Job string.

Optionally, this file also contains trace information, if the (T{n}) option is used or if an error is encountered. The level of trace is coded as follows:
1 (default) Record only beginning and end of jobs.
2 Record, in addition to level 1, each write to the lp command.
3 Record, in addition to level 2, all data which is exchanged. Non printable characters are replaced with a '.'.
4 Record, in addition to level 2, all data which is exchanged. All characters are replaced by their hexadecimal value coded on two ASCII characters.

The trace is stopped only when the printer is stopped with the 'shp-kill' TCL command.

The log file is used by the "shp-status" TCL command to keep track of printers shared with Unix and the processes involved, and by the "shp-kill" TCL command to find the processes to terminate.

The "startshp" command supports all "startptr" options, plus the one listed below.
Syntax startshp ptr.number,(q1{,q2{,q3}}}), eject.pages,type/address, (pd1{,pd2{,pd3}}}) {,(lp)} {(options}
Options a Initiates alignment process. Note this is an option, while on the startptr verb, it is an argument. When this option is used, each alignment attempt is a Unix job. The Unix printer should have been set up so that there is no banner, no interjob page eject.

c Compiles the printer devices. This option must be used whenever the printer definition item is changed.

t{n} Trace shared printer activity. Even when the trace is not activated, errors are recorded. 'n' is a trace level. See above text for a description of each level.

v Verbose. Various information is displayed on the terminal. This option should be used only to diagnose problems. It displays the amount of data that is transferred to the Unix spooler.
Example
startshp 3,(2,3),1,s32,lp.unix (s
Starts printer 3, serving form queues 2 and 3, both associated to the same 
printer device "lp.unix", with one page eject after each job 
(required for a laser printer), on port 32. 

startshp 4,7,1,s33,lp.unix,lpr (s
Starts printer 4, serving form queue 7, associated to the printer device 
"lp.unix", with one page eject after each job (required for a laser 
printer), on port 33, using the Unix command lpr to access a remote printer. 

startshp 5,(8,9),1,s34,(lp.unix,lp.lzr.ux),(lp -n 2 -o nobanner) (s
Starts printer 5, serving form queues 8 and 9, respectively associated to the 
printer devices "lp.unix" and "lp.lzr.unix", with one page 
eject after each job (required for a laser printer), on port 34, using the 
command "lp -n 2 -o nobanner" to generate 2 copies of each job and to 
remove the banner. 

startshp 6,10,0,s35,lp.unix,(cat >> /tmp/print) (s 
Starts printer 6, serving form queue 10, associated to the printer device 
lp.unix, with no page eject after each job, on port 35, using the command 
"cat >> /tmp/print" to send all print jobs into a regular Unix 
file. 

startshp 7,99,0,s16,lp.unix (a
Starts printer 7, serving form queue 99, associated to the printer device 
"lp.unix", initiating the alignment process. Jobs must have been 
queued on the specified form queue for alignment to be attempted.

startshp 8,97,0,s17,lp.unix (t2
Starts printer 8, serving form queue 97, associated to the printer device 
"lp.unix" with a level 2 trace.
Purpose
Related tcl.startptr
tcl.stopptr
tcl.listptr
tcl.startspooler
tcl.shp-status
tcl.shp-kill
unix.lppick
spooler.options
tcl.startshp.link