source: trunk/third/lprng/doc/LPRng-HOWTO-2.html @ 14517

Revision 14517, 6.4 KB checked in by mwhitson, 25 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r14516, which included commits to RCS files with non-trunk default branches.
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2<HTML>
3<HEAD>
4 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
5 <TITLE> LPRng-HOWTO: Print Spooling Overview</TITLE>
6 <LINK HREF="LPRng-HOWTO-3.html" REL=next>
7 <LINK HREF="LPRng-HOWTO-1.html" REL=previous>
8 <LINK HREF="LPRng-HOWTO.html#toc2" REL=contents>
9</HEAD>
10<BODY>
11<A HREF="LPRng-HOWTO-3.html">Next</A>
12<A HREF="LPRng-HOWTO-1.html">Previous</A>
13<A HREF="LPRng-HOWTO.html#toc2">Contents</A>
14<HR>
15<H2><A NAME="overview"></A> <A NAME="s2">2. Print Spooling Overview</A></H2>
16
17<P>A print spooler is a program that accepts
18<I>print jobs</I>
19(which are usually one or more files)
20from a program or network interface,
21stores them in a
22<I>spool queue</I>,
23and then sends them to a printer or another
24print spooler.
25Usually there are facilities to submit jobs,
26check on the current job status,
27remove jobs from spool queues,
28and perform administrative functions such as starting or
29stopping printing.
30<P>A print spooler is a client/server application.
31The client programs are used to submit jobs to the print spooler
32program which performs the actual printing operations.
33In order to carry out these operations,
34the server may need to use other programs to convert print job files
35into a format acceptable to a printer,
36or perform various accounting or administrative functions.
37<H2><A NAME="ss2.1">2.1 Overview</A>
38</H2>
39
40<P>
41<BLOCKQUOTE><CODE>
42<PRE>
43+---------+    +-----+    +-----+     +--------+    +---------+
44| program | -> | lpr | -> | lpd |  -> | filter | -> | printer |
45+---------+    +-----+  * +-----+     +--------+    +---------+
46                  *    *     |   
47               printcap      V
48                          +-----+     +--------+    +---------+
49                          | lpd |  -> | filter | -> | printer |
50                          +-----+     +--------+    +---------+
51
52                           Figure 1
53</PRE>
54</CODE></BLOCKQUOTE>
55<P>Figure 1 shows the flow of data between the individual components of the
56LPRng print spooling system.
57A program (or user) will use the <CODE>lpr</CODE> program to send a file
58to the <CODE>lpd</CODE> server over a TCP/IP connection.
59The <CODE>lpd</CODE> server will store the file temporarily in a
60spool queue directory.
61The information needed by the <CODE>lpr</CODE> and <CODE>lpd</CODE> programs to carry
62out this activity is stored in the
63<CODE>printcap</CODE>  (usually called the <CODE>/etc/printcap</CODE>) database file.
64<P>The <CODE>lpd</CODE> server sorts the queue entries and determines the print order.
65It will select a job to be printed,
66open a connection to the printer,
67and then use a <I>filter</I> program to convert the file contents into a
68format suitable for the printer.
69If the file does not need conversion,
70then the <CODE>lpd</CODE> server will send the file directly to the printer.
71<P>The <CODE>lpd</CODE> server can also <CODE>forward</CODE> jobs to another print server
72over a network connection,
73optionally sending them through a filter as well.
74The destination server can in turn forward the job or send it to a printer.
75<P>The protocol or commands used to do this job forward and transfer are
76specified by
77<A HREF="LPRng-HOWTO-18.html#rfc1179ref">RFC1179</A>.
78This protocol specifies how the <CODE>lpr</CODE> client program sends a job
79to the <CODE>lpd</CODE> server,
80as well as how the <CODE>lpd</CODE> server forwards jobs to another server.
81In addition to job submission,
82RFC1179 specifies commands to obtain queue status,
83to remove jobs from the queue,
84and to start and stop print queues.
85<H2><A NAME="ss2.2">2.2 Sample Printcap Entry</A>
86</H2>
87
88<P>As described in the
89<A HREF="#overview">Print Spooling Overview</A>,
90the information in the <CODE>printcap</CODE> database is used control printing
91operations.
92While there is no RFC specifying its format or content,
93there is a strong <I>de facto</I> standard for its format.
94For a complete description of the <CODE>printcap</CODE> database see
95<A HREF="LPRng-HOWTO-8.html#printcapref">Using the Printcap Database</A>.
96For a list of all of the <CODE>printcap</CODE> and configuration options see
97<A HREF="LPRng-HOWTO-21.html#index">Index To All The Configuration and Printcap Options</A>.
98<P>Here is a sample printcap:
99<BLOCKQUOTE><CODE>
100<PRE>
101lp:lp=psqueue@printserver.astart.com
102</PRE>
103</CODE></BLOCKQUOTE>
104<P>This printcap information tells the <I>client</I> programs
105that when a client wants to print a job on the
106<CODE>lp</CODE> printer,
107that these jobs should be sent to the
108<CODE>psqueue</CODE> on host <CODE>printerserver.astart.com</CODE>.
109On the printserver,
110the following printcap entry is used by the <CODE>lpd</CODE>
111server to do the printing.
112<BLOCKQUOTE><CODE>
113<PRE>
114psqueue:server
115  :lp=/dev/lp0
116  :sd=/var/spool/lpd/psqueue
117  :if=/usr/local/libexec/filters/ifhp
118</PRE>
119</CODE></BLOCKQUOTE>
120<P>The <CODE>sd</CODE> (spool queue directory) entry specifies the directory where
121print jobs will be placed.
122The <CODE>lp</CODE> line specifies an actual output device,
123so the <CODE>lpd</CODE> server will open this device for printing.
124The <CODE>if</CODE> (input file filter) entry specifies the program to be used
125to translate the input file into a format compatible with the actual
126printer.
127Many of the times there is not need for conversion,
128and this entry is left out.
129<H2><A NAME="ss2.3">2.3 Print Server Configuration</A>
130</H2>
131
132<P>The previous sections have given a very high level view of printing
133operations.
134In order to do printing the following programs and information must
135be established:
136<OL>
137<LI>The printer itself,
138and the interface to the printer.</LI>
139<LI>Client programs for use by users or other programs to send jobs
140to the print server and perform administrative functions.</LI>
141<LI>A server program that runs on a host that accepts jobs for printing.</LI>
142<LI>Printcap information to control the printing operations.</LI>
143<LI>Filters that convert print jobs into formats compatible with printers.</LI>
144<LI>System facilities such as spool queues or storage areas for jobs.</LI>
145</OL>
146<P>The following sections will cover each of these topics in turn.
147The initial sections assume that most users are setting up printers
148on small systems and require an extremely simple print capability.
149Later sections explore the various configurations that can be used
150to support large networks of print spoolers as would be found in
151large academic institutions or businesses.
152<HR>
153<A HREF="LPRng-HOWTO-3.html">Next</A>
154<A HREF="LPRng-HOWTO-1.html">Previous</A>
155<A HREF="LPRng-HOWTO.html#toc2">Contents</A>
156</BODY>
157</HTML>
Note: See TracBrowser for help on using the repository browser.