On 11/25/02, Peter Elsner <[EMAIL PROTECTED]> wanted to know:
Hello All...

Something appears to be broken with lpq and lprm.  I'm writing
a Perl script to easily allow users to manage printers/jobs
from a easy to use interface.

1st problem (lpq):  man lpq displays the use as follows:

NAME
      lpq - spool queue examination program

SYNOPSIS
      lpq [-a] [-l] [-Pprinter] [job # ...] [user ...]

lpq -a (works fine)
lpq -l (doesn't return anything)
lpq -Pprinter (works fine)
lpq  job# and lpq user (don't work).
'lpq -a' will check all local printer queues for any queues which
have jobs waiting for them.  It is the only option which checks
"all queues".

If you do not specify '-a', then lpq will check only one queue
for print jobs.  By default, that single queue will be the one
named 'lp', unless you have defined and exported the environment
variable "PRINTER".  In that case, it will check whatever single
queue is specified by PRINTER.

The same is true for 'lprm'.  It will only look at one single queue
for the job or jobs that you are trying to remove.

Now, it does work if (and only if) I enter the following:

lprm -Plsjd1p2 13

spxdev:root# lprm -Plsjd1p2 13
dfA013spxdev.servplex.com dequeued
cfA013spxdev.servplex.com dequeued
(LPD Server):
Cancel Function Not Supported
spxdev:root#

It does actually remove the print job but still gives the
Cancel Function  Not Supported message...
The "Cancel Function Not Supported" message does not come from
lprm or lpd.  The queue named lsjd1p2 is probably pointing at
some remote machine (either the printer itself, or maybe a print
server that is between you and the printer).  Given the look of
that error message, I would guess that you're talking to the
printer itself, or an LPD server which is running on some flavor
of Windows.

When removing jobs, lpd first removes any jobs on the local
machine which match the criteria you gave.  It then sends the
exact same criteria on to the remote host, so it can delete any
jobs which match your request.  In this case, the local host was
able to delete the one job, and when it asked the remote machine
to delete the same job, the remote machine said that it does not
support the cancelling of any jobs.

--
Garance Alistair Drosehn            =   [EMAIL PROTECTED]
Senior Systems Programmer           or  [EMAIL PROTECTED]
Rensselaer Polytechnic Institute    or  [EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to