xref: /netbsd/usr.sbin/lpr/lprm/lprm.1 (revision c4a72b64)
1.\"	$NetBSD: lprm.1,v 1.12 2002/07/03 22:12:38 wiz Exp $
2.\"
3.\" Copyright (c) 1983, 1990, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"	This product includes software developed by the University of
17.\"	California, Berkeley and its contributors.
18.\" 4. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"     @(#)lprm.1	8.1 (Berkeley) 6/6/93
35.\"
36.Dd June 6, 1993
37.Dt LPRM 1
38.Os
39.Sh NAME
40.Nm lprm
41.Nd remove jobs from the line printer spooling queue
42.Sh SYNOPSIS
43.Nm ""
44.Op Fl
45.Bk -words
46.Op Fl P Ar printer
47.Ek
48.Bk -words
49.Op Fl w Ar maxwait
50.Ek
51.Op Ar job# ...
52.Op Ar user ...
53.Sh DESCRIPTION
54.Nm
55will remove a job, or jobs, from a printer's spool queue.
56Since the spooling directory is protected from users, using
57.Nm
58is normally the only method by which a user may remove a job.
59The owner of a job is determined by the user's login name
60and host name on the machine where the
61.Xr lpr 1
62command was invoked.
63.Pp
64Options and arguments:
65.Bl -tag -width indent
66.It Fl P Ns Ar printer
67Specify the queue associated with a specific
68.Ar printer
69(otherwise the default printer is used).
70.It Fl w Ar maxwait
71Specify the maximum time to wait in seconds for remote responses.
72The default is 300 seconds or 5 minutes.
73.It Fl
74If a single
75.Sq Fl
76is given,
77.Nm
78will remove all jobs which a user
79owns.  If the super-user employs this flag, the spool queue will
80be emptied entirely.
81.It Ar user
82Causes
83.Nm
84to attempt to remove any jobs queued belonging to that user
85(or users).  This form of invoking
86.Nm
87is useful only to the super-user.
88.It Ar job\ \&#
89A user may dequeue an individual job by specifying its job number.
90This number may be obtained from the
91.Xr lpq  1
92program, e.g.
93.Pp
94.Bd -literal -offset indent
95\&% lpq \-l
96
971st:ken				[job #013ucbarpa]
98	(standard input)	100 bytes
99% lprm 13
100.Ed
101.El
102.Pp
103If neither arguments or options are given,
104.Nm
105will delete the currently active job if it is
106owned by the user who invoked
107.Nm "" .
108.Pp
109.Nm
110announces the names of any files it removes and is silent if
111there are no jobs in the queue which match the request list.
112.Pp
113.Nm
114will kill off an active daemon, if necessary, before removing
115any spooling files.  If a daemon is killed, a new one is
116automatically restarted upon completion of file removals.
117.Sh ENVIRONMENT
118If the following environment variable exists, it is utilized by
119.Nm "" .
120.Bl -tag -width PRINTER
121.It Ev PRINTER
122If the environment variable
123.Ev PRINTER
124exists,
125and a printer has not been specified with the
126.Fl P
127option,
128the default printer is assumed from
129.Ev PRINTER .
130.El
131.Sh FILES
132.Bl -tag -width /var/spool/output/*/lock/ -compact
133.It Pa /etc/printcap
134Printer characteristics file.
135.It Pa /var/spool/output/*
136Spooling directories.
137.It Pa /var/spool/output/*/lock
138Lock file used to obtain the pid of the current
139daemon and the job number of the currently active job.
140.El
141.Sh DIAGNOSTICS
142.Dq Permission denied
143if the user tries to remove files other than his own.
144.Sh SEE ALSO
145.Xr lpq 1 ,
146.Xr lpr 1 ,
147.Xr lpd 8
148.Sh HISTORY
149The
150.Nm
151command appeared in
152.Bx 3.0 .
153.Sh BUGS
154Since there are race conditions possible in the update of the lock file,
155the currently active job may be incorrectly identified.
156