Tuesday, December 05, 2006

Printing in Solaris

Printing in Solaris
  • /etc/printers.conf: System printing configuration database

  • /var/spool/print/: Spool directory where all the print jobs are spooled to

The following files have their own meaning:

xf* --> tells its printer server, including the name of printer queue.
df* --> contains the actual data of the print job
cf* --> tells the name of the server where the print job is initiated from; account the print job belongs to.

Note:
Normallly you should not see the 'xf*' file(s). If you do then it is an indication of "defunct" printer queue - meaning, the printer queue may no longer exist or there's a problem of that the printer server cannot spool the print job in time. In which case, you should be safe to delete all the files (xf*, df*, and cf*) belong to this particular printer.

For example, if you see /var/spool/print/ directory contains the following files then you can delete them.

xfA010svlerp01, dfA010svlerp01, cfA010svlerp01

Also, refer to /etc/printers.conf for more detail about the print queue name since most of the times, the reported print queue name will be the NT's names.

Some Useful Commands:

* To enable a print queue:

# enable PrinterQueue

Example: enable h2-5si-sup

* To disable a print queue:

# disable PrinterQueue

* To cancel a print job:

  1. Use 'lpstat PrinterQueue' to find the print jobs. For example,

# lpstat h2-5si-sup

h2-5si-sup-145 root@estwig 1075 Jun 01 09:21
h2-5si-sup-146 root@estwig 1075 Jun 01 09:21

  1. Use 'cancel' command to kill the print job(s). For example,

# cancel h2-5si-sup-145
# cancel h2-5si-sup-146

* To list the printer server of a printer queue:

# lpstat -v PrinterQueues

Or # lpget PrinterQueues

Example:

# lpstat -v par-hp5si-fin,sin-x400-sls
# lpget par-hp5si-fin sin-x400-sls

* To list all the print jobs:

# lpstat -o

* To find out if a printer queue accepting the job (enable) or not:

# lpstat -a PrinterQueue

Example:
# lpstat -a h4-3si-fin1

For all printer queues:
# lpstat -a

For a better output:
# lpstat -p
or # lpstat -p par-hp5si-fin

No comments: