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