Setting up printing can be frustrating. I find the HOWTO's on lpd to be vague and they never actually walk you through a direct implementation. Add to that the fact that everyone wants to use their own specialized daemon to accomplish the task. So here's a basic setup using our good friend /usr/sbin/lpdwhich is likely to be available on any Linux system you come across. Hopefully it will help you get started, or at least point you on your way.
/usr/sbin/lpd, /usr/sbin/lpc, and /usr/sbin/lptest installed/etc/printcap file (e.g., man printcap)CONFIG_PARPORT, CONFIG_PARPORT_PC, and CONFIG_PRINTER support compiled in your kernel. If you have an EPP/ECP printer port on your Linux box and your printer supports IEEE 1284 transfer modes, you can optionally say yes to CONFIG_PARPORT_1284. You will also need to test basic printer connectivity (it doesn't matter if the resulting test page looks garbled or formats incorrectly) with the command: /usr/sbin/lptest >/dev/lp0/var/spool/lpd./etc/printcap
# Local printer example
lp|hplaser:sh:mx#0:lp=/dev/lp0:sd=/var/spool/lpd/hplaser:if=/etc/lp-filter:lf=/var/spool/lpd/errors:
# Network printer example
hplaser:sh:mx#0:lp=/dev/null:rm=hplaser:rp=hplaser_queue:sd=/var/spool/lpd/hplaser:lf=/var/spool/lpd/errors:# Launch the daemon
/usr/sbin/lpd
# Start the queues
/usr/sbin/lpc start all
# Test the queues
$ lptest 20 5 | lpr -Plp1
/etc/lp-filter and chmod 555. The two printf codes fix "stair-stepping" problems; the final printf command ejects the page once done. Your mileage may vary; most of your research on the Internet will be done to fine-tune this file. Note: If you are trying to get this set up for printing via Samba, you can usually skip this step entirely -- your Windows clients will provide their own drivers! If you now say, "ahh!", the distinction has dawned on you which perhaps was unclear before... congrats! ;-)
#!/bin/sh
# sample /etc/lp-filter
printf "\033&k2G" && /bin/cat && printf "\033&10H" && printf "\f" && exit 0
exit 2
If you will be sharing your printers to other boxes via Samba: Don't worry about getting input filters correct or so forth; you won't (probably) need them as the windows clients will use their own drivers. You need to add the following information to smb.conf:
[global]
printing = bsd
load printers = yes
printcap name = /etc/printcap
[printers]
path = /var/spool/samba
printable = yes
writable = no
guest ok = no
This will allow you to export all printers listed in /etc/printcap.
Again, your mileage may vary. Hopefully this small example helps you get started in your search. Even if you don't use FreeBSD, try reading their Printing information at http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/printing.html for more info.