Initial import from FreeBSD RELENG_4:
[dragonfly.git] / usr.sbin / lpr / SMM.doc / 2.t
1 .\" Copyright (c) 1983, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)2.t 8.1 (Berkeley) 6/8/93
33 .\"
34 .NH 1
35 Commands
36 .NH 2
37 lpd \- line printer daemon
38 .PP
39 The program
40 .IR lpd (8),
41 usually invoked at boot time from the /etc/rc file, acts as
42 a master server for coordinating and controlling
43 the spooling queues configured in the printcap file.
44 When
45 .I lpd
46 is started it makes a single pass through the
47 .I printcap
48 database restarting any printers that have jobs.
49 In normal operation
50 .I lpd
51 listens for service requests on multiple sockets,
52 one in the UNIX domain (named ``/dev/printer'') for
53 local requests, and one in the Internet domain
54 (under the ``printer'' service specification)
55 for requests for printer access from off machine;
56 see \fIsocket\fP\|(2) and \fIservices\fP\|(5)
57 for more information on sockets and service
58 specifications, respectively.
59 .I Lpd
60 spawns a copy of itself to process the request; the master daemon
61 continues to listen for new requests.
62 .PP
63 Clients communicate with 
64 .I lpd
65 using a simple transaction oriented protocol.
66 Authentication of remote clients is done based
67 on the ``privilege port'' scheme employed by
68 \fIrshd\fP\|(8C) and \fIrcmd\fP\|(3X).
69 The following table shows the requests 
70 understood by
71 .IR lpd .
72 In each request the first byte indicates the
73 ``meaning'' of the request, followed by the name
74 of the printer to which it should be applied.  Additional
75 qualifiers may follow, depending on the request.
76 .DS
77 .TS
78 l l.
79 Request Interpretation
80 _
81 ^Aprinter\en    check the queue for jobs and print any found
82 ^Bprinter\en    receive and queue a job from another machine
83 ^Cprinter [users ...] [jobs ...]\en     return short list of current queue state
84 ^Dprinter [users ...] [jobs ...]\en     return long list of current queue state
85 ^Eprinter person [users ...] [jobs ...]\en      remove jobs from a queue
86 .TE
87 .DE
88 .PP
89 The \fIlpr\fP\|(1) command
90 is used by users to enter a print job in a local queue and to notify
91 the local
92 .I lpd
93 that there are new jobs in the spooling area.
94 .I Lpd
95 either schedules the job to be printed locally, or if
96 printing remotely, attempts to forward
97 the job to the appropriate machine.
98 If the printer cannot be opened or the destination
99 machine is unreachable, the job will remain queued until it is
100 possible to complete the work.
101 .NH 2
102 lpq \- show line printer queue
103 .PP
104 The \fIlpq\fP\|(1)
105 program works recursively backwards displaying the queue of the machine with
106 the printer and then the queue(s) of the machine(s) that lead to it.
107 .I Lpq
108 has two forms of output: in the default, short, format it
109 gives a single line of output per queued job; in the long 
110 format it shows the list of files, and their sizes, that
111 comprise a job.
112 .NH 2
113 lprm \- remove jobs from a queue
114 .PP
115 The \fIlprm\fP\|(1) command deletes jobs from a spooling
116 queue.  If necessary, \fIlprm\fP will first kill off a
117 running daemon that is servicing the queue and restart
118 it after the required files are removed.  When removing
119 jobs destined for a remote printer, \fIlprm\fP acts
120 similarly to \fIlpq\fP except it first checks locally
121 for jobs to remove and then
122 tries to remove files in queues off-machine.
123 .NH 2
124 lpc \- line printer control program
125 .PP
126 The
127 .IR lpc (8)
128 program is used by the system administrator to control the
129 operation of the line printer system.  
130 For each line printer configured in /etc/printcap,
131 .I lpc
132 may be used to:
133 .IP \(bu
134 disable or enable a printer,
135 .IP \(bu
136 disable or enable a printer's spooling queue,
137 .IP \(bu
138 rearrange the order of jobs in a spooling queue,
139 .IP \(bu
140 find the status of printers, and their associated
141 spooling queues and printer daemons.