Ubuntu's print system can be used to print to local (attached) or remote (network) printers. If you use a local printer, it is represented by a printer device, such as /dev/lp0 or /dev/usb/lp0 (if you have a USB printer). Local and remote printers use print queues defined in your system's printer capabilities database, /etc/printcap. A document being printed is known as a print job, and you can view and control your list, or queue, of current print jobs in the spool directory, which is /var/spool/cups. Note that you may control only your print jobs; only the root operator can control print jobs of any user on the system.

To add a printer to your system, you use the gnome-cups-manager client to create, configure, and save the printer's definition. The client saves the definition as an entry in your system's printer capabilities database, /etc/printcap. Each definition contains a text field with the name of the printer, its host, and the name of the print queue. Printed documents will be spooled to the /var/spool/cups directory. A sample printcap definition might look like this:

# This file was automatically generated by cupsd(8) from the

# /etc/cups/printers.conf file. All changes to this file

CUPS maintains its own database of defined printers under the /etc/cups directory in a file named printers.conf. For example, an associated printer defined in /etc/printcap previously might have the following entry in /etc/cups/printers.conf:

# Printer configuration file for CUPS v1.2.0

# Written by cupsd on 2006-06-17 13:24 <Printer Laserjet>

Info Laserjet 2100 Location Attached to Optimus DeviceURI parallel:/dev/lp0 State Idle

StateTime 1150547097 Accepting Yes

Shared Yes JobSheets none none QuotaPeriod 0 PageLimit 0 KLimit 0

OpPolicy default ErrorPolicy stop-printer </Printer>

This example shows the definition for the printer named Laserjet, along with its associated device, description, state, and other information. The various possible fields and entries in this file are documented in the printer.conf man page.

CUPS uses a print server (daemon) named cupsd, also called a scheduler in the CUPS documentation. The server can be controlled, like other Ubuntu services, by the bum client. How the server works on a system is determined by settings in its configuration file, cupsd.conf, found under the /etc/cups directory. CUPS executables are found under the /usr/lib/cups directory.

The cupsd.conf man page documents more than 80 different settings for the server, which you can configure to match your system, network, or printing environment. Default CUPS-related files and directories are stored under the /usr/share/cups directory. Logging can be set to seven different levels, with information about access and errors stored in log files under the /var/log/cups directory.

Resource requirements can be tailored through other settings, such as Maxcopies to set the maximum number of copies of a print job by a user, MaxJobs to set a limit on the number of active print jobs, and MaxJobsPeruser to set a limit on the number of active jobs per user. The RiPCache setting (8MB by default) controls the amount of memory used for graphics cache during printing.

For example, if you want to limit printing to 20 copies of a document or page at a time and only 10 simultaneous print jobs per user, use settings such as these:

MaxCopies 20 MaxJobsPerUser 10

Do not forget to restart the CUPS server after making any changes to its configuration file. Changes are activated only when the service is restarted (when the daemon rereads its configuration file). See the "GUI-Based Printer Configuration Quickstart" section later in this chapter.

Because CUPS does not use the traditional Berkeley-style print spooling system, lpd, you can change the name of the printer capabilities database from the default /etc/printcap. Encryption can be used for printing, with secure access behavior determined by settings in /etc/cups/client.conf. Network access settings include port, connection, IP address, domains, and limits to the number and size of client requests.



Was this article helpful?

0 0

Post a comment