> From [EMAIL PROTECTED] Sun Mar  3 21:41:06 2002
> Date: Sun, 3 Mar 2002 21:01:00 -0800
> From: Luca Filipozzi <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: LPRng: lpd_printcap_path=|/some/filter
>
> Hello Patrick et al,
>
> I'm trying to use printcap_path as described in section 12.18 of the
> LPRng HowTo, "Using Programs To Get Printcap Information".  I have
> created scripts similar to (but more powerful than) those suggested by
> Sven Rudolph in section 12.18.2 and am now able to perform lookups of
> printcap entries, printers or tc, via NIS using any of the client
> programs: lpc, lpq, checkpc, etc. 
>
> What *doesn't* work is lpd.  I have tried both printcap_path and
> lpd_printcap_path with my ypmatch-enabled printcap filter and have done
> some debugging.  It very much looks like lpd isn't writing into the pipe
> attached to the stdin of the printcap filter.  Using ps, I can see that
> lpd spawns a child to talk to the printcap filter and I can see that my
> printcap filter is instantiated... but that's where things stop.  The
> printcap filter never receives anything over the pipe!
>
> Do you have any ideas regarding this problem?  Was lpd intended to talk
> to a filter like the client programs?  Am I missing something obvious?
>
> Thanks for your help,
>
> Luca
>
> PS: I'm using 3.8.8.
> PPS: If people are interested, I can provide the scripts.  Eventually, I
> was going to provide them to Patrick for inclusion into the HOWTO at his
> discretion.
>
> -- 
> Luca Filipozzi, ECE Dept. IT Manager, University of British Columbia
> [dpkg] We are the apt. You will be packaged. Resistance is futile.
> gpg key 5A827A2D - A149 97BD 188C 7F29 779E  09C1 3573 32C4 5A82 7A2D
>

Here is a quick and dirty way to tell if this is working.

Note: are you sure you set the PATH stuff? Make sure you have
the EXPORT path or bad things happen?


a ) set up a dummy printcap file so you have
something:

/etc/printcap

b) set up the following script as /tmp/dblookup

#!/bin/sh
PATH=/bin:/usr/bin
export PATH
echo DBSERVER $$ $0 $* >>/tmp/lookup
printenv >>/tmp/lookup
/bin/cat >>/tmp/lookup
cat /etc/printcap

chmod 755 /tmp/dblookup
touch /tmp/lookup
chmod 666 /tmp/lookup

c) edit the /etc/lpd.conf file:

printcap_path=| $- /tmp/dblookup

d) restart LPD

killall lpd or whatever

lpd

e) cat /tmp/lookup -

DBSERVER 91398 /var/tmp/LPD/dbserver /var/tmp/LPD/printcap
USER=papowell
LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib
HOME=/home/papowell
LOGNAME=papowell
PATH=/bin:/usr/bin
SHELL=/bin/sh
LOGDIR=/home/papowell
PGPPASS=IlikeCarTalk
IFS=
all

^^^^ this 'all' should cause lpd to get an 'all' printcap entry
such as

all:all=t11,t2,t3.....

so it knows the list of printers.  It will then query them
one at a time for queue information:

lpq -Pt1

tail /tmp/all

DBSERVER 91409 /var/tmp/LPD/dbserver /var/tmp/LPD/printcap
USER=papowell
LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib
HOME=/home/papowell
LOGNAME=papowell
PATH=/bin:/usr/bin
SHELL=/bin/sh
LOGDIR=/home/papowell
PGPPASS=IlikeCarTalk
IFS=
PRINTER=t1
t1

^^^^ lpd asked for t1 information

Hope this helps.

Hope this helps.

Patrick




-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address

If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:                           | example:
subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------

Reply via email to