Subject: Re: Stupid printer question
To: None <current-users@NetBSD.ORG>
From: D'Arcy J.M. Cain <darcy@druid.druid.com>
List: current-users
Date: 09/22/1996 13:31:54
Thus spake Jukka Marin
> > You should setup your "filter" as the input filter.

I don't think that's even supposed to work.  I think the if is used to
track usage if I read the man page correctly.

> If I use something like
> 
> lp:\
>         :lp=:rm=remote.machine:rp=printerqueue:\
>         :sd=/var/spool/lpd:\
>         :lf=/var/log/lpd-errs:\
>         :if=/usr/local/bin/pfilt:\
>         :mx#0:sf:sh:rs:
> 
> it seems that the data isn't going through pfilt at all (pfilt doesn't
> get run) but sent to the remote printer as-is.  Is this a bug or a
> feature?  I think it's either a bug or I'm doing something stupid.

I had this exact problem.  What you have to do is create two printers
in your termcap.  One is a raw interface to the remote filter (seemingly
the only kind possible) and the other is an interface to a pseudo device
with your filter as the output filter.  Your filter should in turn write
to the first printer - the raw one to the remote printer.  I just used
popen("/usr/bin/lpr -P lj5si", "w") where lj5si was the remote printer.

One issue is the name of the lp device.  /dev/null would be the
obvious choice but I haven't looked at lpd to figure out what it does
for locking.  If it ises the lp device name then you may have a problem.
I sidestepped the whole issue by using /dev/lp.lj5si.

> Besides, if you have a comment in /etc/printcap ending with backslash,
> it seems to confuse lpr/lprm/lpq.  This _is_ a bug, isn't it? ;)

What's a comment?   :-)

-- 
D'Arcy J.M. Cain                           |  Democracy is three wolves
darcy@{druid.com|greenlight.ca}            |  and a sheep voting on
+1 416 943 5281     (DoD#0082)    (eNTP)   |  what's for dinner.
  --  Home: http://www.druid.com/      Work: http://www.greenlight.ca  --