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) |
---|
20 | from a program or network interface, |
---|
21 | stores them in a |
---|
22 | <I>spool queue</I>, |
---|
23 | and then sends them to a printer or another |
---|
24 | print spooler. |
---|
25 | Usually there are facilities to submit jobs, |
---|
26 | check on the current job status, |
---|
27 | remove jobs from spool queues, |
---|
28 | and perform administrative functions such as starting or |
---|
29 | stopping printing. |
---|
30 | <P>A print spooler is a client/server application. |
---|
31 | The client programs are used to submit jobs to the print spooler |
---|
32 | program which performs the actual printing operations. |
---|
33 | In order to carry out these operations, |
---|
34 | the server may need to use other programs to convert print job files |
---|
35 | into a format acceptable to a printer, |
---|
36 | or 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 |
---|
56 | LPRng print spooling system. |
---|
57 | A program (or user) will use the <CODE>lpr</CODE> program to send a file |
---|
58 | to the <CODE>lpd</CODE> server over a TCP/IP connection. |
---|
59 | The <CODE>lpd</CODE> server will store the file temporarily in a |
---|
60 | spool queue directory. |
---|
61 | The information needed by the <CODE>lpr</CODE> and <CODE>lpd</CODE> programs to carry |
---|
62 | out 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. |
---|
65 | It will select a job to be printed, |
---|
66 | open a connection to the printer, |
---|
67 | and then use a <I>filter</I> program to convert the file contents into a |
---|
68 | format suitable for the printer. |
---|
69 | If the file does not need conversion, |
---|
70 | then 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 |
---|
72 | over a network connection, |
---|
73 | optionally sending them through a filter as well. |
---|
74 | The 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 |
---|
76 | specified by |
---|
77 | <A HREF="LPRng-HOWTO-18.html#rfc1179ref">RFC1179</A>. |
---|
78 | This protocol specifies how the <CODE>lpr</CODE> client program sends a job |
---|
79 | to the <CODE>lpd</CODE> server, |
---|
80 | as well as how the <CODE>lpd</CODE> server forwards jobs to another server. |
---|
81 | In addition to job submission, |
---|
82 | RFC1179 specifies commands to obtain queue status, |
---|
83 | to remove jobs from the queue, |
---|
84 | and 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>, |
---|
90 | the information in the <CODE>printcap</CODE> database is used control printing |
---|
91 | operations. |
---|
92 | While there is no RFC specifying its format or content, |
---|
93 | there is a strong <I>de facto</I> standard for its format. |
---|
94 | For a complete description of the <CODE>printcap</CODE> database see |
---|
95 | <A HREF="LPRng-HOWTO-8.html#printcapref">Using the Printcap Database</A>. |
---|
96 | For 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> |
---|
101 | lp:lp=psqueue@printserver.astart.com |
---|
102 | </PRE> |
---|
103 | </CODE></BLOCKQUOTE> |
---|
104 | <P>This printcap information tells the <I>client</I> programs |
---|
105 | that when a client wants to print a job on the |
---|
106 | <CODE>lp</CODE> printer, |
---|
107 | that these jobs should be sent to the |
---|
108 | <CODE>psqueue</CODE> on host <CODE>printerserver.astart.com</CODE>. |
---|
109 | On the printserver, |
---|
110 | the following printcap entry is used by the <CODE>lpd</CODE> |
---|
111 | server to do the printing. |
---|
112 | <BLOCKQUOTE><CODE> |
---|
113 | <PRE> |
---|
114 | psqueue: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 |
---|
121 | print jobs will be placed. |
---|
122 | The <CODE>lp</CODE> line specifies an actual output device, |
---|
123 | so the <CODE>lpd</CODE> server will open this device for printing. |
---|
124 | The <CODE>if</CODE> (input file filter) entry specifies the program to be used |
---|
125 | to translate the input file into a format compatible with the actual |
---|
126 | printer. |
---|
127 | Many of the times there is not need for conversion, |
---|
128 | and 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 |
---|
133 | operations. |
---|
134 | In order to do printing the following programs and information must |
---|
135 | be established: |
---|
136 | <OL> |
---|
137 | <LI>The printer itself, |
---|
138 | and the interface to the printer.</LI> |
---|
139 | <LI>Client programs for use by users or other programs to send jobs |
---|
140 | to 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. |
---|
147 | The initial sections assume that most users are setting up printers |
---|
148 | on small systems and require an extremely simple print capability. |
---|
149 | Later sections explore the various configurations that can be used |
---|
150 | to support large networks of print spoolers as would be found in |
---|
151 | large 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> |
---|