[cups.general] lpstat -o for ipp-printers

Johannes Meixner jsmeix at suse.de
Tue Jan 23 01:35:25 PST 2007


Hello,

On Jan 22 10:30 Christoph Litauer wrote:
> I wonder if it's possible to get the printer status of remote ipp
> printers, served by a cups service and used by another cups daemon
> running on another machine, e.g.:
> 
> - cups 1.1.23 running on 'printhost' offers 50 printers
> - cups 1.1.23 running on 'somehost' learned these printers
> 
> somehost $ lpstat -v | grep myprinter
> device for pdfmail: ipp://printhost:631/printers/myprinter
> 
> somehost $ lpstat -o myprinter
> somehost $
> 
> somehost $ env CUPS_SERVER=printhost lpstat -o myprinter
> myprinter-14648   user1    12959744   Mon Jan 22 15:58:01 2007
> myprinter-14658   user2      524288   Mon Jan 22 16:00:27 2007

As far as I see there is a dilemma:

By default lpstat requests are not automatically forwarded
to a remote server if the request is about a remote queue
so that "lpstat ..." is the same as "lpstat -h localhost ..."
and for me this looks correct because when you don't specify
the server it seems a reasonable default that the info about
the "nearest" queue is shown.

On the other hand it may be also a reasonable default when
"lpinfo" would automatically follow remote queues and shows
by default the info about the "remotest" queue.
But now the drawback is that it may take arbitrary time
until "lpinfo" returns with the info (think about a remote
IPP printer which is switched off - how long should "lpinfo"
wait until a timeout happens?).

Therefore I think it is perfectly o.k that "lpstat -o queue"
is the same as "lpstat -h localhost -o queue" and if you
want to query whichever other server you can use
"lpstat -h server -o queue".

You wrote "'somehost' learned these printers" which indicates
that there are no queues on 'somehost' but 'somehost' got the
queue names from 'printhost' via CUPS Browsing.

Here it looks as if "lpstat" works a bit inconsistent because
"lpstat -p" seems to show the remote queues but on the other
hand "lpstat -o" does not show the jobs in the remote queues.

But I think actually "lpstat" works correctly here too
because compare for example what "lpstat -v" shows and
what "lpstat -h server -v" shows.
Actually "lpstat -p" does not show the queues on the remote
machine but it shows what the local cupsd knows about the
remote queue (i.e. what the local cupsd had learned via
CUPS Browsing about the remote queues).
Accordingly "lpstat -o" does not show the jobs in the
remote queues but it shows what the local cupsd knows
about print jobs (and usually there are no pending jobs
for the local cupsd because they were already forwarded
to the remote queue).

I agree that this may be confusing for unexperienced users.

When you have only one CUPS server and when you don't have
local printers connected to client machines, I recommend
what I call a "Client-only configuration" (I don't know
if there is an "official" CUPS name for this kind of setup),
see for example
http://en.opensuse.org/SDB:CUPS_in_a_Nutshell
Then there is no longer any confusion which server is actually
responding.


Kind Regards
Johannes Meixner
-- 
SUSE LINUX Products GmbH, Maxfeldstrasse 5      Mail: jsmeix at suse.de
90409 Nuernberg, Germany                    WWW: http://www.suse.de/





More information about the cups mailing list