Information Technology Reference
In-Depth Information
variable and exporting it to the environment.
LPDEST
and/or
PRINTER
are usu-
ally defined in the user's login profile. The following listing shows the con-
tents of a .profile file that sets the user default printer to the
laser2
printer:
LPDEST=laser2
export LPDEST
A user version of the Printer Alias Database can be created in each user's
home directory. This file,
$HOME/.printers
, is a simplified version of the sys-
tem
/etc/printers.conf
file and contains a
_
default
entry that can be used
to identify the user/application default printer.
The following precedence order is used to determine the destination printer:
1.
Printer specified on the
lp
command-line using the
-d
command-line
argument.
2.
Default printer defined by the
LPDEST
variable.
3.
Default printer defined by the
PRINTER
variable.
4.
_
default
entry in
$HOME/.printers
.
5.
_
default
entry in
/etc/printer.conf
(system default printer).
When using LP Daemon/BSD commands such as
lpr(1)
, the
LPDEST
and
PRINTER
variables are reversed in the precedence order.
If a destination printer is not specified and a default printer is not defined, print jobs
are rejected.
Monitoring Print Requests
The
lpstat(1)
command is used to check the status of print requests. The
-o
command-line argument is used to display the status of print requests,
whereas the
-t
command-line argument shows all status information. The
following listing shows a typical use of the
lpstat
command:
# lp -d laser1 abc
request id is laser1-27 (1 file(s))
# lpstat
laser1-27 solaris!root 10281 Oct 03 15:18
# lpstat -t
scheduler is running
system default destination: laser1
device for laser1: /dev/term/a
device for laser2: /dev/term/b
laser1 accepting requests
laser2 accepting requests
laser1-27 solaris!root 10281 Oct 03 15:19
#