Click here!

SEARCH: Upload    Contact    Home



Start Here:

 
 
* Howto's
* Man Pages
* FAQ's
* Guides
* Search


* Software
* Index
* Distributions
* Howto
* Linux News
* Mailing Lists
* What's New

 
 

 
   

Console  GNOME   KDE   X11    Themes

 

TUCOWS Linux
Printing-HOWTO-6
The Linux Printing HOWTO: How it works, basic Next Previous Contents

6. How it works, basic

In order to get printing working well, you need to understand how your spooling software works.

6.1 PDQ

Pdq stands for "Print, Don't Queue", and the way it works reflects this design. The following sequence of events happens when you use PDQ to print:

  • You run pdq or xpdq, specifying a file.
  • You specify a printer.
  • You specify the settings for the various options and arguments defined in the printer's PDQ driver file (duplex, copies, print quality, and so forth).
  • PDQ analyzes the contents of what you printed, and follows the instructions in the PDQ driver file which tell it how to process your data for this printer with your options.
  • PDQ sends the processed data to the printer according to the interface defined for that printer (straight to /dev/lp0, or to an LPD daemon on the network, over the network to an Apple or Microsoft system, or even to a fax machine).
  • If PDQ can't send the data to the printer right away, it spawns a background process to wait and try again until it succeeds or hits a time limit.
At all times during this process, and afterwards, the state of each print job can be seen and inspected using xpdq. Jobs that failed are shown in red and can be resent.

6.2 LPD

Lpd stands for Line Printer Daemon, and refers in different contexts to both the daemon and the whole collection of programs which run print spooling. These are:

lpd

The spooling daemon. One of these runs to control everything on a machine, AND one is run per printer while the printer is printing.

lpr

The user spooling command. Lpr contacts lpd and injects a new print job into the spool.

lpq

Lists the jobs in a print queue.

lpc

The Lpd system control command. With lpc you can stop, start, reorder, etc, the print queues.

lprm

lprm will remove a job from the print spool.

So how does it fit together? Well, when the system boots, lpd is run. It scans the file /etc/printcap to learn which printers it will be managing spools for. Each time someone runs lpr, lpr contacts lpd through the named socket /dev/printer, and feeds lpd both the file to print and some information about who is printing and how to print it. Lpd then prints the file on the appropriate printer in turn.

The lp system was originally designed when most printers were line printers - that is, people mostly printed plain ascii. As it turns out, only a little extra scripting is needed to make lpd work quite well for today's print jobs, which are often in PostScript, or text, or dvi, or...


Next Previous Contents

News   Contact   Advertise   CD ROM   Search   Upload   Help   Home


Copyright © 2000 TUCOWS.COM Inc.
TUCOWS.COM Inc. has no liability for any content or goods on the TUCOWS site or the Internet, except as set forth in the terms and conditions and privacy statement.