11.6. Running an if for remote printers with old LPDs
11.6. Running an if for remote printers with old LPDs
One oddity of older versions of lpd is that the if
is not run for remote printers. (Versions after 0.43 or so have
the change originated on FreeBSD such that the if
is always run). If you find that you need to run anif for a remote printer, and it isn't working
with your lpr, you can do so by setting up a double queue and
requeueing the job. As an example, consider thisprintcap:
lj-5:\
:lp=/dev/null:sh:\
:sd=/var/spool/lpd/lj-5:\
:if=/usr/lib/lpd/filter-lj-5:
lj-5-remote:sh:rm=printer.name.com:\
:rp=raw:sd=/var/spool/lpd/lj-5-raw:
|
in light of this
filter-lj-5 script:
#!/bin/sh
gs <options> -q -dSAFER -sOutputFile=- - | \
lpr -Plj-5-remote -U$5
|
The -U option to lpr only works if lpr is run
as daemon, and it sets the submitter's name for the job in the
resubmitted queue correctly. You should probably use a more
robust method of getting the username, since in some cases it is
not argument 5. See the man page for
printcap
.