From owner-freebsd-hackers Mon Nov 25 15:46: 1 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8B99837B401 for ; Mon, 25 Nov 2002 15:45:58 -0800 (PST) Received: from mail.rpi.edu (mail.rpi.edu [128.113.22.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9EC9843EAA for ; Mon, 25 Nov 2002 15:45:57 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.12.1/8.12.1) with ESMTP id gAPNjpjh194784; Mon, 25 Nov 2002 18:45:52 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20021125160202.05d75190.gclarkii@vsservices.com> References: <20021125160202.05d75190.gclarkii@vsservices.com> Date: Mon, 25 Nov 2002 18:45:50 -0500 To: GB Clark , freebsd-hackers@FreeBSD.ORG From: Garance A Drosihn Subject: Re: Fw: lpd and lprm broken? Cc: Peter Elsner Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: MIMEDefang 2.3 (www dot roaringpenguin dot com slash mimedefang) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 11/25/02, Peter Elsner 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 = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message