BSD 4_4 release
[unix-history] / usr / src / usr.sbin / lpr / SMM.doc / 2.t
CommitLineData
ad787160
C
1.\" Copyright (c) 1983, 1993
2.\" The Regents of the University of California. All rights reserved.
e937f3d4 3.\"
ad787160
C
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.
772c33c0 19.\"
ad787160
C
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
e937f3d4
KM
33.\"
34.NH 1
35Commands
36.NH 2
4e9b6bac 37lpd \- line printer daemon
e937f3d4
KM
38.PP
39The program
40.IR lpd (8),
41usually invoked at boot time from the /etc/rc file, acts as
42a master server for coordinating and controlling
43the spooling queues configured in the printcap file.
44When
45.I lpd
46is started it makes a single pass through the
47.I printcap
1c460ca9 48database restarting any printers that have jobs.
e937f3d4
KM
49In normal operation
50.I lpd
51listens for service requests on multiple sockets,
52one in the UNIX domain (named ``/dev/printer'') for
53local requests, and one in the Internet domain
54(under the ``printer'' service specification)
55for requests for printer access from off machine;
56see \fIsocket\fP\|(2) and \fIservices\fP\|(5)
57for more information on sockets and service
58specifications, respectively.
59.I Lpd
60spawns a copy of itself to process the request; the master daemon
61continues to listen for new requests.
62.PP
63Clients communicate with
64.I lpd
65using a simple transaction oriented protocol.
66Authentication of remote clients is done based
67on the ``privilege port'' scheme employed by
68\fIrshd\fP\|(8C) and \fIrcmd\fP\|(3X).
69The following table shows the requests
70understood by
71.IR lpd .
72In each request the first byte indicates the
73``meaning'' of the request, followed by the name
74of the printer to which it should be applied. Additional
75qualifiers may follow, depending on the request.
76.DS
77.TS
78l l.
79Request 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
89The \fIlpr\fP\|(1) command
90is used by users to enter a print job in a local queue and to notify
91the local
92.I lpd
93that there are new jobs in the spooling area.
94.I Lpd
1c460ca9
JB
95either schedules the job to be printed locally, or if
96printing remotely, attempts to forward
e937f3d4
KM
97the job to the appropriate machine.
98If the printer cannot be opened or the destination
99machine is unreachable, the job will remain queued until it is
100possible to complete the work.
101.NH 2
102lpq \- show line printer queue
103.PP
104The \fIlpq\fP\|(1)
105program works recursively backwards displaying the queue of the machine with
106the printer and then the queue(s) of the machine(s) that lead to it.
107.I Lpq
108has two forms of output: in the default, short, format it
109gives a single line of output per queued job; in the long
1c460ca9 110format it shows the list of files, and their sizes, that
e937f3d4
KM
111comprise a job.
112.NH 2
113lprm \- remove jobs from a queue
114.PP
115The \fIlprm\fP\|(1) command deletes jobs from a spooling
116queue. If necessary, \fIlprm\fP will first kill off a
1c460ca9 117running daemon that is servicing the queue and restart
e937f3d4
KM
118it after the required files are removed. When removing
119jobs destined for a remote printer, \fIlprm\fP acts
120similarly to \fIlpq\fP except it first checks locally
121for jobs to remove and then
122tries to remove files in queues off-machine.
123.NH 2
124lpc \- line printer control program
125.PP
126The
127.IR lpc (8)
128program is used by the system administrator to control the
129operation of the line printer system.
130For each line printer configured in /etc/printcap,
131.I lpc
132may be used to:
133.IP \(bu
134disable or enable a printer,
135.IP \(bu
136disable or enable a printer's spooling queue,
137.IP \(bu
138rearrange the order of jobs in a spooling queue,
139.IP \(bu
140find the status of printers, and their associated
4e9b6bac 141spooling queues and printer daemons.