[cups.general] viewing jobs in distant queue

Johannes Meixner jsmeix at suse.de
Wed May 31 23:55:08 PDT 2006


Hello,

On May 31 10:41 Frédéric Buelens wrote (shortened):

> DeviceURI lpd://lpserver/c226
... 
> I'd like to know if there are some ways to display the distant
> lpd queues state locally with lpq.

Not with the lpq command of CUPS because this "speaks" only IPP.

You would need a lpq binary which "speaks" LPD protocol
(e.g. the lpq binary from LPRng) but then you must take care
that you install the LPRng stuff into different directories or
use different file names to avoid overwriting the CUPS binaries.

Alternativerly you can query the queue state from a LPD
on a (remote) host directly using a simple command like

echo -en "\004$QUEUE\n" | netcat -w $TIMEOUT -p $PORT $HOST 515

where $QUEUE is the (remote) queue name,
$PORT is the local port which may have to be in the range 721-731
if the LPD is strictly RFC 1179 (Line Printer Daemon Protocol)
compliant (then only root can execute the above command),
$HOST is the IP of the (remote) host where the LPD runs,
"\004$QUEUE\n" is a LPD protocol request for a long status report
and "\003$QUEUE\n" would result a short status report,
for details see http://www.ietf.org/rfc/rfc1179.txt

Note that subsequent calls of the command may fail as long as a
TCP connection using $PORT still exists e.g. for several seconds
in the state TIME_WAIT (use "netstat -nap | grep 515" to display
the TCP connections). If the LPD accepts any source port, it works
better to omit "-p $PORT" at all.

By the way:
If you use Suse Linux, have a look at
/usr/lib/YaST2/bin/test_remote_lpd

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