lpr report.txt │ print request ▼ cupsd (scheduler) ──► stores the job in /var/spool/cups, assigns a number │ ▼ filter ──► converts the document into a format the printer understands (see PPD) │ ▼ backend ──► sends it along the matching path among usb · ipp · lpd · socket │ ▼ printer
lprhands off the job and finishes right away. The actual printing is processed in order by the cupsd daemon. That is why the command succeeds even when the printer is off, and the job stays in the queue.
A PPD (PostScript Printer Description) is a file that describes the printer's paper, resolution, and features, and sits in /etc/cups/ppd/. Choosing the model when you register a printer is the same as choosing the PPD.
Logs go to access_log and error_log under /var/log/cups/.
File
What it holds
Who edits it
cupsd.conf
Daemon behavior — which address and port to listen on, who can access
The administrator, directly
printers.conf
The list of registered printers and each printer's device address
Written for you by the web page and lpadmin
/etc/printcap
The old LPD-style printer list. CUPS generates it only for compatibility with old programs
—
In the default settings, cupsd.conf opens only localhost:631. So the web admin page is reached on that computer at http://localhost:631.
Printers can also be registered by command rather than the web page.
The printer status (whether it is available, whether it is printing)
-o
The list of jobs waiting
-d
The default printer
-a
Whether the queue is accepting jobs
-t
All of the above
The P in lpr -P is uppercase. In System V, -d (destination) does the same job. Choices that mix the options of the two families, such as lpr -d or lp -P, are wrong.
The System V side calls a job by printername-number (printer1-12).
lpc is a BSD command that controls printers and queues. In CUPS it is used only for things like checking status with lpc status.
When printing fails
Where to look
Whether the job entered the queue
lpq · lpstat -o
Whether the printer is in a stopped state
lpstat -p
Whether the daemon is running
systemctl status cups
What the error was
/var/log/cups/error_log
Item
LPD · LPRng
CUPS
Daemon
lpd
cupsd
Protocol · port
LPD · 515
IPP · 631
Printer list file
/etc/printcap
/etc/cups/printers.conf
Management method
Edit config files directly
Web page, lpadmin
LPRng is LPR Next Generation, that is, a reworked version of the old LPD. CUPS imitates the commands of both (lpr, lpq, lprm) so that they can be used as they are, so even though the system changed, the commands stay the same.
frontend scanimage (command line) · xsane (graphical) the programs the user works with │ SANE API │ backend per-vendor, per-model scanner drivers talks directly to the device │ scanner
SANE has a structure that separates the screen (frontend) from the driver (backend). So one frontend can handle scanners from multiple companies, and via the saned daemon you can also use a scanner attached to another computer.
Backend settings are gathered in /etc/sane.d/. The dll.conf inside it decides which backends to load.
Command
What it looks for
sane-find-scanner
Whether a device that looks like a scanner is connected on USB or SCSI — it finds it regardless of whether it is supported
scanimage -L
The list of scanners the SANE backends can actually use
$ scanimage -Ldevice `epson2:libusb:001:004' is a Epson GT-1500 flatbed scanner$ scanimage -d epson2:libusb:001:004 --resolution 300 > page1.pnm
If it shows up with the first command but not the second, it means it is connected but there is no matching backend.
scanimage sends its result to the screen (standard output). So you capture it into a file with >. You pick the device with -d, and detailed options like resolution differ by scanner.
xsane is a graphical frontend where you set the area while viewing a preview, and it can also be called from within the image editor GIMP.
The initials tell you the target — the P in CUPS is Printing, the S in ALSA is Sound, and the S in SANE is Scanner. If ALSA and SANE both having an S confuses you, read it out in full: ALSA contains Linux Sound in full, and SANE contains Scanner in full.
Tomorrow we tie this week's packages and devices together on a single sheet.