
![]() |
We have several printers in our student lab and it is very nice to be
able to split the printing between them. Since we run linux
exclusivly, I developed a samba/lpd solution to the problem by using
the output filters (man printcap) available in lpd.
Basically, we have a printcap which looks like this:
pooled:\
:sd=/var/spool/lpd/pool:\
:mx#0:\
:sh:\
:if=/usr/local/bin/lpool:\
:lp=/dev/null:
lp1:\
:sd=/var/spool/lpd/dec1:\
:mx#0:\
:sh:\
:lp=/dev/ttyS1:\
:br=9600:
lp2:\
:sd=/var/spool/lpd/dec2:\
:mx#0:\
:sh:\
:lp=/dev/ttyS0:\
:br=9600:
There are only two "real" printers in this setup (lp1 and lp2), the pooled printer is a dummy which prints to /dev/null and filters all requests through an input filter (/usr/local/bin/lpool). This filter is a simple perl script which will
lpq -P my_printer_name_here And if there isn't anything in the queue, you can copy that text to line 79 of lpool. |