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