The first part of this chapter describes how to use the lprsetup utility to add a print device and automatically set up the print environment. The second part of this chapter discusses the routine print services administration that you can perform, using either the lprsetup utility or by editing system files. The last part of this chapter contains detailed reference information about the lpd print daemon and the system files associated with the print services.
You can also use the SysMan printconfig command to perform some of these tasks. Note
Refer to the
After a printer is set up and running on your system, you need to:
To use the lprsetup utility, you must have the Printer
Support Environment subset installed. To see if you have this subset installed,
enter:
If the OSFPRINT subset is not installed, see the Installation Guide for
information on adding this, or any, subset with the setld
utility.
If your system is part of a network, you may need to consult your local
network administrator about the correct procedure for adding a printer.
The following is a list of the information you need:
The following sections describe how you obtain the required information.
If you have only one printer or are entering the first of many printer
names, the first name will have a printer number of 0. This is recognized
as your system's default printer and will have an additional name of 'lp'.
This means if you use the lpr command without specifying
a specific printer this is the one it will use.
If this is the first printer connected to your system or a new printer
added to an existing print system, create names that do not conflict with
existing printer names. Ask your network administrator for the names of the
remote printers on the network.
The supported printer types are defined in Table 11-1.
11.1 Administrative Tasks
To set up the print system in a Digital UNIX operating environment,
you perform tasks such as:
11.2 Interfaces to Print Services
There are several ways you can administer print services:
11.3 Print Services Commands
Unless you are using the CDE Desktop Print Configuration application,
you use the following commands to manage the print system:
lprsetup
(8), lpc
(1), lpr
(1), lprm
(1), lpq
(1),
and lpstat
(1) reference pages for more information about these commands.
11.4 Using lprsetup to Set Up the Print System
This section describes the information you need in order to use the lprsetup utility to connect a printer to your computer. Before
proceeding, verify that the printer is physically connected to your system,
accessible on the network (for remote printing), and has been tested as described
in the owner's manual.
# setld -i | grep OSFPRINT
If the OSFPRINT subset is installed, the following information
is displayed:
OSFPRINT400 installed Local Printer Support (Printing Environment)
11.4.1 Gathering Information
Before adding a printer, you need to gather the information about the
printer that you will need to interact with the lprsetup
program. The lprsetup program updates the information
in the /etc/printcap file using the information you supply.
If you are adding a remote printer, you need the name of the
machine the printer is connected to (host name) and the remote printer queue
name.
11.4.1.1 Printer Name
The
printer name is the name by which you want to identify the printer through
the lpr command. For example:
# lpr -Pprintername
The lprsetup program uses an internal numbering scheme from 0 to 99.
The next available number is the default name. You can choose the default
by pressing the Return key or by entering any other alphanumeric name that
is appropriate. The lprsetup program always assigns at
least two printer synonyms: the default number and 'lp default number', plus
any others you specify. If the default number were 1, the two names would
be '1' and 'lp1'. This printer could then be identified with 'lpr -P1' or
'lpr -Plp1'.
11.4.1.2 Printer Type
The
printer type corresponds to the product name of the printer, such as the LN03
laser printer. If you are using the lprsetup program,
printers are listed by type and only those supported by Digital are listed.
These printers have some default values already included in the setup program.
You can set up other printers by using 'unknown' and then responding to the prompts, using values similar to those for supported printers.
Responding with 'remote' allows you to designate a remote system for printing. In this case, only four printcap file entries are required:
Responding with 'printer?' allows you to enter a mode where more information can be requested for each printer type. In this mode you are prompted to enter the same printer types as listed in the previous table. Information about the printer and the default printcap file entries for that printer are displayed. Enter 'quit' to return to the prompt to select the printer type being added.
When specifying the printer type, you must use full command names and printer names. The default printer type is 'unknown'.
To install third-party printers, consult the documentation that came with the printer.
The printer synonym is an alternate name for the printer. Some examples
include 'draft', 'letter', and 'LA-75 Companion Printer'. You can enter
as many alternate names for a printer as you like, but the total length of
the line containing all the names must be less than 80 characters. When entering
printer synonyms that can consist of many names, the entry process is terminated
when you either enter a blank line or enter a line containing only white space.
After entering a synonym, you are prompted again. If you do not want
to enter any more synonyms, press Return to continue.
Each synonym (including the printer number) identifies the printer to
the print system. For example, if you chose the synonym 'draft' for a printer,
the following command prints files on this printer:
The installation procedure creates some device special files for the
hardware that is connected to your computer. Usually, the device special files
for parallel printers are named /dev/lpn
(for example: lp1, lp2, lp3), and the device special files for serial line printers are named
/dev/ttynn (for example: tty00, tty01, tty02). The n and nn variables specify the number
of the printer.
When you use lprsetup, the program defaults to the
next consecutive number when it sets up this file. For example, the default
device pathname for the third serial line printer is /dev/tty03.
The default device special file is /dev/lp, which
specifies a parallel printer.
For remote printers, you should specify a null argument with the lp symbol. For example:
The af parameter is not applicable for remote printer
entries because the accounting policy for remote printers is employed at their
(remote) systems.
Accounting is accomplished through programs called print filters. The lprsetup script does prompt you for the line print filter information.
You must specify this information when you are prompted at the end of the lprsetup display for symbols to modify. Two print filter symbols, if and of, are needed for accounting. You modify
them at this point. For example:
Accounting files must be owned by the print daemon. If you specify
an accounting file, intermediate directories are automatically created as
needed.
When the spooling directory is created, intermediate directories are
created as necessary.
When the error log file is created, intermediate directories in the
pathname are created as necessary.
The lprsetup program supplies the default value dev.
You specify a baud rate only for serial printers that are directly connected
to your computer. Baud rates are not specified for printers connected to
the console port or connected by a parallel port or LAT port.
Digital recommends that you accept the default values for an initial
printer installation.
The printer described in the following example is an LN03R.
You can run the lprsetup program three ways:
The lprsetup command options are described in Table 11-2.
11.4.1.3 Printer Synonyms
$ lpr -Pdraft files
11.4.1.4 Device Special File
The device
special file provides access to the port on the computer to which the printer
is connected. The device special file is used if the printer is directly connected
to a local serial or parallel port. In this case, you must equate a printer
device logical name to the printer's device special file name by using the lp symbol in the /etc/printcap file. For example:
lp=/dev/lp
lp=
Note
11.4.1.5 Printer Accounting
The af parameter specifies the name of the
accounting file used to keep track of the number of pages printed by each
user for each printer. The name of the accounting file should be unique for
each printer on your system. Use the pac program to summarize
information stored in the printer accounting files. This file must be owned
by user daemon and group daemon, which
it will be if you use the lprsetup program to specify the
printer accounting file.
if=/usr/lbin/ln03rof
of=/usr/lbin/ln03rof
If you want to use separate accounting files
for each printer on your system, the file names must be unique. However, an
unlimited number of printers can share an accounting file. You cannot specify
an accounting file for remote printers.Note
11.4.1.6 Spooler Directory
The sd parameter specifies the spooling directory
where files are queued before they are printed. Each spooling directory should
be unique. All printcap file entries must specify a spooling
directory, both local and remote.
11.4.1.7 Error Log File
The lf parameter specifies the log file where
errors are reported. The default log file, if one is not specified, is /dev/console. If you have more than one printer on your system,
give each log file a unique name.
11.4.1.8 Connection Type
The ct parameter specifies the type of connection to the printer. You
can connect a printer directly to your computer from a port or terminal line.
You can access networked printers that are connected to a LAT (Local Area
Transport) terminal server or to a remote host. If you are using lprsetup, the choices for the connection type are:
11.4.1.9 Baud Rate
The baud rate is
the maximum rate at which data can travel between the data source and the
printer (for example, 4800 or 9600). The default baud rate for your printer
should appear in the printer documentation. If you reset this baud rate yourself
during the installation of the printer hardware, the rate that you set on
the printer must match the rate that you enter in the /etc/printcap file.
11.4.2 Using lprsetup to Install a Printer
This section describes how to install a printer locally (directly connected
to your computer) using the lprsetup program. You can
also use this program to modify a printer's configuration or remove a printer.
These other tasks are described in Section 11.5.
You must have superuser privileges to run the lprsetup program. Depending on the type of printer you are adding
and the information you provide, the lprsetup program might
do the following:
When you run the lprsetup script, the first
display is the main menu:
# /usr/sbin/lprsetup
Digital UNIX Printer Setup Program
Command < add modify delete exit view quit help >:
You can enter information at each prompt or press Return to select the default information provided. (In most instances, you can accept the defaults.) You can also enter a question mark (?) to get a description of the information you specify at the prompt.
Some of the symbols displayed in the lprsetup script are not supported by the Digital UNIX operating system. Refer to Table 11-4 and to the Note
printcap
(4) reference page for information on the supported symbols.
The following example shows how to use the lprsetup
command to set up an LN03R printer to be used by the local system:
After you respond to each of the prompts, lprsetup prompts you to determine if you want to change any of the
values assigned to the various symbols in your /etc/printcap
file or if you want to specify any additional symbols. For example, you can
set a specific page length or width. If you want to make any changes or add
information, enter the appropriate symbol name. Refer to the
Next, the lprsetup
script prompts you to add comments to the /etc/printcap
file. Enter n at the prompt if you do not want to add
comments. Enter y at the prompt if you want to add comments.
At the pound sign (#) prompt, enter your comment. Press Return at the pound
sign (#) prompt to exit. The comments will be insert directly above the printcap
entry in the /etc/printcap file.
Refer to the
If you are setting up a remote printer from a remote machine, the local
machine (the client) must be listed in the .rhosts file
of the remote machine (the host).
If your printer will be connected to a remote LAT terminal server, ensure
that the LAT subsets are installed as described in the Installation Guide.
To see if the LAT subsets are installed, enter:
The lptest command writes a traditional ripple test pattern to the standard
output, or you can direct the output to a printer. A pattern that contains
all 96 printable ASCII characters in each column is printed using 96 lines.
In the pattern, each printed character is displaced rightward one character
column on each successive line. This test is also useful for ascertaining
the number of lines per page and the default page parameters. You can use
the ripple test pattern to test printers, terminals, and drive terminal ports
during debugging.
The lptest command has the following syntax:
/usr/sbin/lptest[length[count]]
Use the lptest command if you need quick output of
random data. For example:
You should make sure that the /etc/inittab file does
not invoke the getty process on serial lines that have
printers attached. If you use the lprsetup script, this
is done for you.
If you change the name of the spooling directory, the accounting file,
or the error log file, lprsetup asks you to verify that
the information is correct before it deletes the original information.
To manually modify a printer's configuration, edit the /etc/printcap file and modify the entry that pertains to the printer. Refer to Section 11.6.3 and to the
To remove a printer, run the lprsetup program and
choose the delete option from the main menu. The program prompts you for
the printer name. Enter the name of the printer you want to remove. You are
prompted for confirmation that you want to delete the error log file and the
accounting file because these files can be shared by more than one printer.
If you do have shared files, do not delete them. Section 11.4.2
describes how to use the lprsetup program.
If you have included comments for the printer in the first line of its /etc/printcap file entry, the lprsetup program
does not delete them. You must edit the /etc/printcap
file and delete the comments.
To manually remove a printer, edit the /etc/printcap
file and delete the entry that pertains to the printer. You must also manually
delete the accounting and log file and the spooling directory.
There are two types of printer accounting: printer user accounting and
printer summary accounting. Printer user accounting provides information
about printer use according to the machine and user name that issues the print
request. Printer summary accounting provides information about the amount
of media (number of printed pages or number of feet of roll paper or film)
the printer produces. You specify the pac command with
the -s option to produce printer summary accounting
information.
The printer accounting files default to the /var/adm
directory. If you use the lprsetup program to add a printer,
the program creates the accounting file you specify. The /usr/adm/lpacct file is the default accounting file. If you add a printer manually,
you must create the accounting file.
Some lpc commands, for example, the disable command, require you to be superuser.
There are 15 command arguments that you can specify with the lpc command. You can also use the lpc command
interactively. If you enter the lpc command without any
command arguments, the lpc> prompt is displayed. You can
then enter command arguments.
The lpc command has the following syntax:
/usr/sbin/lpc[argument] [all | printer . . .]
Some of the command arguments allow you to specify all
to indicate all the printers or to specify one or more printer variables to indicate a specific printer.
You can specify the argument
variables defined in Table 11-3.
# /usr/sbin/lprsetup
Digital UNIX Printer Setup Program
Command < add modify delete exit view quit help >: add
Adding printer entry, type '?' for help.
Enter printer name to add [0] : [Return]
For more information on the specific printer types
enter `printer?'
Enter the FULL name of one of the following printer types:
la50 la70 la75 la324 la424 lg02 lg06 lg12
lg31 lj250 ln03 ln03s ln05 ln06 ln07 ln08
lf01r ln03r ln05r ln06r ln07r ln08r ibmpro nec290
fx80 fx1050 hpIIP hpIIIP hpIIID hpIV hp4m remote
unknown
or press RETURN for [unknown] : ln03r
Enter printer synonym: tomf
Enter printer synonym: [Return]
Set device pathname 'lp' [] ? /dev/tty01
Do you want to capture print job accounting data ([y]|n)? y
Set accounting file 'af' [/usr/adm/lpacct]?[Return]
Set spooler directory 'sd' [/usr/spool/lpd] ? [Return]
Set printer error log file 'lf' [/usr/adm/lperr] ? [Return]
Set printer connection type 'ct' [dev] ? [Return]
Set printer baud rate 'br' [4800] ? 9600
printcap
(4)
reference page or Table 11-4 for more information on
the various symbols.
Enter the name of the printcap symbol you wish to modify. Other
valid entries are:
'q' to quit (no more changes)
'p' to print the symbols you have specified so far
'l' to list all of the possible symbols and defaults
The names of the printcap symbols are:
af br cf ct df dn du fc ff fo fs gf ic if lf lo
lp mc mx nc nf of op os pl pp ps pw px py rf rm
rp rs rw sb sc sd sf sh st tf tr ts uv vf xc xf
xs fo ic nc ps Da Dl It Lf Lu Ml Nu Or Ot Ps Sd
Si Ss Ul Xf
Enter symbol name: q
Printer #0
----------
Symbol type value
------ ---- -----
af STR /usr/adm/lpacct
br INT 9600
ct STR dev
fc INT 0177777
fs INT 03
if STR /usr/lbin/ln03rof
lf STR /usr/adm/lperr
lp STR /dev/tty01
mc INT 20
mx INT 0
of STR /usr/lbin/ln03rof
pl INT 66
pw INT 80
rw BOOL on
sd STR /usr/spool/lpd
xc INT 0177777
xf STR /usr/lbin/xf
xs INT 044000
Are these the final values for printer 0 ? [y] y
Adding comments to printcap file for new printer, type '?' for help.
Do you want to add comments to the printcap file [n] ? : y
# Use this printer for draft-only
# [Return]
Set up activity is complete for this printer.
Verify that the printer works properly by using
the lpr(1) command to send files to the printer.
Command < add modify delete exit view quit help >: view
# Use this printer for draft-only
pearly|lp0|3X27|tomw:\
:af=/usr/adm/lpacct:\
:br#9600:\
:ct=dev:\
:fc#0177777:\
:fs#03:\
:if=/usr/lbin/ln03rof:\
:lf=/usr/adm/lperr:\
:lp=/dev/tty01:\
:mc#20:\
:mx#0:\
:of=/usr/lbin/ln03rof:\
:pl#66:\
:pw#80:\
:rw:\
:sd=/usr/spool/lpd:\
:xc#0177777:\
:xf=/usr/lbin/xf:\
:xs#044000:
Command < add modify delete exit view quit help >: exit
lprsetup
(8) reference page for more information on using
the program.
11.4.3 Setting Up Remote Printers
You can use the lprsetup script to set up remote
printers that are accessible from a Local Area Transport (LAT) or from a remote
machine.
# setld -i | grep OSFLAT
See the Network Administration guide for information on how to enable remote
LAT terminal server printing.
11.4.4 Testing Printers
Test your printer by using the lpr command
to print a few pages of text. You should also test any special printer features
that you intend to use regularly on this printer, for example, PostScript
or double-sided print. Refer to the lpr
(1) reference page for more information
on how to invoke these features. Table 11-4 lists the printcap symbol names, the type of values they take, default values,
and descriptions.
# /usr/sbin/lptest |lpr -P3r44
Refer to the lptest
(8)
reference page for more information.
11.5 Routine Operations
The first part of this chapter showed you how to set up the first printer
on a system. This section describes the routine administrative tasks for
a print system that is already set up. You can use the lprsetup script to perform these tasks. You can also perform the tasks
manually by editing system files and creating files and directories. If you
are making many changes to the print system at one time, it may be easier
for you to make the changes manually. The tasks described in the following
sections are:
Note that if you manually remove printers from the /etc/printcap file, you also have to remove spooling, accounting,
and error directories and files.
11.5.1 Adding Printers
Once
you have one printer set up, you can add other printers at any time. Gather
the following information about each printer:
You can add printers by running the lprsetup
command or you can add printers manually by performing the following steps:
11.5.2 Modifying Printers
To modify a printer's configuration automatically, run the lprsetup program and choose the modify option from the main menu. Section 11.4.2 describes how to use the lprsetup
program.printcap
(4) reference
page for information about the /etc/printcap file symbols.
11.5.3 Removing Printers
11.5.4 Enabling Printer Accounting
Printer accounting allows
you to charge users for printing services and to determine the amount of printer
usage.Note
Refer to Chapter 13 for more information on
using printer accounting.
11.5.5 Controlling Local Print Jobs and Queues
Use the lpc command to manage the print jobs and
queues associated with the local printers on your system. You can use the lpc command to:
Note
The following example shows that the lpd daemon is active on the printer named tester and there is one entry in the queue:
# /usr/sbin/lpc lpc> status tester tester: printer is on device '/dev/tty02' speed 9600 queuing is enabled printing is enabled 1 entry in spool area lpc>Refer to the
lpc
(8) reference page for more information.
11.6 Reference Information
This section contains information about the line printer daemon, lpd, and the system files that are required for print system operations.
These files are created automatically if you use the lprsetup
script, as described in Section 11.4.2, or you can create
and modify the files manually. Note that if you create files manually, you
will also need to manually change the /etc/printcap file,
so the changes can take effect.
After you install and boot your system, the lpd daemon
is usually started by the init program. You can start
the lpd daemon with the following command syntax:
/usr/lbin/lpd[-l]
The -l option causes the lpd daemon to log valid requests from the network. This option
is useful for debugging.
To test whether the line printer daemon is running, enter:
If you are using lprsetup, the program supplies the
default value /usr/spool/lpdn.
The n variable specifies the printer number. For
example, the default name of the spooling directory for a second line printer
could be /usr/spool/lpd2.
The
default spooling directory for any printer is /usr/spool/lpd.
Each printer entry in the /etc/printcap file should
specify a spooling directory even if the printer is connected to another machine
or is on another network. You specify a spooling directory with the sd symbol. For example:
Spooling directories must have the same parent directory name, which
is normally /usr/spool.
When the lpd daemon is activated as a result of a
print request, it looks in the printer spooling directory for a lock file. If a lock file is not found, the lpd daemon creates one and writes the identification number and
the control file name on two successive lines in the file. The lpd daemon then scans the printer spooling directory for command
files whose names begin with cf. Command files specify
the names of user files to be printed and contain printing instructions for
the files. Each line in a command file begins with a key character that indicates
what to do with the remainder of the line. The key characters and their meanings
are described in detail in the
Data files, whose names begin with df, are also located
in the spooling directory. Data files contain text formated for printing.
These files are identified by their print request identification numbers
only.
After a file is printed, the lpd daemon removes the
control and data files from the printer spooling queue, updates the status
file, and sets up the next file in the spooling queue for printing.
For example, if a printer named milhaus has jobs currently waiting to
be printed, the following command lists the files that are stored in the spooling
directory:
The following example shows an /etc/printcap entry
for both a local printer and a remote printer:
The first line of a printer entry contains the fields that specify the
printer primary reference name and printer name synonyms. This first line
and these fields are required for every printer, both local and remote.
The printer reference name is the name that you subsequently use in
order to specify printing to this printer.
You can give each printer
as many alternative reference names as you want, but each field on the first
line must be separated with a vertical bar (|). The first line must end with
a colon (:).
To make the /etc/printcap file easy to read, you
can place a colon (:) at the beginning of a line and a backslash (/\) at the
end of a line to separate the symbols.
Table 11-4 lists the printcap
symbol names, the type of values they take, default values, and descriptions.
11.6.1 Line Printer Daemon
Printers are controlled
by the line printer daemon, lpd, which is located in the /usr/lbin directory. Printing cannot take place unless the lpd daemon is running. The lpd daemon has many
functions:
When you use the lpr command, the lpd daemon is activated, and the daemon copies the file to the printer's
spooling queue or directory. Requests are printed in the order in which they
enter the queue.
A copy of the file to be printed remains in the queue until the
printer is ready to print it; then the lpd daemon removes
the file from the spooling queue and sends it to the printer.
# ps agx |grep /usr/sbin/lpd
11.6.2 Spooling Directories
Each
printer must have its own spooling directory located under the /usr/spool/lpd directory. The spooling directory acts as a printer's spooling
queue; it contains the files that are queued for printing on that printer.
A printer spooling directory should have the same name as the printer reference
name and must be located on the machine attached to the printer. The printer
reference name is the name that you specify to print on a particular printer.
sd=/usr/spool/lpd/purple
11.6.2.1 Spooling Directory Files
A spooling directory contains a status file and a lock file that are created by the lpd daemon
when a file is queued for printing.
The lock
file contains control information about the current print process. For example,
it can inform the lpd daemon that the printer is printing
a job. The lock file prevents the lpd
daemon from invoking another job on the printer while a file is printing.
The lock file contains the process identification number
of the daemon that is currently running. The status file
contains a line that describes the current printer status. This line is displayed
if a user inquires about printer status. If a printer whose status is queried
is not active, the status message written to standard output is no entries.lpd
(8) reference page.
# ls -l /var/spool/lpd/milhaus
-rw-rw---- 1 root 75 Jan 17 09:57 cfA0220mothra
-rw-rw---- 1 root 96 Jan 17 10:03 cfA143harald
-rw-rw---- 1 root 199719 Jan 17 09:57 dfA0220mothra
-rw-rw---- 1 root 9489 Jan 17 10:03 dfA143harald
-rw-r--r-- 1 root 20 Jan 17 10:06 lock
-rw-rw-rw- 1 daemon 113 Jan 17 10:00 status
11.6.2.2 Creating a Spooling Directory
If you want to manually add a printer, use the mkdir
command to create the spooling directories for each printer. The spooling
directory permission mode must be set to 775. The directory's group and ownership
must be set to the name daemon. For example:
# cd /var/spool/lpd
# mkdir lp1
# chmod 775 lp1
# chgrp daemon lp1
# chown daemon lp1
# ls -l lp1
drwxr-xr-x 2 daemon daemon 24 Jan 12 1994 lp1
11.6.3 The /etc/printcap File
The lpd daemon uses the /etc/printcap
printer database file to print requests. Each entry in the file describes
a printer. Printer characteristics are specified by 2-letter abbreviations
called symbols. The symbols are described in this section and in the printcap
(4)
reference page. The lprsetup program modifies the /etc/printcap file.
#
#
lp|lp0|0|dotmatrix|mary:\
:af=/usr/adm/printer/lp.acct:\
:br#9600:\
:ct=dev:\
:fc#0177777:\
:fs#023:\
:if=/usr/lbin/la75of:\
:lf=/usr/adm/lperr:\ [1]
:lp=/dev/tty01:\
:mx#0:\
:of=/usr/lbin/la75of:\
:pl#66:\
:pw#80:\
:sb:\ [2]
:sd=/usr/spool/lpd:\
:xc#0177777:\ [3]
:xf=/usr/lbin/xf:\
:xs#044000:\
#
#
sqirrl|3r3|ln03r3|postscript3|In office 2T20:\
:lp=:rm=uptown:rp=lp:sd=/var/spool/printer/ln03r3:mx#0:\ [4]
#
The callouts in the /etc/printcap entry
show the following possible symbol syntaxes:
Note
The remaining lines of each printer entry contain the descriptive
symbols and values that define the printer's configuration. Symbols are 2-character
mnemonics and can be specified with an equal sign (=) and alphabetic characters
or with a number sign (#) and a numeric value. Some symbol names have Boolean
equivalents, which do not use parameters. You can specify the symbols on
one line or on individual lines, but you must separate them with colons (:).
Symbol | Type | Default | Description |
---|---|---|---|
os | alphabetic | NULL | Service name supported on some terminal servers |
pl | numeric | 66 | Page length (in lines) |
pp | alphabetic | NULL | The print command filter replacement |
ps | alphabetic | non_PS | Indicates that the printer is PostScript |
pw | numeric | 132 | Page width (in characters) |
px | numeric | 0 | Page width in pixels (horizontal) |
py | numeric | 0 | Page length in pixels (vertical) |
rf | alphabetic | NULL | The FORTRAN-style text file filter |
rm | alphabetic | NULL | Machine name for remote printer ° |
rp | alphabetic | lp | Remote printer name argument |
rs | Boolean | false | Restrict remote users to those with local accounts |
rw | Boolean | false | Open the printer device for reading and writing |
sb | Boolean | false | One-line banner |
sc | Boolean | false | Suppress multiple copies |
sd | alphabetic | /usr/spool/lpd | Spool directory |
sf | Boolean | false | Suppress all form feeds, except those that are in the file |
sh | Boolean | false | Suppress printing of burst page header |
st | alphabetic | status | The status file name |
tf | alphabetic | NULL | The troff data filter (catphototypesetter) |
tr | alphabetic | NULL | Print trailing string if queue empties (the trailing string can be a series of form feeds or an escape sequence) |
ts | alphabetic | NULL | LAT terminal server node name. |
vf | alphabetic | NULL | The raster image filter (you can also specify raster filters with the if and of symbols) |
xc | numeric | 0 | If lp is a tty, clear local mode bits (tty) |
xs | numeric | 0 | If lp is a tty, set local mode bits |
You can specify an accounting filter with
the if symbols and an output filter with the of symbol. Output filters filter text data to the printer device
if accounting is not enabled or if text data must be passed through a filter.
For example:
Refer to the
Table 11-6 lists the available print filters located
in the /usr/lbin directory.
if=/usr/lbin/ln03rof
of=/usr/lbin/ln03rof
lpd
(8) reference page for more information on using
filter capabilities.
Filter Name | Description |
---|---|
ln06of | DEClaser 2200 laser printer filter |
ln06rof | DEClaser 2250 PostScript printer filter |
ln06rof_isolatin1 | DEClaser 2250 PostScript printer filter with ISO Latin_1 encoding |
ln06rof_decmcs | DEClaser 2250 PostScript printer filter with DEC multinational character set encoding |
ln07of | DEClaser 1100 laser printer filter |
ln07rof | DEClaser 1150 PostScript printer filter |
ln07rof_isolatin1 | DEClaser 1150 PostScript printer filter with ISO Latin_1 encoding |
ln07rof_decmcs | DEClaser 1150 PostScript printer filter with DEC multinational character set encoding |
ln08of | DEClaser 3200 laser printer filter |
ln08rof | DEClaser 3250 PostScript printer filter |
ln08rof_isolatin1 | DEClaser 3250 PostScript printer filter with ISO Latin_1 encoding |
ln08rof_decmcs | DEClaser 3250 PostScript printer filter with DEC multinational character set encoding |
ln09of | DEClaser 5100 PostScript printer filter |
ln09of_isolatin1 | DEClaser 5100 PostScript printer with ISO Latin_1 encoding |
ln09of_decmcc | DEClaser 5100 PostScript printer with DEC multinational character set encoding |
lj250of | LJ250 DEColorwriter filter |
Delays are specific times used to slow the transmission of the next
group of characters to the input buffer. Delays give the printer mechanism
time to perform operations such as a carriage return, newline, tab, and form
feed.
Flag bits are cleared with the fc symbol and set
with the fs symbol. All printers do not use all the flag
bits, but you must either set the bits or clear them. You should consult your
printer manual for specific information about flag bits.
The flag bits are specified as octal numbers in a 16-bit word. Octal
values are preceded with the number zero (0). To clear all the bits, specify
the value 0177777 with the fc symbol. To set all the bits,
specify the value 0177777 with the fs symbol. All bits
should be cleared (using fc#0177777) before calling the fs symbol. To set or clear any groups of bits, specify the octal
sum of the combined bits for the number of flag bits.
The following is an example of flag bit specifications:
Table 11-8 lists each flag bit name, its octal
value, and its description.
11.6.5 Flag Bits
Flag bits specify characteristics about data transmission from the host
to the printer and, if possible, from the printer to the host on a serial
line only (LAT and RS232). Data that is passed from the printer to the host
may include stop and start status information, which tells the host that the
printer input buffer can accept input or that it is about to overflow.
fc#0177777
fs#0141
As shown in the previous example, fc#0177777
clears all bits. The fs symbol set to 0141
specifies the OPOST, ONLRET, and OFILL flag bits.
Refer to the tty
(7) reference page for detailed information on flag
bits.
Refer to the
The following is an example of mode bits specifications:
Table 11-9 lists a description of each mode bit.
11.6.6 Mode Bits
Mode bits specify details about the capability of a particular terminal
and usually do not affect printer operation. Mode bits are cleared with the xc symbol and set with the xs symbol. Some printers
use all of the mode bits, so you must either set them or clear them. The
mode bits are specified as octal numbers in a 16-bit word format. You should
clear all bits by specifying xc#0177777 before you specify
the xs symbol.tty
(7) reference page for a detailed description of
the status bits.
xc#0177777
xs#044000
As shown in the previous example, xc#0177777
clears all bits. The xs symbol set to 0110
specifies the ECHO and ECHOCTL mode
bits.
On the local machine attached to the printer
you must specify the rs symbol, which specifies a Boolean
value that takes only a true (yes) or false (no) value, along with the other
printer configuration symbols. If you define the value as true, remote users
must have an account on the local machine that is attached to the printer.
If you define the value as false, remote users can access the local printer
if the local printer is listed in the .hosts file. Refer
to Section 11.6.3 for an example of an /etc/printcap file.
On the remote machine that will use the printer,
you must specify the rm, rp, lp, and sd symbols.
The rm symbol specifies the name of the machine attached
to the printer. For example:
The rp symbol specifies the printer spool name on
the remote system. For example:
For remote printers, you should specify the lp symbol
without a value:
For line printers, the pl and pw
parameters specify the page length in number of lines (default is 66) and
the column width in number of constant-width characters (default is 132),
respectively. For example:
You should not specify a width of more than 80 characters for a letter-quality
printer that uses 8 1/2-inch by 11-inch paper. If you specify a width that
is greater than 80 characters on a printer, the page prints in landscape mode.
For high-resolution laser-type printers, the line length and page width
parameters are py and px, which specify
the number of pixels along the y- and x-coordinate planes of the printer output
image area. Some printers can operate in either constant-width or imaging
modes, so you must specify both sets of parameters. For example:
Refer to your printer's manual for its output characteristics.
The error log file is specified with the lf symbol
in the /etc/printcap file. For example:
Error log files are usually located in the /var/adm
directory. An error log file can be shared by all local printers, but you
should specify the file in each /etc/printcap file printer
entry.
With TCP/IP printing, the local host manages print jobs in the same
manner as it would manage print jobs for a local printer. The only difference
is that with TCP/IP printing, the local print daemon (lpd) communicates with the remote printer over TCP/IP (similar
to LAT printing). Each printer listens for connection requests on a socket
number that is specified in the printer hardware or that is user-defined through
the printer console.
Although multiple hosts can talk to a single printer connected to the
network in this way, the hosts are handled on a first-come, first-served basis.
Therefore, TCP/IP printing is not the same as remote printing, in which the
remote printer manages a print queue on the remote site and listens for network
connections on socket 515 (as specified in the entry for printer in /etc/services).
In addition, printing
non-PostScript files with some PostScript and non-PostScript filters may yield
unexpected results. Table 11-11 lists the filters
with which you could experience these problems.
11.6.7 Remote Printer Characteristics
If a printer will be used by users on remote machines, /etc/printcap files on the local machine attached to the printer and on the remote
machines that will use the printer must contain some network configuration
information.
rm=deccom
rp=ln03lab
lp=
The sd
symbol specifies the spooling directory. For example:
sd=/usr/spool/lpd
11.6.8 Pagination and Imaging Parameters
Printer filters must know the size of an output page to perform proper
page framing and line-feed and carriage returns (line folding).
pl#55
pw#70
px#60
py#80
11.7 Troubleshooting
This section provides a checklist for diagnosing printer
problems. It also describes how print errors are logged in the /usr/adm/lperr file, providing this feature is specified in the /etc/printcap file.
11.7.1 Installation and Routine Operations
If a problem occurs on an existing printer or when adding a printer
to a system, diagnose the problem as follows:
# ps agx |grep /usr/sbin/lpd
If the daemon is not running,
restart it by using the following commands:
# rm -f /dev/printer /var/spool/lpd.lock
# /usr/lbin/lpd -l
The first command removes the /dev/printer and /var/spool/lpd.lock files. In the second command, the -l option causes the daemon to log requests from the network.
This flag is useful for debugging problems with remote printers.
11.7.2 Printer Error Logging
The lpd daemon logs printer errors
to the error log file. Specifying an error log file is optional. If you used lprsetup to install the printer, the program provides the default
value /usr/adm/lperr. If you do not specify an error log
file, errors are logged to /dev/console.
lf=/var/adm/lpderrs
11.8 TCP/IP (telnet) Printing
TCP/IP
printing, also called telnet printing, allows you to submit
print jobs to a remote printer that is directly connected to the network.
Note that to use this feature, your printer must contain a TCP/IP interface
card and must be registered with a TCP/IP node name and node address.
11.8.1 Setting up TCP/IP Printing
The following steps describe how to set up TCP/IP printing on a local
host.
Printer Socket Number
DEClaser 3500 (LN14)
10001
DEClaser 5100 (LN09)
10001
HP Laserjet 4m+
9100
LN17
2501
To obtain the socket number for other printers, see your printer
documentation. Some printers may allow you to specify this number yourself.
ct=tcp
lp=@nodename
/servicename
Replace nodename with the name of the printer's node as registered for
use on your network and replace servicename with
the name you will choose to enter in the /etc/services
database in the next step. If you want to modify an existing /etc/printcap printer entry to use TCP/IP printing, edit the /etc/printcap file using a text editor, such as vi, and modify
the values for the ct and lp variables.
You can also remove the values for the xs, xc, fs, and fc control variables
which establish settings that are relevant to the serial port driver. These
are ignored by the network socket driver.
declaser3500 10001/tcp
Note
that the user-defined declaser3500 string represents the
service; it is the same string that you would have entered as the servicename in the /etc/printcap file in
step 2a. After saving the changes to the /etc/services
file, restart the inetd daemon to reload the /etc/services file with the printer information you just added.
To do this, type the following command:
# rcinet restart
This stops
and restarts the Internet network services on your system.
11.8.2 Using TCP/IP Printing
Once configured, TCP/IP printing is used like local and remote printing.
From the command line, execute the lpr command specifying
the node name of the printer, command options, and file names.
11.8.3 Known Restrictions on the Use of TCP/IP Printing
TCP/IP printing works when printing within a local subnet; however,
printing in complex networks across one or more routers may cause reliability
problems.
Filter Name | Filter Type |
---|---|
lpf | Non-PostScript |
la75of | Non-PostScript |
la324of | Non-PostScript |
lqf | Non-PostScript |
hplaserof | PostScript |
To provide expected behavior with older printers, these non-PostScript filters maintain a dependence on the serial port driver to automatically supply carriage returns after line feeds when you specify the (octal) 020 bit to the fs control variable in the /etc/printcap file.
Because this control bit is not interpreted by the network socket driver, the formatting behavior that would be supplied by the serial port driver is absent. Therefore, non-PostScript files that are not preformatted for the printer may not print out as they would in serial-port-connected configurations. In particular, this may affect ASCII text files that do not contain embedded carriage-returns.
Most printers using the lpf, la75of, la324of, and lqf non-PostScript filters do not provide network interface card support. However, the printing problems may still be an issue for users who use serial-and-parallel-port to network-port converters, like the Digital RapidPrint network interface box, which allow these printers to act like TCP/IP printers with built-in network support.
The hplaser4psof PostScript filter works for PostScript files and for preformatted non-Postscript files (like PCL files), but it will likely produce unexpected results for files that have not been preformatted (such as ASCII text without embedded carriage-returns).