|

How to set up lpd/lpr printing in a BSD-based system
Note: You need super user (root) access to your UNIX system for this procedure.
The BSD spool (printer) system is used by SunOS, IRIX, Digital, SCO, FreeBSD, NetBSD and Linux UNIX systems.
The commands used in BSD spool systems are:
- lpr, a user command which puts a job into a queue.
- lpq, a user command which lists jobs in a queue.
- lprm, a user command which removes jobs from a queue.
- lpc, an administrative utility to start, stop etc. the queue.
- lpd, a system daemon program which is responsible for sending jobs from the spool directory to the printer /etc/printcap, the file where the printer definitions are stored.
To install a printer:
- Ensure that the lpd is running.
- Add a printer entry in the /etc/printcap file.
The following example definition is made for a PrintServer configured with the IP address 172.16.100.10
Note: Remember to change the 'rm' tag to the IP address or hostname of your PrintServer. An entry should, as a minimum define the 'rm' (remote host), 'rp' (remote printer) and 'sd' (spool directory) tags.
PrintServer01:\
:sd=/var/spool/lpd/PrintServer01:
:rm=172.16.100.10:\
:rp=LPDPRT1:\
The entry could also look like this example from a definition of a printer on a Linux host. Please make sure that the
filter
file, defined with the
if
tag, resides in the
/var/spool/lpd/hp/
directory, else you have to get it from your distribution disks.
PrintServer01:\
:sd=/var/spool/lpd/PrintServer01:\
:mx#0:\
:sh:\
:rm=172.16.100.10:\
:rp=LPDPRT1:\
:if=/var/spool/lpd/hp/filter:
- Create a spool directory for the printer (the
sd
tag from /etc/printcap file)
# cd /var/spool/lpd
# mkdir PrintServer01
# chown daemon.daemon PrintServer01
# chmod 755 PrintServer01
- Enable the queue, using lpc
# lpc up PrintServer01
- Print a test job
# lpr -PPrintServer01 test.prn
|