On Mon, Mar 04, 2002 at 05:00:26PM -0800, Patrick Powell wrote:
> PGPPASS=IlikeCarTalk
Time to change that, I guess. :) Maybe something like IHatePrintenv.
> 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
Yup. I understand the way it recursively retrieves each printcap entry,
be it for a printer or a tc.
root@silicate# ll /tmp/lookup
-rw-rw-rw- 1 root root 213 Mar 4 19:52 /tmp/lookup
root@silicate# cat /tmp/lookup
DBSERVER 26608 /etc/lprng/dblookup
PWD=/
LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib
LOGDIR=/root
USER=root
LANG=en_US
LOGNAME=root
SHLVL=1
SHELL=/bin/sh
IFS=
HOME=/root
PATH=/bin:/usr/bin
_=/usr/bin/printenv
---EOF--- ... blocked on read (cat) here.
root@silicate# ps ax # snipped
26605 pts/1 S 0:00 lpd MAIN
26606 ? S 0:00 lpd Waiting
26607 ? S 0:00 lpd SERVICEALL
26608 ? S 0:00 /bin/sh /etc/lprng/dblookup
26610 ? S 0:00 /bin/cat
The cat in your test script is blocked on read(), waiting for lpd
SERVICEALL to write 'all' into the pipe, which it never does.
I can't figure it out... the code is the same for lpq and lpd,
Get_all_printcap_entries(), except lpq works and lpd does not.
The only difference is the IFS. Yours is [space][tab] and mine is
[space][tab][newline].
More debugging:
27577 pts/1 S 0:00 strace -ofoo -f lpd
27579 ? S 0:00 lpd Waiting
27580 ? S 0:00 lpd SERVICEALL
27581 ? T 0:00 /bin/sh /etc/lprng/dblookup
27583 ? S 0:00 /bin/cat
Running lpd under strace -f, I see:
27580 open("/tmp/temp00QSDQJd", O_RDWR|O_CREAT|O_EXCL, 0600) = 5
27580 fchmod(5, 0600) = 0
27580 stat64("/tmp/temp00QSDQJd", {st_mode=S_IFREG|0600, st_size=0,
...}) = 0
27580 stat64("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=20480, ...})
= 0
27580 gettimeofday({1015303034, 65798}, NULL) = 0
27580 getpid() = 27580
27580 open("/tmp/temp01amNlyj", O_RDWR|O_CREAT|O_EXCL, 0600) = 6
27580 fchmod(6, 0600) = 0
27580 stat64("/tmp/temp01amNlyj", {st_mode=S_IFREG|0600, st_size=0,
...}) = 0
27580 write(5, "all", 3) = 3
27580 write(5, "\n", 1) = 1
27580 lseek(5, 0, SEEK_SET) = 0
Why lpd SERVICEALL is writing to a temporary file rather than a pipe, I
don't know.
More debugging....
Ok, I have found the problem, I think. There's some ugly interaction
between LPRng's lpd and LDAP, specifically libnss-ldap. This is
interesting...
With nsswitch.conf like this, lpd doesn't write() into the pipe.
passwd: files ldap
shadow: files ldap
group: files ldap
Removing ldap from the above lines causes lpd to work correctly.
Argggh!!!!
Any ideas?
Luca
--
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
-----------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------