Information Technology Reference
In-Depth Information
# /etc/init.d/lp stop
Print services stopped.
# /usr/lib/lpsched
Print services started.
#
Defining a Printer
The
lpadmin(1M)
command is used to define a printer by specifying the
-p
com-
mand-line argument followed by a printer name and, at a minimum, the
-v
com-
mand-line argument followed by a device (port). The following listing shows
how to define the printer
laser1
, which is attached to the
/dev/term/a
port:
# lpadmin -p laser1 -v /dev/term/a
Additional command-line arguments can be specified to define printer type,
content type, and so on.
Controlling Printer Usage
After a printer is defined, it can accept or reject attempts to place print requests
on its queue. This functionality is controlled separately using the
accept(1M)
and
reject(1M)
commands and specifying the name of a defined printer as a
command-line argument. The
lpstat
command with the
-a
command-line
argument can be used to determine accept/reject printer queue status. When
reject
is used to reject print jobs, a reason can be specified using the
-r
com-
mand-line argument. Users can then view this reason by using the
lpstat -a
command. The following listing uses the defined printer
laser1
as an example:
# lpstat -a laser1
laser1 not accepting requests since
➥
Mon Aug 12 09:15:14 EDT 2002 -
unknown reason
# accept laser1
destination “laser1” now accepting requests
# lpstat -a laser1
laser1 accepting requests since
➥
Mon Aug 12 09:18:35 EDT 2002
# reject -r “out of paper” laser1
destination “laser1” will no longer accept requests
# lp -dlaser1 file
laser1: requests are not being accepted
# lpstat -a laser1
laser1 not accepting requests since
➥
Mon Aug 12 09:28:50 EDT 2002 -
out of paper
#