xref: /netbsd/usr.sbin/lpr/lprm/lprm.1 (revision 6550d01e)
1.\"	$NetBSD: lprm.1,v 1.15 2003/08/07 11:25:30 agc 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.Bk -words
42.Op Fl P Ar printer
43.Ek
44.Bk -words
45.Op Fl w Ar maxwait
46.Ek
47.Op Ar job# ...
48.Op Ar user ...
49.Sh DESCRIPTION
50.Nm
51will remove a job, or jobs, from a printer's spool queue.
52Since the spooling directory is protected from users, using
53.Nm
54is normally the only method by which a user may remove a job.
55The owner of a job is determined by the user's login name
56and host name on the machine where the
57.Xr lpr 1
58command was invoked.
59.Pp
60Options and arguments:
61.Bl -tag -width indent
62.It Fl P Ns Ar printer
63Specify the queue associated with a specific
64.Ar printer
65(otherwise the default printer is used).
66.It Fl w Ar maxwait
67Specify the maximum time to wait in seconds for remote responses.
68The default is 300 seconds or 5 minutes.
69.It Fl
70If a single
71.Sq Fl
72is given,
73.Nm
74will remove all jobs which a user
75owns.  If the super-user employs this flag, the spool queue will
76be emptied entirely.
77.It Ar user
78Causes
79.Nm
80to attempt to remove any jobs queued belonging to that user
81(or users).  This form of invoking
82.Nm
83is useful only to the super-user.
84.It Ar job\ \&#
85A user may dequeue an individual job by specifying its job number.
86This number may be obtained from the
87.Xr lpq  1
88program, e.g.
89.Pp
90.Bd -literal -offset indent
91\&% lpq \-l
92
931st:ken				[job #013ucbarpa]
94	(standard input)	100 bytes
95% lprm 13
96.Ed
97.El
98.Pp
99If neither arguments or options are given,
100.Nm
101will delete the currently active job if it is
102owned by the user who invoked
103.Nm .
104.Pp
105.Nm
106announces the names of any files it removes and is silent if
107there are no jobs in the queue which match the request list.
108.Pp
109.Nm
110will kill off an active daemon, if necessary, before removing
111any spooling files.  If a daemon is killed, a new one is
112automatically restarted upon completion of file removals.
113.Sh ENVIRONMENT
114If the following environment variable exists, it is used by
115.Nm .
116.Bl -tag -width PRINTER
117.It Ev PRINTER
118If the environment variable
119.Ev PRINTER
120exists,
121and a printer has not been specified with the
122.Fl P
123option,
124the default printer is assumed from
125.Ev PRINTER .
126.El
127.Sh FILES
128.Bl -tag -width /var/spool/output/*/lock/ -compact
129.It Pa /etc/printcap
130Printer characteristics file.
131.It Pa /var/spool/output/*
132Spooling directories.
133.It Pa /var/spool/output/*/lock
134Lock file used to obtain the pid of the current
135daemon and the job number of the currently active job.
136.El
137.Sh DIAGNOSTICS
138.Dq Permission denied
139if the user tries to remove files other than his own.
140.Sh SEE ALSO
141.Xr lpq 1 ,
142.Xr lpr 1 ,
143.Xr lpd 8
144.Sh HISTORY
145The
146.Nm
147command appeared in
148.Bx 3.0 .
149.Sh BUGS
150Since there are race conditions possible in the update of the lock file,
151the currently active job may be incorrectly identified.
152