Controlling System Resources with CUPS-based Spoolers
spooler is a queue for a limited resource. It is a way of throttling and controlling access to these resources. Access to things such as printing, communications, and so on are rationed and controlled. Spooling uses a queue to buffer requests for a physical resource. This allows multiple users to leverage use of scarce physical resource. Spooling also enables devices that communicate at different rates to exchange data (buffering). A spooler allowed for not only job queuing but also prioritization. A spooler also allows for the service to be run by a privileged user and enables queued jobs to run after a user has submitted a request but is no longer accessing the system.
CUPS (Common UNIX Printing System) is a new type of spooler. It was designed to work across most UNIX- and Linux-based systems. It is also standards based. It enables printing through (lpr), IPP, CIFS/SMB, Raw socket (JetDirect), and through local printing. CUPS uses network printer browsing and PostScript Printer Description (PPD) files to ease the common tasks of printing.
Using the Spooler Commands
lp is the standard command used by spoolers to submit print requests. Here is a list of some commands performed by lp.
Submit a print request to the default printer:
lp/etc/hosts
Submit a print request to a specific printer:
lp -d printera/etc/hosts
Submit two copies of a print request:
lp -n 2 /etc/hosts
lpr is the standard command used by spoolers to submit print requests. Here is a list of some commands performed by lpr.
Submit a print request to the default printer:
lpr /etc/hosts
Submit a print request to a specific printer:
lpr p printqueue /etc/hosts
Submit two copies of a print request:
lpr -# 2 /etc/hosts
lpadmin is the standard command used by spoolers to configure printers and classes. Here is a list of some commands performed by lpadmin.
Change the system default printer:
lpadmin d printqueue
Remove a print queue:
lpadmin -xprintqueue
lpq is the standard command used by spoolers to query the status of the spooler, print queues, and jobs.
lpoptions is the CUPS command to display or set printer options and defaults. ie, you could create two queues for a printer and use lpoptions to set the second queue to print in landscape mode by default.
iEntry 10th Anniversary
LinuxHaxor
WH
MH