Printers disappearing
Magnus Svavarsson
magnus at hum.auc.dk
Tue Apr 28 12:43:01 GMT 1998
Hi
The problem with dissappearing printers is an old one. I made some
posting way back when I had struggled with this problem, and solved it.
The problem is in printing.c, in the function parse_lpq_entry(). It does
return LPSTAT_ERROR in some cases. This makes NT drop the printer, and I
guess that is the same thing happening with win95. The quick "fix" is
to return LPSTAT_STOPPED instead of LPSTAT_ERROR. I am not quite aware of
the meaning of it, though. Can anyone explain this?
The problem occurs of the string "error" (and a few others, as I remember)
is a part of the lpq output. If you check the ftp address below, you can
see my changes to the stat1_strings variable. I can not remember what
influence this had, exectly. (I have not had problems for over a year...)
I do not believe that those changes ever made it to the source. I have
some other changes in the distribution printing.c, but I do not believe
that they address this specific problem. IT is only for the "lprng"
support.
The fix I have been using for the last year or so is this:
In smb.conf:
lpq command = /dist/bin/lpq.smb -P%p
cat /dist/bin/lpq.smb
#!/bin/sh
/coll/local/bin/lpq $* |\
/bin/egrep -v "error|zero length control file" |\
awk '{print substr($0,1,65)" "substr($0,66)}' |\
sed 's,/var/spool/pcnfs/\([^/]*\)/,/var/spool/pcnfs/\1:,'
It is the egrep -v that fixes the dissappearing printers problem.
You can see my patch (old!) at
ftp://ftp.hum.auc.dk/pub/Magnus_Svavarsson/Samba
I hope this can help.
/Magnus
----------------------
Magnus Svavarsson
Network Administrator
Faculty of Humanities
Aalborg University
More information about the samba
mailing list