This chapter describes how to set up and administer the files and utilities that make up the print services. You can set up and administer the print services immediately after a new installation or an upgrade to a new version of the operating system, or you can wait until later. For example, you can wait until you have installed a printer and have gathered the information about its characteristics that you need to set it up.
During initial configuration of your system after a full installation,
you will see a checklist titled
System Setup.
On this
menu is an option for Printer Configuration, which runs the
printconfig
graphical user interface.
Refer to
Section 8.2.2
for information.
The following topics are discussed in this chapter:
Section 8.1 provides an overview of the administrative tasks, describes the different configuration methods and the set up utilities that you can use. It provides pointers to other documentation that you may need to read. Also listed here are the various system files that are used by print operations and any utilities that are related to print operations.
Section 8.2
describes how to use different utilities
to set up local, remote, and networked printers.
It describes the
printconfig
and
lprsetup
utilities.
Also included
is information on Advanced Server for UNIX (ASU) print facilities that support
client PCs and the Advanced Printing Software.
Section 8.3 describes routine print system maintenance, such as adding and removing printers or controlling print jobs.
Section 8.4 provides reference information on advanced topics such as the structure of system files, spooling, daemons, error reporting, and and print filters.
Section 8.5 describes current restrictions on the use of certain print filters.
Section 8.6 provides information that enables you to test printers and resolve problems.
8.1 Print Administrative Tasks
To set up the print system, you perform the following tasks:
Physically connect a printer to the system or ensure that you have access to it through a network
Add information about a printer in the
/etc/printcap
file
Create the required device files and spooling directories
Start the print (lpd
) daemon
Manage printer accounting
Verify printer installation and perform a test printing
After a printer is set up and running on your system, you need to:
Manage the system and take care of routine changes such as adding new printers or changing the characteristics of existing printers
Administer the print queues and files as your system needs change
Control the daily operations and throughput of print jobs
The tools that you use to perform these operations are described
in
Section 8.1.5.
8.1.1 Advanced Printing Software
The Advanced Printing Software is an optional subset on the Associated
Products CD-ROM.
For information about this software, see the Advanced Printing
Software
Installation Guide
and refer to the
Advanced Printing Software System Administration and Operation Guide
and the
User Guide.
Note that when the Advanced Printing Services software
is installed, you must configure a gateway, as described in
Section 8.2.2.
to run Advanced Printing Services and the print daemon
lpd
on
the same system.
You can run Advanced Printing Services with
lpd
disabled, in which case it will receive all inbound remote print
requests (on socket 515) instead of LPD.
However, with this configuration,
local
lpd
commands such as
lpr
will
not work.
8.1.2 Printer Configuration Methods
Depending on your local system configuration, you have several options for installing and configuring printers, For example:
Direct - Local installation of a single printer is the simplest installation. At the rear of the system are serial or parallel hardware ports to which you connect a printer with a cable. (The printer documentation describes the hardware installation.) This printer can be used by a single user, if connected directly to a single-user workstation, or it can be configured to be shared with other users if it is connected to a multiuser system or server. Note that connections using USB ports are not yet supported.
Remote - Connection to a printer that is directly connected to another system on the network. The remote option requires that your system can access and use services on the system to which the printer is connected.
Network - Connection to shared a network printer across a local area network (LAN) or a local area transport (LAT) connection or via TCP/IP. For example, a desktop workstation may be able to print to several different network printers.
PC Network -- Connection to Personal Computer (PC) print queues when using the Advanced Server for UNIX (ASU). This application is used to manage mixed IBM-compatible PC and UNIX printer environments. When ASU is installed, you have additional options to configure PC print queues and share printers between PC clients.
There are also several different ways to perform printer administration tasks, each of which provides certain advantages:
The
printconfig
graphical user interface,
which is recommended for first-time users and for quick setup.
The
printconfig
utility is part of the standard set
of system administrative tools.
Refer to
Chapter 1
for general
information on these tools.
When ASU is installed,
printconfig
also enables you to manage PC printers.
The operating system supplies drivers
and configuration files a number of third-party printers.
When you use
printconfig
, it will automatically display a list of all the supported
printers and enable you to configure them quickly.
Note
There are restrictions on using
printconfig
with older/etc/printcap
files. Refer to theprintcap
(4) reference page for information.
The
lprsetup
utility.
This utility provides
backwards compatability with previous releases.
The
lprsetup
utility is a command-line utility that
you run from a terminal.
It performs the same tasks as
printconfig
, but does not support PC printers even if ASU is installed.
Note
that if you select the command-line option when invoking
printconfig
, the
lprsetup
utility will be invoked.
Note
Currently,
lprsetup
is the command-line utility for print configuration. However,printconfig
is the preferred method for administering printers. Thelprsetup
utility does not support the management of PC printers under Advanced Server for UNIX (ASU), although ASU itself offers features for PC queue management.
Manual edits to system files
Experienced system administrators may want to manage printers by editing
the system files.
For example, if you are working on printer driver development,
it may be necessary to create test entries in the printer configuration file
/etc/lprsetup.dat
.
Alternatively, you may want to clone a particular
printer configuration across a number of systems by editing the
/etc/printcap
file to include several configured printers, and copying
that file to the destination systems.
The reference information in this chapter
will assist you in performing such tasks or in writing shell scripts.
However,
note that In this release, the
/var/spool/lpd
file is a
special link to support clusters.
You must take care not to break this link
when manually editing a file.
See the section on CDSLs in
Chapter 6.
The following documentation contains information on using printer configuration tools.
Books:
Consult the printer documentation for information on installing the printer and for required software settings such as data communication (baud) rates. This is particularly important if you are attempting to configure a printer that is not in the list of supported devices. The printer documentation will provide information that you may need to provide to the configuration utility to use any special capabilities of the printer, such as tray selection.
Usually, you will see your printer included in the list of supported
devices when you use an installation utility (or if you look in
/etc/lprsetup.dat
).
If it is not listed there, and the manufacturer
does not provide information for using the printer under UNIX, you may be
able to use it with generic settings provided in the configuration tools.
However, you will probably not be able to use any special capabilities of
the printer, and will most likely be limited to basic features.
The Network Administration guide provides information on configuring or connecting to networked printers.
The Writing Software for the International Market guide provides information on internationalization support for printers that offer local-language capabilities, such as support for Asian languages.
The Common Desktop Environment: User's Guide and Common Desktop Environment: Advanced User's and System Administrator's Guide provide information on setting up printer services in the Common Desktop Environment.
The Installation and Administration Guide describes ASU features for managing PC print queues.
Reference pages:
ports
(7)
- Contains information about the printer
ports that you use to connect printers to a system, and how they map to printer
device special file names in
/dev
.
printconfig
(8),
lprsetup
(8)
- Contain information
about the configuration tools and their command line options.
printcap
(4),
lprsetup.dat
(4)
- Contain information about
the system files in which printer configuration information is located.
wwpsof
(8),
pcfof
(8)
- Contain information about
generic print filters.
The
wwpsof
(8)
reference page describes a generic
internationalized print filter for PostScript printers that enables you to
support local-language PostScript printing.
The
pcfof
(8)
reference page
describes a generic print filter for ANSI, PCL and PostScript printers.
lpd
(8)
- Contains information about the print
daemon.
latcp
(8)
- Contains information about the local
area transport (LAT) control utility.
This utility is used for adding services,
such as print services, to a host and is only of interest if you are using
networked printers.
lpr
(1),
pr
(1),
lprm
(1),
lpq
(1), and
lpstat
(1)
-
Describe the commands used to print files.
See the
Command and Shell User's Guide
for
information on using these commands.
lptest
(8)
- Describes the printer test pattern utility.
services
(4)
- Describes the format of the
/etc/services
file where services defined for TCP/IP printing are
defined.
Online Help - The
printconfig
graphical
user interface has an online help volume that explains how to use the interface
and the
lprsetup
utility has command-line help.
The following system files contain printer configuration information.
Note that some files, such as
/usr/spool
, are defaults
or UNIX conventions.
You can use your own preferred file names and locations.
The
/etc/printcap
file contains the data
on configured printers.
The
/etc/lprsetup.dat
file contains the
configuration data for all supported (known) printers.
This information is
transferred to the
/etc/printcap
file when a printer is
installed and configured for use.
The
/usr/lbin
directory contains the print
filters for each known printer device.
These filters are specified during
printer installation, for example
/usr/lbin/ln09of
is the
filter for the DEClaser 5100.
Filter file names contain the following data:
The printer identifier (ID) string
The
/etc/printcap
code
of
A string to determine any variant information, such as
_isolatin1
The
/usr/spool
directory is the default
directory where print jobs are stored temporarily during printing.
The spool
queue is identified by the
sd
entry for a device in the
/etc/printcap
The
/usr/spool/lpd
directory is the CDSL
in which
lpd.lock
is stored for each member of a cluster.
On a cluster, spool directories must be shared, and are always located under
/usr/spool
.
The
/usr/adm/lpd*err
files is the default
directory where error log files for each installed printer.
These are only
created if error logging is enabled.
The
/var/adm
directory contains printer
accounting files when accounting is enabled.
These files have a file name
format of
/var/adm/<printer>acct_sum
, where
<printer>
is the name that you assign to the printer during installation.
The
/usr/lbin/lpd
file is the line printer
daemon.
Configuration files are located in the
/usr/spool/*
(or
/var/spool/*
) directory.
The
/dev
directory contains the local UNIX
socket
/dev/printer
.
This socket is created by
the
lpd
daemon and exists for as long as the parent
lpd
is running.
The following utilities are also available for use in your printer environment:
The
lpc
line printer control utility enables
you to manage print queues and control access to printers.
See the
lpc
(8)
reference page for information.
The
pac
utility formats the data from printer
accounting log files and displays it or stores it in a text file.
See the
pac
(8)
reference page.
See also the
acct
(8)
reference page for information on
accounting.
CDE Application Manager -- Desktop Apps contains the Print Manager graphical user interface, which enables you to perform the following tasks. Refer to the online help for information on how to use these graphical interfaces.
Manage print queues
Control access to printers
Customize your view of printer data
These features are similar to features offered by the
lpc
utility and the
lpq
or
lpstat
commands, which you can run from the command line in a terminal.
The Print Screen utility is also located in the Desktop Apps, if this utility has been installed.
The printer icon on the CDE front panel allows you to select
printers and manage print queues locally.
You can also run
printconfig
from CDE Application Manager - Configuration, in addition
to invoking it from SysMan Menu or the SysMan Station.
The latter
user environments you to use graphical tools remotely or from a different
workstation such as a PC or another UNIX system.
Consult the CDE documentation
for information on setting environment variables such as
LPDEST
to assign system default printers in CDE environments.
The following sections describe the information you need in order to
use the
printconfig
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.
A good strategy for avoiding installation
problems is to accept the default data presented by the configuration utility.
Once you have the printer working, you can read about the advanced options
and use the same utility to tune your configuration as required.
You must have the Printer Support Environment subset installed. To see if you have this subset installed, enter:
#
setld -i | grep OSFPRINT
If the
OSFPRINT
subset is installed, the following information
is displayed:
OSFPRINT500 installed Local Printer Support (Printing Environment)
If the OSFPRINT subset is not installed, see the
Installation Guide
for
information on adding this, or any, subset with the
setld
utility.
8.2.1 Gathering Information
Before adding a printer, you need to gather the information about the
printer that you will need to enter when using the
lprsetup
or
printconfig
utilities.
The information required will
depend on whether the printer is remote, a direct connection, or a network
connection via LAT or TCP/IP:
If your system is part of a network, you may need to consult your local
network administrator or consult the
Network Administration
guide for information
required when adding or accessing a network printer.
8.2.1.1 Direct and Network Printers
The following list identifies the information you need when installing a direct connection, or a network connection via LAT or TCP/IP.
Available Printer Types (supported printers) -- This
can be determined from the
lprsetup.dat
(8)
reference page or by viewing the
/etc/lprsetup.dat
file if you have added third party printers.
Usually,
the name embossed on the printer is similar, such as LN03, however the printer
type for the DECLaser 5100 is
ln09
.
The
printconfig
utility displays a list of supported devices, including PC printer
options if ASU is installed.
Printer Aliases (alternative names) -- You can assign
one or more aliases for the printer.
An alias is a name that you can use with
printer commands.
For example, if your local system is named
alfie2
, you can assign that as an alias and use that name when printing
files as follows:
#
lpr -Palfie2 prt_accounting.txt
Connection type - This will depend on how the printer is connected to your system. It can be:
Direct - Connected to a port at the rear of the system box
LAT - Connected as a Local Area Transport port or service. (See the Network Administration guide for more information.)
TCP - A networked print server device.
Device Pathname -- This depends on the Connection type:
If the connection type is direct, this entry specifies the
device file name in the
/dev
directory.
For example, if
you connected the printer cable to the 9-pin socket labeled 1 or COMM1,
the corresponding device special file is
/dev/tty00
.
If the connection type is LAT,
printconfig
will supply a default
/dev/lat
port or service name, LAT
server node name, or LAT port name.
(See the
Network Administration
guide for more
information.)
If the connection type is TCP, you need the TCP address, which can be in one of two formats. The owner's manual of the printer will specify the assigned port number for the printer device (a numerical string, such as 12345). The other part of the address is the host name or TCP/IP address:
@node/port
-- The printer host (or
node) name followed by either the port number such as 2501 for an LN17ps,
or the service name defined for this port in the
/etc/services
file.
If no service name is defined, you must use the port number.
For example
@alfie.nic.ccc.com/ln17port
maps to the entry
ln17port
2501/tcp
in
/etc/services
.
The entry
@alfie.nic.ccc.com/2501
directly specifies a port number, and no
service entry in
/etc/services
is required.
@tcp_address/port
-- The TCP/IP address
in
nnn.nnn.nnn.nnn
format, followed by the port number
(such as 2501 for an LN17ps) or the service name defined in
/etc/services
.
For example
@123.321.123.321/2501
.
Advanced Options -- Most of these options are not required to complete a basic installation and you can accept the defaults. However, the owner's manual for your printer may state requirements for certain settings, such as the communications baud rate. Communications rates can depend on features such as the length and type of printer cable that you chose for the installation.
The advanced options are set as symbols in the file
/etc/printcap
and the
printcap
(4)
reference page contains a definitive list of
supported symbols and values.
When using
printconfig
, the
online help provides a description of the symbols.
Note that this screen scrolls down to list all available options and also contains default entries, which you can override if required.
The most commonly used options are:
Accounting file name -- If you want to use printer accounting to track print consumables, you should choose the default (or enter your preference).
stty baud rate (hard-wired ports only) -- If your printer specifies communication rate requirements you can enter it here. Note that the default rate can sometimes be increased to improve printer throughput.
Restrictions on use -- If you want to control the volume and quantity of print jobs, set the restrictions here.
Default page layouts -- If you want default vaues for certain page layout characteristics, set the characteristics here. Supported layouts may depend on printer restrictions and capabilities. Consult the owner's manual for the printer.
Destination directories and files -- If you want certain directory and file locations for print spooling or for error output, you can specify the locations here.
The following is a list of the information you need when installing a remote printer:
Printer aliases (alternative names) -You can assign
one or more aliases for the printer.
An alias is a name that you can use with
printer commands.
For example, if the remote system is named
alfabet
, you can assign that name as an alias and use that name when printing
files as follows:
#
lpr -Palfabet prt_accounting.txt
Remote machine name - The host name for the remote system,
such as
alfabet.ccc.nic.com
Remote printer name - The name of the printer on remote
system, such as
lp0
, or a valid alias.
Advanced options - These options are not required for a basic installation. Remote printing allows only a small number of advanced options to be configured (or deconfigured, such as error logging) . See the information in Section 8.2.1.1. Note that most advanced options are not passed on to the remote system.
8.2.1.3 Printer Data Worksheet
You can photocopy the following table and use it as a worksheet.
Name / Format | Example/ Location | ||
Printer Type | ln09 (lprsetup.dat) | ||
(Alphanumeric string) | |||
Alias | alfie2 (User-supplied) | ||
(Alphanumeric string) | |||
Connection type | TCP (Interface-supplied) | ||
(software option) | |||
Device pathname, direct connection) | /dev/tty00
(
ports (8)) |
||
(file name) | |||
Device pathname (Remote Connection) | 556 (lat
reference page) |
||
(port or service name) | |||
Device pathname, network connection | @alfie.nic.ccc.com/2501 (Printer Documentation,
/etc/services
file) |
||
(host/service name) | |||
Remote machine name | alfabet.ccc.nic.com
(Network Administrator) |
||
(host name) | |||
Remote printer name | lp0 (remote host printer configuration) | ||
(printer name) | |||
8.2.2 Installing a Local Printer
This section describes how to install a printer using
printconfig
utility.
The example given is a DEClaser 5100 printer installed
locally using the graphical interface.
It assumes that you have made all the
physical connections and gathered the required information.
You can also use
printconfig
to modify a printer configuration or remove a printer.
These other tasks are described in
Section 8.3.
Note
Do not use
printconfig
if you are modifying an/etc/printcap
file on a system running Version 3.2 or older. There are incompatabilities in older/etc/printcap
files that may causeprintconfig
to corrupt the file. Uselprsetup
instead.
A typical installation of a printer (after the hardware is installed) takes about ten to fifteen minutes, including time required to gather the data.
The recommended action is to accept the default values for an initial
printer installation so that the basic installation and verification can be
accomplished quickly.
You can then use
printconfig
to modify
the configuration later if required.
Invoke
printconfig
from CDE, or from the command
line, as described in the
printconfig
(8)
reference page.
You must have superuser privileges to run
printconfig
utility.
Depending on the type of printer you are adding and the information
you provide, the utility might do the following:
Create, or edit the existing
/etc/printcap
file
Create a spooling directory
Create an error log file
Create an accounting file
Create the device special files
Prompt you to modify previously selected symbols
When you run the
printconfig
utility, the
first display is the main window titled Printer Configuration on
host name.
In this window you select the printer type using the
data you have already gathered as described in
Section 8.2.1:
Select
ln09
Choose the Configure option
Because this is not a remote printer, the next window is Printer
Config: Local Printer Settings.
The next available Printer name will be displayed
(lp0
if this is the first printer that you are configuring
on this system).
In this window you enter:
The printer alias names, such as the name of the local host
or perhaps something to help users to identify the printer type, such as
local_DL5100
.
The connection type.
Because you have connected the cable
to a local serial port such as
COMM1
, you will choose the
Direct option.
Finally, you need to specify the Device pathname, which will
be the special device file that maps to the serial port.
The device file
/dev/tty00
maps to the
COMM1
port.
Choose Commit to write the options to the
/etc/printcap
file.
For a basic printer configuration, that is all you need to do. If you decide to use advanced options, such as setting print job limits, choose the Advanced option to display the "Printer Config: Local Printer Settings: Advanced" window. See Section 8.4.
After commiting the configuration, you are returned to the Configuration on host name window, and the printer now appears in the list of configured printers. Use the Test option to print a test page to the printer. If you do not get any output, review the data carefully and refer to the troubleshooting section. See Section 8.6.
The remaining option on the window Configuration on host name is Make Default, which enables you to choose any configured printer as the default printer for this system. This means that any print job that has no specified print queue will default to this printer. Generally, you would choose a high-speed low-cost draft printer as the default on a multiuser system, in case users choose to print large text files.
Select the required printer and choose Make Default. The current default printer is displayed in the field labeled Default Printer.
Your printer is now ready for use.
Test the printer capabilites with
appropriate files, such as PostScript or color graphics files.
Check the printer
utilities described in
Section 8.1.5
to ensure that you
can verify printer and queue status.
8.2.3 Setting Up Remote Printers
A remote printer refers to a printer that is already directly connected
to a remote host.
Remote printers may also be directly connected to the network,
but their network cards emulate the remote
lpd
protocol,
so they appear as remote hosts with a printer attached.
You configure your local print queue so that print jobs are sent to
the remote host via the network.
These jobs are then printed on the remote
host.
If you are setting up a remote printer from a remote machine, the local
machine (the client) must be listed in the
hosts.lpd
file
or
hosts.equiv
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:
#
setld -i | grep OSFLAT
See the Network Administration guide for information on how to enable remote LAT terminal server printing.
Refer to section
Section 8.2.1
for information on the
data that you need to gather before performing this task, then invoke
printconfig
as described in
Section 8.2.2
(the
remote queue is the same queue as the example created in that section).
The
following example describes how to use
printconfig
to create
some remote print configurations:
Select
remote
Choose the Configure option
Because this is a remote printer, the next window is Printer
Config: Remote Printer Settings.
The next available printer name will be displayed
(lp0
if this is the first printer that you are configuring
on this system).
Enter the following:
The printer alias names, such as the name of the remote host
and printer type, such as
alphie_ln09
.
The remote machine name.
For example, in
Section 8.2.2
a queue was created on the system named
alphie.ccc.nic.com
.
The remote printer name.
For example in
Section 8.2.2,
a printer
lp0
was added to the system.
Choose Commit to write the options to the
/etc/printcap
file.
For a basic printer configuration, that is all you need to do. If you decide to use advanced options, such as setting print job limits, choose the Advanced option to display the "Printer Config: Local Printer Settings: Advanced" window. Because the printer is remotely configured, you can only specify a small number of advanced options that affect local processing, such as the local error log file and spooling directory.
After commiting the configuration, you are returned to the Configuration
on
host name
window, and the printer now appears in the
list of configured printers.
Use the Test option to print a test page to the
printer.
If you do not get any output, review the data carefully and refer
to the troubleshooting section.
8.2.4 Setting Up TCP/IP Printing Using printconfig
TCP/IP printing allows you to submit print jobs to a remote printer that is directly connected to the network as a host device. Reference information on TCP/IP printing is located in Section 8.4.11. Gather the information as described in Section 8.2.
Invoke
printconfig
as described in the preceding
sections.
The first display is the main window titled Printer Configuration
on
host name.
In this window you use the data you have
gathered to select the printer type, for example:
Select
ln17ps
Choose the Configure option
Because this is not a remote printer, the next window is Printer Config:
Local Printer Settings.
The next available Printer name will be displayed,
such as
lp4
.
Complete the fields as follows:
The printer alias names, such as the name of the local host
or perhaps something to help users to identify the printer type and physical
location, such as
ln17_office23
.
This value can also be specified as
@
nodename/servicename, where
servicename
is defined in
/etc/services
and
associated with the printer's TCP/IP port.
The connection type, this will be TCP.
Finally, you need to specify the device pathname as a port
number or service, which in this case will be the network address of the printer,
such as
@alfie.nic.ccc.com/2501
or
@123.321.123.321/2501
.
Choose Commit to write the options to the
/etc/printcap
file.
For a basic TCP/IP printer configuration, that is all you need to do. If you decide to use advanced options, such as setting print job limits, choose the Advanced option to display the "Printer Config: Local Printer Settings: Advanced" window.
After commiting the configuration, you are returned to the Configuration on host name window, and the printer now appears in the list of configured printers. Use the Test option to print a test page to the printer. If you do not get any output, review the data carefully and refer to the troubleshooting section.
The remaining option on the window Configuration on host name is Make Default, which enables you to choose any configured printer as the default printer for this system. This means that any print job that has no specified print queue will default to this printer. Generally, you would choose a high-speed low-cost draft printer as the default on a multiuser system, in case users choose to print large text files.
Select the required printer and choose Make Default.
The current default
printer is displayed in the field labeled Default Printer.
8.2.5 PC Print Queues Under ASU
If the Advanced Server for UNIX (ASU) is installed and running, you
can configure client PC printer queues.
ASU also offers features for configuring
and managing print queues.
Refer to the
Installation and Administration Guide
for more information
on using ASU.
You must have at least one printer configured in your
/etc/printcap
file before you can create a printer share queue for
PC clients.
Invoke
printconfig
from the CDE Application Manager --
Configuration window, or from the command line, as described in the
printconfig
(8)
reference page.
When you invoke
printconfig
under ASU,
an available printer type is the
Advanced_Server_Shared_Printer_Queue
.
Choose this option and the next window displayed is titled
"Printer Config: Advanced Server Shared Print Queue Setting".
There
are only three options on this window:
Advanced Server shared print queue name - Enter a queue
name such as
psq1
Printer devices - Enter a comma-separated list of device
names such as:
lp0,lp2
Comment - Enter any comments or notes on queue use and restrictions.
Press OK to create the queue and return to the
printconfig
main window.
The new queue will be displayed.
To test the status of the queue, use the following ASU command and check the output for the queue name as shown in the example:
#
net share
. . . Share name Resource Remark ---------- ------------------ ------------------------ psq1 lp0, lp2 Spooled
Note that you may need to
perform other ASU tasks to make the queue available to PC systems.
Consult
the ASU doumentation for more information.
8.2.6 Using lprsetup to Install a Printer
This section describes how to install a printer locally (directly connected
to your computer) using the
lprsetup
utility.
You can
also use
lprsetup
to modify a printer's configuration or
remove a printer.
These other tasks are described in
Section 8.3.
The recommended action is to accept the default values for an initial printer installation.
The printer described in the following example is an LN03R.
You can run
lprsetup
by entering
/usr/sbin/lprsetup
at the command prompt in a terminal window.
You must have superuser privileges to run
lprsetup
.
Depending
on the type of printer you are adding and the information you provide, you
can use
lprsetup
to:
Create, or edit the existing
/etc/printcap
file
Create a spooling directory
Create an error log file
Create an accounting file
Create the device special files
Prompt you to modify previously selected symbols
When you run the
lprsetup
script, the first
display is the main menu:
#
/usr/sbin/lprsetup
Compaq Tru64 UNIX Printer Setup Program Command < add modify delete exit view quit help >:
The
lprsetup
command options are described in
Table 8-1.
Table 8-1: lprsetup Options
Command | Description |
add |
Adds a printer |
modify |
Modifies an existing printer's characteristics |
delete |
Removes an existing printer from your configuration |
exit |
Exits from the
lprsetup
program |
view |
Displays the current
/etc/printcap
file entry for the printer you are configuring |
quit |
Exits from the
lprsetup
program |
help |
Displays online help about the
lprsetup
program |
You can abbreviate any command option with its initial letter.
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.
Note
Some of the symbols displayed in the
lprsetup
script are not supported by the operating system. Refer to theprintcap
(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.
Note that
some tables have been truncated to shorten the example:
#
/usr/sbin/lprsetup
Compaq Tru64 UNIX Printer Setup ProgramCommand < add modify delete exit view quit help >:
add
Adding printer entry, type '?' for help.Enter printer name to add [1] :
[Return]
For more information on the specific printer types enter `printer?' Enter the FULL name of one of the following printer types: DEClaser1100 (ln07) escp_a4_12cpi hp6l_a4 la400 lg12 ln17_a4 DEClaser1150 (ln07r) fx1050 hpIIID la424 lg12plus ln17ps DEClaser1152_I18N fx80 hpIIIP la50 lg14plus ln17ps_a4 DEClaser2100 (ln05) generic_ansi hpIIP la600 lg31 ln20 DEClaser2150 (ln05r) generic_ansi_a4 hpIV la70 lgl04plus ln20_a4 DEClaser2200 (ln06) generic_text ibmpro la75 lgl05plus ln40 DEClaser2250 (ln06r) generic_text_a4 la100 la84 lgl08plus ln40_a4 DEClaser2300 (ln05ja) hp1120c la120 la86 lgl09plus ln82r DEClaser2400 (ln10ja) hp1120c_a4 la210 la88 lj250 lnc02 DEClaser3200 (ln08) hp4000tn la280 la88c lj252 lnc02_a4 DEClaser3250 (ln08r) hp4000tn_a4 la30n la90 ln03 nec290 DEClaser3500 (ln14) hp4mplus la30n_a4 lf01r ln03ja ps_level1 DEClaser5100 (ln09) hp4mplus_a4 la30w lg02 ln03r ps_level2 DEClaser5100_I18N hp5simx la30w_a4 lg04plus ln03s remote cp382d hp5simx_a4 la324 lg05plus ln15 unknown dl510ka hp680c la380 lg06 ln15_a4 wwpsof ep1050+ hp680c_a4 la380cb lg08plus ln17 xf escp_a4_10cpi hp6l la380k lg09plusor 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/lpd/lp1acct]?
[Return]
Set spooler directory 'sd' [/usr/spool/lpd/lpd1] ?
[Return]
Set printer error log file 'lf' [/usr/adm/lpd/lp1err] ?
[Return]
Set printer connection type 'ct' [dev] ?
[Return]
Set printer baud rate 'br' [4800] ?
9600
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
printcap
(4)
reference page 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 XfEnter symbol name:
q
Printer #1 ---------- Symbol type value ------ ---- ----- af STR /usr/adm/lpd/lp1acct br INT 9600 ct STR dev fc INT 0177777 fs INT 03 if STR /usr/lbin/ln03rof lf STR /usr/adm/lpd/lp1err 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/lpd1 xc INT 0177777 xf STR /usr/lbin/xf xs INT 044000Are these the final values for printer 0 ? [y]
y
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 number sign (#) prompt, enter your comment.
Press
[Return]
at the number sign (#) prompt to exit.
The comments will be insert
directly above the
printcap
entry in the
/etc/printcap
file.
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 >:
exit
Refer to the
lprsetup
(8)
reference page for more information on options.
8.2.6.1 Print Symbols for Advanced Printing Services
When setting up Advanced Printing Software, you should set the following print symbols:
rm
- Specify
@dpa
to indicate that jobs submitted to this printer should be directed to the
Advanced Printing Software inbound gateway.
The inbound gateway submits the
job to an Advanced Printing Software spooler.
rp
- Specify the name of the Advanced
Printing Software logical printer.
Refer to the
Advanced Printing
administration documentation
for more information.
8.3 Routine Print System Maintenance
The first part of this chapter showed you how to set up the first printer
on a system.
The following sections describe the routine administrative tasks
for a print system that is already set up.
You can use the
printconfig
and the X11-compliant (CDE) or command line tools to perform
these tasks.
The tasks described in the following sections are:
Adding additional new printers to the system
Modifying characteristics of existing printers
Removing printers from the system
Enabling printer accounting
Controlling printer operations by using the CDE tools or the
lpc
command
Note that if you manually remove printers from the
/etc/printcap
file, you also have to manually remove spooling, accounting,
and error directories and files.
8.3.1 Adding Printers
Once you have one printer set up, you can add other local, remote and networked printers at any time. Gather the information about each printer as described in Section 8.2
You can add printers by running
printconfig
, or
you can add printers manually by performing the following steps:
If it does not already exist, create a printer spooling directory. Refer to Section 8.4.2.6.2.
Modify the
/etc/printcap
file and edit
it to include a description of the printer using the configuration data from
/etc/lprsetup.dat
.
Refer to
Section 8.4.1.
Create an accounting file and a log file and enable printer accounting. Refer to Section 8.3.5. Protection and ownership of this file must be set appropriately.
Ensure that the
/etc/inittab
file does not invoke
the
getty
process on serial lines that have printers attached.
If you use
printconfig
, this is done for you.
8.3.2 Modifying Printers
To modify a printer's configuration, run
printconfig
and choose the configured printer.
Then choose Modify to display the Settings
window.
If you change the name of the spooling directory, the accounting file,
or the error log file,
printconfig
prompts 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 printer entry.
Refer to
Section 8.4.1
and to the
printcap
(4)
reference page for information about the
/etc/printcap
file symbols.
8.3.3 Removing Printers
To remove a printer, run the
printconfig
utility
and choose the printer that you want to delete, then choose Deconfigure.
You
are then prompted for confirmation that you want to delete the error log file
and the accounting file because these files may be shared by more than one
printer.
If you do have shared files, do not delete them.
If you have included comments for the printer in the first line of its
/etc/printcap
file entry, note that the command line
lprsetup
utility does not delete the comments when you remove a
printer.
You can edit the
/etc/printcap
file and delete
the comments.
To manually remove a printer, edit the
/etc/printcap
file and delete the entry that relates to the printer.
You must also manually
delete the accounting and log file and the spooling directory if no longer
required.
You can also use
lpc
and the CDE print mangement
tools to temporarily control access to printers and queues.
See
Section 8.3.4.
8.3.4 Controlling Local Print Jobs and Queues
To manage the flow of print jobs and the contents of local print queues,
you can use the
lpc
command-line utility.
If CDE is your local user environment, you can also manage print jobs using the Print Manager located in the CDE Application Manager - Desktop Apps folder. Refer to the online help for information on how to use these graphical interfaces and to the Common Desktop Environment: User's Guide and Common Desktop Environment: Advanced User's and System Administrator's Guide.
You can use the
lpc
command to:
Enable and disable printers and spooling queues
Change the order of queued jobs
Display the status of the printer, queue, and daemon
Some
lpc
commands, for example, the
disable
command, require you to be superuser.
Note
You can use the
lpc
command only to manage print queues that are local to your system. Although a remote printer has both a local queue and a remote queue, thelpc
command manages only the local queue.
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 8-2.
Table 8-2: lpc Command Arguments
lpc Argument | Description |
help
[argument] |
Prints a one-line description of the specified
lpc
command argument.
If an
argument
variable is not specified, the list of arguments is displayed. |
?
[argument] |
Same as the
help
argument. |
abort |
Terminates an active
lpd
daemon and then disables printing.
This prevents the
lpr
or
lp
command from starting a new
lpd
daemon. |
clean |
Removes any temporary files, data files, and control files that cannot be printed (for example, files that do not form a complete printer job) from the specified print spooling directory. |
disable |
Turns off the specified print spooling queue.
This prevents the
lpr
or
lp
command
from entering new jobs in the queue. |
down
message... |
Turns off the specified print queue, disables
printing, and enters the specified message in the printer status file.
The
message does not need to be quoted because remaining arguments are treated
the same as
echo .
You can use the
down
argument to take down a printer and inform users.
If a printer is down, the
lpq
command indicates that the printer is down. |
enable |
Enables spooling for the specified printers.
This enables the
lpr
or the
lp
command
to enter print jobs in the spooling queue. |
exit |
Exits from
lpc . |
quit |
Exits from
lpc . |
restart |
Attempts to start a new
lpd
daemon for the specified printer.
This argument is useful if some abnormal
condition causes the daemon to terminate unexpectedly and leave jobs in the
queue.
If this occurs, the
lpq
command indicates that
no daemon is present.
If a daemon is hung, you must first kill the process
and then restart the daemon by using the
restart
argument. |
start |
Enables printing and starts a spooling daemon for the specified printer. |
status
[printer] |
Displays the status of the specified printer
daemon and queue.
The
status
argument shows if the queue
is enabled, if printing is enabled, the number of entries in the queue, and
the status of the printer's
lpd
daemon.
If a printer name
is not supplied, information about all printer daemons and queues is displayed. |
stop |
Stops a spooling daemon after the current job is complete and disables printing. |
topq
printer |
Puts print jobs in the queue in the specified order. You can specify the print jobs by also specifying a request_ID variable or a username variable. |
up |
Enables all printing and starts a new printer
daemon.
Cancels the
down
argument. |
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.
8.3.5 Enabling Printer Accounting
Printer accounting allows you to charge users for printing services and to determine the amount of printer usage.
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.
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
lprsetup
to add a printer, it creates
the accounting file you specify.
The
/usr/adm/lpd/lpacct
file is the default accounting file.
The
printconfig
utility provides default accounting
files in the Advanced Options.
If you do not require accounting, you can remove
these entries during printer configuration or at any later date using the
Modify option.
If you add a printer manually, you must create the accounting
file.
Note
The
/var/adm/lpd
directory should be owned by useradm
and belong to groupadm
. The printer accounting files should have protection mode 644, be owned by useradm
, and belong to groupsystem
.
In the printer's
/etc/printcap
entry, 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
utility 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
printconfig
utility to specify the printer accounting
file.
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
printconfig
utility will suggest a default print filter.
Two print
filter symbols,
if
and
of
, are needed
for accounting.
For example:
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.
Accounting files must be owned by the print daemon. If you specify an accounting file, intermediate directories are automatically created as needed.
Note
Printer accounting does not work for PostScript files.
The following sections contain information about the data required for
printer configuration, line printer daemon,
lpd
, and the
system files that are required for print system operations.
These files are
created automatically if you use
printconfig
, as described
in
Section 8.2.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.
8.4.1 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 two-letter abbreviations
called print symbols.
The print symbols are described in this section and
in the
printcap
(4)
reference page.
The
lprsetup
utility modifies
the
/etc/printcap
file.
The following example shows an
/etc/printcap
entry
for both a local printer and a remote printer.
The callouts describe the symbol
entries:
# # 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] #
Specifies a symbol with alphabetic characters. [Return to example]
Specifies a symbol that represents a Boolean expression. [Return to example]
Specifies a symbol with a numeric value. [Return to example]
Specifies an entry for a
remote printer.
The
lp
,
rm
,
rp
, and
sd
symbols are required for remote printers
for which you are a client.
[Return to example]
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 (:).
Note
A local printer entry in the
/etc/printcap
file should have the default printer reference namelp0
so that print jobs can have a destination when printer reference names are not specified in print commands.
The remaining lines of each printer entry contain the descriptive symbols and values that define the printer's configuration. Symbols are two-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 (:).
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.
The
printcap
(4)
reference page lists the
printcap
symbol names, the type of values they accept, default values, and descriptions
of the symbols.
8.4.2 Data in /etc/printcap
The following information is typically required for a printer entry
in the
/etc/printcap
file.
8.4.2.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
utility 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
utility always
assigns at least two printer synonyms.
The default number
N
is one synonym.
The string
lp
plus the default number (lp
N) is the other system-assigned synonym.
If the default number is 1, the two assigned names will be
1
and
lp1
.
Jobs would then be queued to this printer using
either of the the following commands:
#
lpr -P1
#
lpr -Plp1
You can also assign your own synonyms and use them to direct jobs to printers.
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 printer that will always be used.
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.
8.4.2.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
utility,
printers are listed by type and only those supported by Compaq are
listed.
These printers have some default values already included in the setup
utility.
The supported printer types are defined in
/etc/lprsetup.dat
and described in the
lprsetup.dat
(4)
reference page.
You can set up unlisted printers by using
unknown
and then responding to the prompts, using values similar to those for supported
printers.
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.
8.4.2.3 Printer Synonyms
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.
In command-line mode, 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:
$
lpr -Pdraft files
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
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.
On most systems, the device names map to default physical
ports (connectors) as shown in
Table 8-3.
Table 8-3: Communication Ports and Printer Device Special Files
Device Special File | Communication Type | Connector Label |
/dev/lp0 |
parallel | printer, or lp |
/dev/tty00 |
serial | COMM1 or 1 |
/dev/tty01 |
serial | COMM2 or 2 |
Note that if only one 9-pin serial connector is provided on a system, it may not be labeled as such. Some systems also use graphical icons instead of labels. Refer to the owners manual for the system for more information.
When you use
lprsetup
, the utility 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, specify a null argument with the
lp
symbol, or a node and port for TCP/IP, as in the following examples:
lp= lp=@<node/port>
Note
If the port is used for logins, the
lprsetup
script turns off the terminal line established by thegetty
process so the terminal line can be used for a printer.
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:
dev
for local devices
lat
for LAT devices (must be specified
in lowercase)
tcp
for TCP/IP devices (must be specified
in lowercase)
In
/etc/printcap
, 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.
When the spooling directory is created with
printconfig
,
intermediate directories are created as necessary.
Each printer must have its own spooling directory located under the
/usr/spool
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.
If you are using
lprsetup
, the utility 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/
.
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:
sd=/usr/spool/lpd2/purple
Spooling directories must have the same parent directory name, which
is normally
/usr/spool/lpd
.
You can specify alternative
locations if required when configuring printers.
8.4.2.6.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
/var/spool/lpd/lpd.lock
file contains the process identifier of the parent
lpd
process that listens for print jobs request on the local
/dev/printer
socket and the network socket 515.
The processes that
actually print the jobs are child daemons forked by the parent.
Their process
identifiers are stored in the
lock
file in the spool directory,
such as
/usr/spool/purple/lock
.
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
.
Two additional temporary files may appear in the spooling
directory:
The file
.no_daemon
is created when the
queue has entries and no daemon is running and no files in the spooling directory
have been removed or changed in the past ten seconds.
The file
.daemon_running
is created by
a running daemon before it has done its first check for jobs to print.
As
long as this file exists, the currently running daemon will do at least one
more check for queued jobs before deciding there are no more jobs to print.
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 control
files whose names begin with
cf
.
Control files specify
the names of user files to be printed and contain printing instructions for
the files.
Each line in a control 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
lpd
(8)
reference page.
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:
#
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
8.4.2.6.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
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.
You specify a baud rate only for serial printers that are local (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.
8.4.3 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:
Handles printer
spooling conjunction with the
lpr
and
lprm
commands.
Spooling is the mechanism
by which a file is placed in a queue until the printer can print the file.
Scans the
/etc/printcap
file to determine
printer characteristics.
Uses specific print filters for print requests. Print filters translate an input format into a printer-specific output format.
After a system reboot, prints any files that were not printed when the system stopped operating.
When you use the
lpr
command, it copies
files into the spooling directory and activates the
lpd
daemon.
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 after it sends the job to the printer.
After you install and boot your system, the
lpd
daemon
is usually started by the
/sbin/init.d/lpd
utility.
You
can start and stop the
lpd
daemon with the following commands:
/usr/lbin/lpd
[-l
]
/sbin/inetd/lpd
[-start
]
/sbin/inetd/lpd
[-stop
]
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:
#
ps agx |grep /usr/sbin/lpd
Errors logged by the
lpd
daemon are logged to
/var/adm/syslog.dated/
<date>/lpr.log
(or
/var/adm/syslog.dated/current/lpr.log
, which is a symbolic link to the most recent log file).
The directory
<date>
is named for the date and time that the logs were saved.
A typical log file entry is as follows:
Apr 15 16:36:28 cymro lpd[1144]: ERROR -- lpr: cannot open printer description file Apr 15 16:36:28 cymro lpd[1144]: ERROR -- exiting ... Apr 15 16:36:46 cymro lpd[1130]: ERROR -- lpq: cannot open printer description file Apr 15 16:36:46 cymro lpd[1130]: ERROR -- exiting ... #
Log files should be monitored regularly for errors and should also
be regularly deleted to prevent the files from filling up the available disk
space.
You can establish a regular clean up procedure using the
cron
utility.
You can also control the volume of entries that are
posted to
lpr.log
by specifying only the required priorities
in the file
/etc/syslog.conf
.
See the
syslogd
(8)
reference page
for instructions.
The
lf
parameter specifies the log file where most
print filter 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.
When the error log file is created
using
printconfig
, intermediate directories in the pathname
are created as necessary.
The
lpd
daemon logs most
of its printer errors to the error log file rather than the error file specified
by the
lf
parameter.
Therefore, specifying an error log
file is optional.
If you used
lprsetup
to install the printer,
the utility provides the default value
/usr/adm/lpd/lperr
.
If you do not specify an error log file, errors are logged to
/dev/console
.
The error log file is specified with the
lf
symbol in the
/etc/printcap
file.
For example:
lf=/var/adm/lpd/lpderr
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.
8.4.5 Line Printer Daemon Filter Directory
The filters for the
lpd
daemon translate the
data that you want to print into the format appropriate for your printer.
You must specify the filter that matches each printer on your system.
For
example, to print files with the LN03R printer, you would use the
ln03rof
filter.
Input filters process job data being sent to the printer.
Output filters
process banner page data generated by the
lpd
.
Many filters may be specified as either input or output filters,
and will operate differently depending on whether they are called as input
or output filters.
These filters are specified in the
/etc/printcap
file as follows:
if=/usr/lbin/ln03rof of=/usr/lbin/ln03rof
Input filters are also responsible for printer accounting, which enables you to keep a record of printer usage for text jobs (not for PostScript printing). For information on configuring printer accounting refer to Chapter 10.
Refer to the
lpd
(8)
reference page for more information on using
filter capabilities.
The
lprsetup.dat
(4)
reference page lists the available print filters
located in the
/usr/lbin
directory.
For printers not listed
in the reference page, consult the documentation or refer to the printer manufacturer
for filter information.
8.4.5.1 General Purpose Print Filter
The
pcfof
print filter is designed to accommodate
many different printers through the use of a printer control file (PCF).
PCF
files contain printer control strings to set up and select printer-specific
features such as paper tray selection, duplexing, and printing orientation.
The filter is designed to work with text, ANSI, PCL, and auto-sensing multilanguage
PostScript printers, but will not work with PostScript-only printers.
PCF files are text files. You can use any text editor to modify an existing file to customize printing behavior or create a new file for an unsupported printer. Note that PCF files provided in Tru64 UNIX are replaced during an installation update, so you should take care that you preserve any customizations in backups. Using a file name prefix for new or modified PCF files will prevent potential file name conflicts. For example, copy file names before customizing as follows:
#
cp ln17.pcf my_ln17.pcf
The print filter is located
in
/usr/lbin
and the PCF printer specific files are in
/usr/lbin/pcf
.
The file
template.pcf
provides
documentation on the PCF file format.
8.4.6 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.
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.
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:
fc#0177777 fs#0141
In this example, example,
fc#0177777
clears
all bits and the
fs
symbol is set to
0141
specifying the
OPOST
,
ONLRET
, and
OFILL
flag bits.
Table 8-4
lists each flag bit name, its octal
value, and its description.
Table 8-4: Flag Bits
Flag | Octal Value | Description |
OPOST | 0000001 | Enable output processing |
ONLCR | 0000002 | Map NL to CR-NL |
OLCUC | 0000004 | Map lower case to upper case |
OCRNL | 0000010 | Map CR to NL |
ONOCR | 0000020 | No CR output at column 0 |
ONLRET | 0000040 | NL performs CR function |
OFILL | 0000100 | Use fill characters for delay |
OFDEL | 0000200 | Fill is DEL, else NUL |
NLDLY | 0001400 | Newline delay |
NL0 | 0000000 | |
NL1 | 0000400 | |
NL2 | 0001000 | |
NL3 | 0001400 | |
TABDLY | 0006000 | Horizontal tab delay |
TAB0 | 0000000 | |
TAB1 | 0002000 | |
TAB2 | 0004000 | |
TAB4 | 0006000 | |
CRDLY | 0030000 | Carriage Return delay |
CR0 | 0000000 | |
CR1 | 0010000 | |
CR2 | 0020000 | |
CR3 | 0030000 | |
FFDLY | 0040000 | Form feed delay |
FF0 | 0000000 | |
FF1 | 0040000 | |
BSDLY | 0100000 | Backspace delay |
BS0 | 0000000 | |
BS1 | 0100000 | |
OXTABS | 1000000 | Expand tabs to spaces |
Refer to the
tty
(7)
reference page for detailed information on flag
bits.
8.4.7 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.
Refer to the
tty
(7)
reference page for a detailed description of
the status bits.
The following is an example of mode bits specifications:
xc#0177777 xs#044000
As shown in the previous example,
xc#0177777
clears all bits and the
xs
symbol is set to
044000
specifying the
ECHO
and
ECHOCTL
mode bits.
Table 8-5
lists a description of each mode bit.
Table 8-5: Mode Bits
Mode | Octal Value | Description |
ECHOKE | 0000001 | Echos KILL by erasing the line |
ECHOE | 0000002 | Visually erase characters |
ECHOK | 0000004 | Echoes NL after KILL |
ECHO | 0000010 | Enable echoing |
ECHONL | 0000020 | Echoes NL even if ECHO is off |
ECHOPRT | 0000040 | Echo erased chars between and / |
ECHOCTL | 0000100 | Echo control characters as ^(char) |
ISIG | 0000200 | Enable special chars INTR, QUIT and SUSP |
ICANON | 0000400 | Enable canonical input |
ALTWERASE | 0001000 | Use alternate word erase algorithm |
IEXTEN | 0002000 | Enable FLUSHO and LNEXT |
XCASE | 0040000 | Canonical upper/lower presentation |
8.4.8 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 remote
machines that will use the printer must contain some network configuration
information.
On the local machine attached to the printer,
security is controlled by the entries in
/etc/hosts.lpd
or
/etc/hosts.equiv
.
You can optionally 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
/etc/hosts
file.
Refer to
Section 8.4.1
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:
rm=deccom
The
rp
symbol specifies the printer spool name on
the remote system.
For example:
rp=ln03lab
For remote printers, specify the
lp
symbol without
a value:
lp=
The
sd
symbol
specifies the spooling directory.
For example:
sd=/usr/spool/lpd
8.4.9 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).
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:
pl#55 pw#70
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:
px#60 py#80
Refer to your printer's manual for its output characteristics.
8.4.10 Generic Print Filters
Tru64 UNIX provides print filters for generic and for local-language use.
The
pcfof
filter is a generic print filter that
can be used with text and PostScript files.
You can edit a template file
/usr/lbin/pcf/template.pcf
to customize the filter for use with
additional printers.
Refer to the
pcfof
(8)
reference page for a list of options.
The
wwpsof
filter uses settings in a printer customization
file (PCF) to find the font glyphs for local language characters and then
embeds the font data in the PostScript file.
The filter uses PostScript outline
fonts, if installed on the local system, or bitmap fonts, which the filter
obtains through a font server.
This means that print jobs containing characters
other than English do not have to be sent to printers where supporting fonts
are resident.
Refer to the
wwpsof
(8)
reference page for a list of options.
See the
Writing Software for the International Market
and the
i18n_printing
(8)
reference page for
additional information on local-language printer support.
8.4.11 TCP/IP Printing
TCP/IP printing allows you to submit print jobs to a remote printer that is directly connected to the network. To use this feature, your printer must contain a network interface card and must be registered with a TCP/IP node name and node address. TCP/IP can also be used to communicate with print server boxes or terminal servers which serve the same purpose as a built-in network interface card, but which make non-networked printer available on the network.
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
).
8.4.11.1 Setting Up TCP/IP Printing Manually
The following steps describe how to set up TCP/IP printing on a local host.
Set up the printer.
Assign a TCP/IP address and node name
to each printer with a network card.
Also, determine the TCP/IP socket number
on which the printer will listen for connection requests.
You can either
specify a name that is defined in the
/etc/services
file,
or directly specify the port number assigned to the printer.
If you opt to
create a service name, you will need the socket number in Step 2b when you
edit the
/etc/services
file.
Table 8-6
lists the socket numbers for three printers made by Compaq and one
made by Hewlett Packard.
Table 8-6: TCP/IP Socket Numbers
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.
Configure the local host. This step describes the utilities that you need to run and the files that you need to modify on the local host in order to configure TCP/IP printing. You must have superuser privileges to perform the following tasks:
Assign the following values to the
ct
and
lp
variables:
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 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.
Configure the services database.
You must register a service
name and
tcp
port number (socket number) in the
/etc/services
database file.
Enter the socket number that you determined
when you configured the printer in step 1 and associate it with a service
name of your choice.
For example, to configure the services database for a
DEClaser 3500, you would add the following line to the
/etc/services
file:
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.
Save the changes to the
/etc/services
file.
Configure the remote hosts database.
The
nodename
value that you specified as part of the
lp
variable value in the
/etc/printcap
file must be known
by your local host's network management services; therefore, you must enter
the
nodename
and its network address in the
/etc/hosts
database file.
If you are running a BIND server for
remote host names, you do not necessarily need to add the printer's node name
to the
/etc/hosts
file, though if there is ever a problem
with the BIND server, an entry in
/etc/hosts
would be a
useful fallback.
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.
You can also view the printer status and submit print jobs with the CDE print
utilities.
8.5 Known Restrictions on the Use of Filters
The following are current restrictions on the use of print filters:
TCP/IP printing works when printing within a local subnet; however, printing in complex networks across one or more routers may cause reliability problems. You may need to configure network cards in the printer in order to identify the router. Refer to the printer documentation for information.
Printing non-PostScript files with some PostScript and non-PostScript
filters may yield unexpected results.
Table 8-7
lists the filters with which you could experience these problems.
Table 8-7: Non-PostScript and PostScript Filters
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 Compaq 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).
Some filters designed to work with character-set printing (such as ASCII) may not work for TCP/IP printing.
8.6 Testing and Troubleshooting Printers
This section provides a checklist
for diagnosing printer problems.
Most printer errors are logged in the
/var/adm/syslog.dated/current/lpr.log
file while some are logged
in the
/usr/adm/lperr
file.
The
printconfig
window Printer Configuration
on
host
contains an option to send test output to the printer
immediately after configuration is complete.
If the output is not printed,
follow the troubleshooting steps described in this section.
You can also test a printer by using the
lpr
command
to print a few pages of text.
You should 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.
The
lptest
command writes a 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:
#
/usr/sbin/lptest |lpr -P3r44
Refer to the
lptest
(8)
reference page for more information.
If a problem occurs on an existing printer or when adding a printer to a system, diagnose the problem as follows:
Refer to the error log files specified in Section 8.4.4.
Check the physical connections and if possible, swap the cable. Check all part numbers to ensure that cables and connectors are appropriate and suitable for the configuration. Note that cable length can affect the available baud rate or communications method. Most printers have internal test and print test options. Use these test options to verify the hardware.
Review the printer configuration, ensuring that the data entered
is appropriate for the device.
If the entries appear correct, try a generic
or pass through filter to print a simple ASCII text file.
Review the manufacturer's
documentation to check the settings.
Ensure that the correct settings are
recorded in the
/etc/printcap
file.
Refer to
Section 8.4.1.
Ensure that the printer daemon is present by using the following command:
#
ps agx | grep /usr/sbin/lpd
Sometimes, the parent
lpd
process becomes hung, or a child process does.
If the daemon
is not running, it may have to be completely killed and restarted using the
kill -9
command on each process, or using the stop and start commands
described in
Section 8.4.3.
Using the
-l
option with
/usr/lbin/lpd
causes the daemon to log requests from the network.
This flag
is useful for debugging problems with remote printers.
consult the
lpd
(8)
reference page for information.
Check the queue status and printer status using the CDE graphical
tools or the
lpc
command line utility to ensure that printer
and queue are enabled and available.
If queues are stalled, try resetting
the queues (refer to
Section 8.3.4).
If print jobs are
being created and queued, try configuring a different local or remote printer.
Ensure that the appropriate spooling or device files have been created and that ownership and access are correct (refer to Section 8.4.2.6.1).
Note that for networked and remote printers, you also have to ensure that the systems are properly connected and authorized to transfer print jobs. Consult the Network Administration guide for information on network troubleshooting.