Subject: Re: local filters and remote printer with lpd
To: Matthias Buelow <mkb@mukappabeta.de>
From: Dr R.S. Brooks <R.S.Brooks@liverpool.ac.uk>
List: netbsd-help
Date: 04/04/2001 11:09:36
On Wed, 4 Apr 2001, Matthias Buelow wrote:

>"Jeremy C. Reed" <reed@reedmedia.net> writes:
>
>>I am trying to configure lpd so it will process the data locally before
>>sending it to a remote server (which has the printer).
>
>That doesn't work with the NetBSD lpd (or with any BSD-derived lpds
>that haven't been modified to support this) since for some obscure
>reason, the implementors of lpd explicitly disabled use of local
>filters for remote printers and there is no way to re-enable it,
>quoting printcap(5):
>
>FILTERS
>     If a printer is specified via lp (either local or remote), the lpd(8)
>     daemon creates a pipeline of filters to process files for various printer
>     types.  The pipeline is not set up for remote printers specified via rm
>             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     unless the local host is the same as the remote printer host given.  The
>     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

One way of gettting round this with the standard BSD lpd is to set up
two queues (call them 'local' and 'remote').  The 'local' queue has
:lp=/dev/null: and an if which is a shell script which you provide.
This should do whatever filtering you want, and pipe the output to

	lpr -P remote

which sends it to the remote queue.  AFAIR, BSD lpd runs all the filters
as root, so you can pick up the real user from the args to the if
and use su to run the lpr as that user.

It's a bit of a messy solution, in that doing lpq on the local queue
won't show you the remote queue, but it will get round your problem.


Roger

------------------------------------------------------------------------------
Roger Brooks (Systems Programmer),          |  Email: R.S.Brooks@liv.ac.uk
Computing Services Dept,                    |  Tel:   +44 151 794 4441
The University of Liverpool,                |  Fax:   +44 151 794 4442
PO Box 147, Liverpool L69 3BX, UK           | 
------------------------------------------------------------------------------