14 HELIOS LPR printing system
For the UB versions, HELIOS developed an entirely new advanced printing system, to offer the latest printing technology to meet highest printing demands for enterprise and prepress environments. The HELIOS printing system is BSD LPR/LPD command line compatible. Some of its unique features are:
- Unlimited job sizes per queue
- Unlimited number of jobs
- UTF-8 job name titles
- Advanced job management, e.g. copying, moving, redoing, and archiving jobs
- Advanced print job accounting and error handling
- Print job event notification
- Pipelining jobs into multiple print workflows
- GUI-based administration as well as from command line.
HELIOS LPR creates a printer job in a spooling area for subsequent printing as facilities become available. Each print job consists of a control file and one or more data files. The data files are copies of - or, with
s, symbolic links to - each file name you specify. The spool area is managed by the "lpd" (
Line Printer Daemon). Jobs that specify a printer on a remote machine are forwarded by "lpd". "lpr" reads from the standard input if no files are specified.
"lpr", which is responsible for passing print jobs to the appropriate printer, is used by the HELIOS Base printing service and is configured through the host configuration file "HELIOSDIR/var/conf/printcap". This file contains an entry for each printer queue assigned to the system in order to define how the printer is connected to the network, and to specify which programs are responsible for transferring data to the printer.
14.1 The HELIOS printing system
The HELIOS printing system derives from the lpr printing system. The figures below and on the next page show the workflow which print jobs usually take, considering the various types of printer queues.
The printer settings are best configured in HELIOS Admin (
Printer > Settings). Fonts, PPDs (
PostScript Printer Description) and PostScript initialization are stored in the "HELIOSDIR/var/spool/qmeta" directory. The spool directories are defined in the "printcap" file ("HELIOSDIR/var/conf/printcap").
The figure on the previous page gives an overview of the HELIOS printing system workflow. However, of course it is possible to combine two or more printer queues and, in doing so, gain more efficiency from the printing process. E.g., the printer queues can be configured so that successfully resolved print jobs are sent to a so-called "Hold" queue, whereas faulty print jobs are relocated to an "Error" queue.
Another possibility is to define printer queues in the process that employ more than one other queue and so save time and server resources:
By use of a "Clone queue" print jobs can be duplicated into multiple queues (see Fig.
79) which are defined in a group of printers.
Fig. 79: Example "Clone queue"
|
* CTP =
Computer To Plate
A "Balance queue" is used to set up a group of printers for load balancing - that is for shifting print jobs to a second or third printer in a group whenever the first printer is busy with a huge job (see Fig.
80).
Fig. 80: Example "Balance queue"
|
* next available queue in "Balance" group.
Note: We recommend to select the same PPD for the "Balance queue" which is already assigned to the printers of this group. Otherwise the printing results may not be predictable.
14.2 Printer output interfaces
The table below lists the HELIOS printer output interfaces and briefly describes their task/function. The column
HELIOS product lists the HELIOS software product which supports the particular printer output interface.
|
|
|
|
|
|
|
|
|
|
|
|
|
Print to AppleTalk/PAP driver
|
|
|
|
|
|
"Create PDF" interface driver
|
|
|
|
|
|
Remote LPR/TCP stream driver
|
|
|
|
|
|
|
|
|
|
|
lpr - send a job to the printer
HELIOSDIR/bin/lpr [-Pprinter ][-#copies ][-Cclass ]
[-Jjob ][-Ttitle ][-i[indent ]][-1234font ][-wcols ]
[-r][-m][-h][-s][-x option][-filter-option ]
[filename ... ]
lpr creates a printer job in a spooling area for subsequent printing as facilities become available. Each printer job consists of a control file and one or more data files. The data files are copies of (or, with
-s, symbolic links to) each
filename you specify. The spool area is managed by the line printer daemon,
lpd. Jobs that specify a printer on a remote machine are forwarded by
lpd.
lpr reads from the standard input if no files are specified.
Options (= not used by HELIOS LPR printing)
Send output to the named
printer. Otherwise send output to the printer named in the environment variable PRINTER, or to the default printer
lp.
Produce the number of
copies indicated for each named file, e.g.:
example% lpr -#3 index.c lookup.c
produces three copies of
index.c, followed by three copies of
lookup.c. On the other hand,
example% cat index.c lookup.c || lpr -#3
generates three copies of the concatenation of the files.
Print
class as the job classification on the burst page. For example,
example% lpr -C Operations new.index.c
replaces the system name (the name returned by
hostname) with operations on the burst page, and prints the file
new.index.c.
Print
job as the job name on the burst page. Normally,
lpr uses the first file's name.
Use
title instead of the file name for the title used by
pr. All job names are handed over in Unicode/UTF-8 format.
Indent output
indent SPACE characters. Eight SPACE characters is the default. The indent is passed to the input filter. If no input filter is present, this option is ignored.
Mount the specified
font on font position
1,
2,
3 or
4.
The daemon will construct a
.rail-mag file in the spool directory that indicates the mount by referencing
"/usr/lib/vfont/font".
Use
cols as the page width for
pr.
Remove the file upon completion of spooling, or upon completion of printing with the
-s option.
Send mail upon completion.
Suppress printing the burst page.
Create a symbolic link from the spool area to the data files rather than trying to copy them (so large files can be printed). This means the data files should not be modified or removed until they have been printed. This option can be used to avoid truncating files larger than the maximum given in the
mx capability of the
printcap entry.
-s only prevents copies of local files from being made. Jobs from remote hosts are copied anyway.
-s only works with named data files; if the
lpr command is at the end of a pipeline, the data is copied to the spool.
Pass options to the printer output interfaces. The options are stored in the control file ("cf" file) for the print job. When the job is printed, the options are set in the environment of the printer output interface as "HELIOS_XOPTION_key=value".
It is possible to specify more than one
-x option on the command line.
The following single letter options notify the line printer spooler that the files are not standard text files. The spooling daemon will use the appropriate filters to print the data accordingly:
-p Use
pr to format the files (
lpr -p is very much like
"
pr | lpr").
-l Print control characters and suppress page breaks.
-t The files contain
troff (cat phototypesetter)
binary data.
-n The files contain data from
ditroff (device
independent troff).
-d The files contain data from
tex (DVI format from
Stanford).
-g The files contain standard plot data as produced by
the
plot routines (see
plot (1G) for the filters
used by the printer spooler).
-v The files contain a raster image, see
rasterfile.
The printer must support an appropriate imaging
model such as PostScript in order to print the image.
-c The files contain data produced by
cifplot.
-f Interpret the first character of each line as a standard
FORTRAN carriage control character.
If no
filter-option is given (and the printer can interpret PostScript), the string "
%!" as the first two characters of a file indicates that it contains PostScript commands.
These filter options offer a standard user interface, and all options may not be available for, nor applicable to, all printers.
lprm - remove jobs from the printer queue
HELIOSDIR/bin/lpc [ -Pprinter ][-
][job #... ]
[username...]
lprm removes a job or jobs from a printer's spooling queue. Since the spool directory is protected from users, using
lprm is normally the only method by which a user can remove a job.
Without any arguments,
lprm deletes the job that is currently active, provided that the user who invoked
lprm owns that job.
When the super-user specifies a username,
lprm removes all jobs belonging to that user.
You can remove a specific job by supplying its job number as an argument, which you can obtain using
lpq. For example:
host is ready and printing
Rank Owner Job Files Total Size
active wendy 385 standard input 35501 bytes
lprm reports the names of any files it removes, and is silent if there are no applicable jobs to remove.
lprm kills the active printer daemon, if necessary, before removing spooled jobs; it restarts the daemon when through.
Display information about the queue for the specified printer. In the absence of the
-P option, the queue to the printer specified by the PRINTER variable in the environment is used. If the PRINTER variable isn't set, the queue for the default printer is used.
Remove all jobs owned by you. If invoked by the superuser, all jobs in the spool are removed. (Job ownership is determined by the user's login name and host name on the machine where the
lpr command was invoked).
Since race conditions are possible when updating the lock file, an active job may be incorrectly identified for removal by an
lprm command issued with no arguments. During the interval between an
lpq command and the execution of
lprm, the next job in line may have become active; that job may be removed unintentionally if it is owned by you. To avoid this, supply
lprm with the job number to remove when a critical job that you own is next in line.
Only the superuser can remove print jobs submitted from another host.
lpq - display the queue of printer jobs
HELIOSDIR/bin/lpc [-Pprinter ][-l][+[interval]]
[job #... ] [username...]
lpq displays the contents of a printer queue. It reports the status of jobs specified by
job#, or all jobs owned by the user specified by
username.
lpq reports on all jobs in the default printer queue when invoked with no arguments.
For each print job in the queue,
lpq reports the user's name, current position, the names of input files comprising the job, the job number (by which it is referred to when using
lprm) and the total size in bytes. Normally, only as much information as will fit on one line is displayed. Jobs are normally queued on a "first-in-first-out basis". File names comprising a job may be unavailable, such as when
lpr is used at the end of a pipeline; in such cases the file name field indicates ``(standard input)".
If
lpq warns that there is no daemon present (that is, due to some malfunction), the
lpc command can be used to restart a printer daemon.
Note: Print job names are displayed in UTF-8 encoding. The HELIOS "uniconv" tool can be used to convert the output into other encodings, e.g. ISO-8859-1.
Display information about the queue for the specified
printer. In the absence of the
-P option, the queue to the printer specified by the PRINTER variable in the environment is used. If the PRINTER variable isn't set, the queue for the default printer is used.
Display queue information in long format; includes the name of the host from which the job originated.
Display the spool queue periodically until it empties. This option clears the terminal screen before reporting on the queue. If an
interval is supplied,
lpq sleeps that number of seconds in between reports.
lpc - line printer control program
HELIOSDIR/bin/lpc [ command [ parameter... ] ]
lpc controls the operation of the printer, or of multiple printers, as described in the "HELIOSDIR/var/conf/printcap" database.
lpc commands can be used to start or stop a printer, disable or enable a printer's spooling queue, rearrange the order of jobs in a queue, or display the status of each printer - along with its spooling queue and printer daemon.
With no arguments,
lpc runs interactively, prompting with
lpc>. If arguments are supplied,
lpc interprets the first as a
command to execute; each subsequent argument is taken as a
parameter for that command. The standard input can be redirected so that
lpc reads commands from a file.
Commands may be abbreviated to an unambiguous substring.
Note: the printer parameter is specified just by the name of the printer (as lw), not as you would specify it to lpr or lpq (not as -Plw).
? [command]...
help [command]...
Display a short description of each command specified in the argument list, or, if no arguments are given, a list of the recognized commands.
abort [
all | [ printer ...]]
Terminate an active spooling daemon on the local host immediately and then disable printing (preventing new daemons from being started by
lpr) for the specified printers. The
abort command can only be used by the superuser.
moveJob [printer1 printer2][jobid]
Move a print job from one printer queue on the host to another printer queue on the same host, optionally with a given print job ID. The
moveJob command can only be used by the superuser.
copyJob [printer1 printer2][jobid]
Copy a print job from one printer queue on the host to another printer queue on the same host, optionally with a given print job ID. The
copyJob command can only be used by the superuser.
entries [
all | [printer ...]]
List the number of entries in existing printer queues.
clean [
all | [ printer ...]]
Remove all files with names beginning with
cf,
tf,
ef,
vf, or
df from the specified printer queue(s) on the local machine. The
clean command can only be used by the superuser.
disable [
all | [ printer ...]]
Turn the specified printer queues off. This prevents new printer jobs from being entered into the queue by
lpr. The
disable command can only be used by the superuser.
down [
all | [ printer ...]][message]
Turn the specified printer queue off, disable printing and put message in the printer status file. The message does not need to be quoted, the remaining arguments are treated like
echo. This is normally used to take a printer down and let others know why (
lpq indicates that the printer is down, as does the
status command).
enable [
all | [ printer ...]]
Enable spooling on the local queue for the listed printers, so that
lpr can put new jobs in the spool queue. The
enable command can only be used by the superuser.
restart [
all | [ printer ...]]
Attempt to start a new printer daemon. This is useful when some abnormal condition causes the daemon to die unexpectedly leaving jobs in the queue.
lpq reports that there is no daemon present when this condition occurs. This command can be run by any user.
shiftJob [ printer ][jobid][predecessorid]
Print the job
jobid right after the job
predecessorid. (This is also displayed by
lpq.) If no
predecessorid is specified, the job is printed first.
start [
all | [ printer ...]]
Enable printing and start a spooling daemon for the listed printers. The
start command can only be used by the superuser.
status [
all | [ printer ...]]
Display the status of daemons and queues on the local machine. This command can be run by any user.
stop [
all | [ printer ...]]
Stop a spooling daemon after the current job completes and disable printing. The
stop command can only be used by the superuser.
topq printer [ job# ...][user ...]
Move the print job(s) specified by job# or those job(s) belonging to user to the top (head) of the printer queue. The
topq command can only be used by the superuser.
up [
all | [ printer . . . ] ] Enable everything and start a new printer daemon. Undoes the effects of
down.
The abbreviation you typed matches more than one command.
You typed a command or abbreviation that was not recognized.
You used a command that can be executed only by the superuser.
lpd is the line printer daemon (spool area handler). It is usually invoked at boot time from the "start-helios" script, making a single pass through the
printcap file to find out about the existing printers and printing any files left after a crash. It then accepts requests to print files in a queue, transfer files to a spooling area, display a queue's status, or remove jobs from a queue. In each case, it forks a child process for each request, and continues to listen for subsequent requests.
The Internet port number used to communicate with other processes is obtained with
getservent.
If a file cannot be opened, an error message is logged using the facility of
syslog.
lpd will try up to 20 times to reopen a file it expects to be there, after which it proceeds to the next file or job.
All TCP/IP remote lpr print jobs are only accepted by the LPD daemon if access is granted in the
"HELIOSDIR/var/conf/ipaccess" file. We recommend to edit the "ipaccess" configuration file with HELIOS Admin (
Settings > IP Access).
To allow remote access to the LPD of a machine, independent of the entries in the main "ipaccess" list, it is possible to create a "HELIOSDIR/var/conf/ipaccess.lpd" file which will only be used by the LPD daemon.
To set up a "ipaccess.lpd" file you could do the following:
Copy the existing "ipaccess" file to "ipaccess.lpd".
cd /usr/local/helios/var/conf
Then edit "ipaccess.lpd" for your needs.
Log valid requests received from the network. This can be useful for debugging purposes.
The
lock file in each spool directory is used to prevent multiple daemons from becoming active, and to store information about the daemon process for
lpr,
lpq, and
lprm.
lpd uses
flock to provide exclusive access to the lock file and to prevent multiple daemons from becoming active simultaneously. If the daemon should be killed or die unexpectedly, the lock file need not be removed. The lock file is kept in a readable ASCII form and contains two lines. The first is the process id of the daemon and the second is the control file name of the current job being printed. The second line is updated to reflect the current status of
lpd for the programs
lpq and
lprm.
After the daemon has successfully set the lock, it scans the directory for files beginning with
cf. Lines in each
cf file specify files to be printed or non-printing actions to be performed. Each such line begins with a key character that indicates what to do with the remainder of the line.
J Job name to print on the burst page.
C Classification line on the burst page.
L Literal. This line contains identification information
from the password file, and causes a burst page to be
printed.
T Title string for page headings printed by
pr.
H Hostname of the machine where
lpr was
invoked.
P Person. Login name of the person who invoked
lpr. This is used to verify ownership by
lprm.
M Send mail to the specified user when the current
print job completes.
f Formatted File, the name of a file to print that is
already formatted.
l Like
f, but passes control characters along, and does
not make page breaks.
p Name of a file to print using
pr as a filter.
t Troff File. The file contains
troff output (cat
photo-typesetter commands).
n Ditroff File. The file contains device independent
troff output.
d DVI File. The file contains T
E X output (DVI
format from Stanford).
g Graph File. The file contains data produced by
plot.
c Cifplot File. The file contains data produced by
cifplot.
v The file contains a raster image.
r The file contains text data with FORTRAN carriage
control characters.
1 Troff Font R. The name of a font file to use instead
of the default.
2 Troff Font I. The name of the font file to use instead
of the default.
3 Troff Font B. The name of the font file to use instead
of the default.
4 Troff Font S. The name of the font file to use instead
of the default.
W Width. Changes the page width (in characters) used
by
pr and the text filters.
I Indent. Specify the number of characters by which
to indent the output.
U Unlink. The name of file to remove upon completion
of printing.
N Filename. The name of the file being printed, or a
blank for the standard input (when
lpr is invoked
in a pipeline).
X X options set with
lpr -x
When a file is spooled for printing, the content is copied into a data file in the spool directory. Data file names begin with
df. When
lpr is called with the
-s option, the control files contain a symbolic link to the actual file, and no data files are created.
The file
minfree in each spool directory contains the number of kB to leave free so that the line printer queue will not completely fill the disk.
printcap - printer capability database
HELIOSDIR/var/conf/printcap
printcap is a simplified version of the
termcap database for describing printers. The spooling system accesses the
printcap file every time it is used, allowing dynamic addition and deletion of printers. Each entry in the database describes one printer. This database may not be substituted for, as is possible for
termcap, because it may allow accounting to be bypassed.
The default printer is normally
lp, though the environment variable PRINTER may be used to override this. Each spooling utility supports a
-Pprinter option to explicitly name a destination printer.
Refer to the "4.3 BSD Line Printer Spooler Manual" for a discussion of how to set up the database for a given printer.
Each entry in the
printcap file describes a printer, and is a line consisting of a number of fields separated by ":" characters. The first entry for each printer gives the names which are known for the printer, separated by "|" characters. Entries may continue onto multiple lines by giving a "\" as the last character of a line, and empty fields may be included for readability.
Capabilities in
printcap are all introduced by two-character codes, and are of three types:
Boolean Capabilities that indicate that the printer has
some particular feature. Boolean capabilities are
simply written between the ":" characters, and
are indicated by the word "bool" in the
type
column of the capabilities table below.
Numeric Capabilities that supply information such as
baud-rates, number of lines per page, and so on.
Numeric capabilities are indicated by the word
num in the
type column of the capabilities table
below. Numeric capabilities are given by the
two-character capability code followed by the
"#" character, followed by the numeric value.
The following example is a numeric entry stating
that this printer should run at 1200 baud:
String Capabilities that give a sequence which can be
used to perform particular printer operations
such as cursor motion. String valued capabilities
are indicated by the word
str in the
type column
of the capabilities table below. String valued
capabilities are given by the two-character
capability code followed by an "=" sign and then
a string ending at the next following ":", e.g.:
is a sample entry stating that the remote printer
is named
spinwriter.
If an entry for a file or directory is not an absolute path (i.e.
does not start with "/") then the file or directory is relative to HELIOSDIR.
:af=var/adm/printer.acct:
Capabilities
|
|
|
|
|
|
|
|
|
|
|
if lp is a tty, set the baud rate (ioctl call)
|
|
|
|
|
|
|
|
T EX® data filter (DVI format)
|
|
|
|
User ID of user "daemon".
|
|
|
|
if lp is a tty, clear flag bits
|
|
|
|
string to send for a form feed
|
|
|
|
print a form feed when device is opened
|
|
|
|
|
|
|
|
graph data filter (plot format)
|
|
|
|
print the burst header page last
|
|
|
|
driver supports (non standard) ioctl to indent printout
|
|
|
|
name of input/communication filter (created per job)
|
|
|
|
|
|
|
|
|
|
|
|
device name to open for output
|
|
|
|
|
|
|
|
list of terminal modes to set or clear
|
|
|
|
maximum file size (in BUFSIZ blocks), zero = unlimited
|
|
|
|
next directory for list of queues (unimplemented)
|
|
|
|
ditroff data filter (device independent troff)
|
|
|
|
name of output/banner filter (created once)
|
|
|
|
price per foot or page in hundredths of cents
|
|
|
|
|
|
|
|
page width (in characters)
|
|
|
|
page width in pixels (horizontal)
|
|
|
|
page length in pixels (vertical)
|
|
|
|
filter for printing FORTRAN style text files
|
|
|
|
restricted group. Only members of group allowed access
|
|
|
|
machine name for remote printer
|
|
|
|
remote printer name argument
|
|
|
|
restrict remote users to those with local accounts
|
|
|
|
open printer device read/write instead of write-only
|
|
|
|
short banner (one line only)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
suppress printing of burst page header
|
|
|
|
|
|
|
|
name of similar printer; must be last
|
|
|
|
troff data filter (C/A/T phototypesetter)
|
|
|
|
trailer string to print when queue empties
|
|
|
|
|
|
|
|
if lp is a tty, clear local mode bits
|
|
|
|
|
If the local line printer driver supports indentation, the daemon must understand how to invoke it.
Example preferences for AppleTalk/PAP printer:
# Spooler Preferences for PAP and SMB:
[][Printers][lw8500][PAPPublish]
[][Printers][lw8500][SMBPublish]
[][Printers][lw8500][authenticate]
[][Printers][lw8500][papname]
[][Printers][lw8500][SMBExportName]
[][Printers][lw8500][SMBExportSpec]
bin/pcfilter lw8500 | bin/lpr -Plw8500
# Interface Preferences for AppleTalk PAP:
[][Printers][lw8500][entity]
LaserWriter 8500:LaserWriter@HELIOS Backbone
[][Printers][lw8500][IfType]
[][Printers][lw8500][holdq]
[][Printers][lw8500][errorq]
Example HELIOS "printcap" entries:
:lp=var/spool/qmeta/lw8500/device:\
:if=var/spool/qmeta/lw8500/if:\
:sh:\
:mx#0:\
:sf:\
:du#0:\
:sd=/var/spool/lw8500:\
:af=var/adm/printer.acct:\
:lf=/var/spool/lw8500/lw8500-log:
/etc/passwd personal identification
HELIOSDIR/var/conf printer capabilities database
/printcap
HELIOSDIR/var/conf interface output options
/Preferences
HELIOSDIR/var/conf TCP/IP access list for remote
/ipaccess access to the LPD
HELIOSDIR/var/run "PID" for master LPD daemon
/lpd.lock
HELIOSDIR/var/run communication socket file
/lpd.fifo
HELIOSDIR/sbin/lpd line printer daemon
HELIOSDIR/bin/*if HELIOS printer drivers
/var/spool/* directories used for spooling
/var/spool/*/cf* daemon control files
/var/spool/*/df* data files specified in `cf' files
/var/spool/*/tf* temporary copies of `cf' files
/var/spool/*/ef* print job error file
/var/spool/*/vf* print job PDF view file,
e.g. PDF from "PrintPreview" or
"Create PDF" spool queue
/var/spool/*/.seq sequence ID of next job
/var/spool/*/lock "PID" of the queue LPD daemon
/var/spool/*/*-log queue log file in spool directory
/var/spool/*/minfree minimum free space to leave
/var/spool/*/status text status file of current print job
HELIOSDIR/var/spool PPD file for spooler/device
/qmeta/*/PPD
HELIOSDIR/var/spool PostScript fonts of device
/qmeta/*/FONTS
HELIOSDIR/var/spool printer setup file to be included
/qmeta/*/SETUP in every PostScript job