The very minimum needed in
/etc/printcap
lp:\
:sd=/path_to_spool_dir:\
:rm=ip address or name of printer:\
:rp=name of queue:
example GP200e (with EFI Controller)
lp:\
:sd=/var/spool/lpd/gp200e:\
:rm=192.168.10.21:\
:rp=print_200-216:
The distribution of Linux I tested was Mandrake 6.1 and it uses BSD printing using LPR/LPD from RFC1179.
LPD - Line Printer Daemon - spooling daemon - one runs to control
everything on a machine and one is running per printer while it is
printing.
LPR - Line Printer Request - lpr contacts lpd and injects a new print
job into the spool.
LPQ - Line Printer Queue - lists the jobs in the queue.
LPC - Line Printer Control - lpd system control command.
LPRM - Line Printer ReMove - removes job from print spool.
LPD
To start daemon type lpd at prompt.
To check if lpd is running type ps -e |grep lpd
LPR
To print a file, at the prompt type lpr [options] [filename]
To print STDOUT command |lpr [options]
NOTE: lpr -f does not work on Canon equipment. It filters out the escape codes. You should use lpr -l (See RFC1179 for more information)
LPQ
To get the status of a printer and its queue type lpq -Pprinter_name
LPC
lpc abort printer_name - terminates an active spooling daemon on
the local host immediately and then disables printing. It does not
remove any jobs from the queue.
lpc stop printer_name - halts a spooling daemon after current job
completes and disables printing. Jobs can still be submitted to
the queue.
lpc start printer_name - enables printing
lpc restart printer_name - restarts printer daemons
lpc disable/enable printer_name - allow spooling in the local
queue to be turned off/on. This will prevent/allow lpr from
putting new jobs in the spool queue. Although root can still use
lpr, users can not.
lpc topq printer_name job#/user - place job at top of print
queue.
lpc status printer_name - display status of daemons and queues on
local machine.
lpc down printer_name [message] - turn the specified printer off,
disable printing and put [message] in the printer status file.
lpc up printer_name - undoes the effects of down.
lpc clean printer_name - remove any temp, data, or control files
that can not be printed from queue.
LPRM
lprm -Pprinter_name job# - removes job# from queue. To get
job# use the lpq command
/etc/printcap
The default printer is normally lp. The environment variable PRINTER may be used to override this. The printer name lp can only be used in one entry.name:
Aliases are separated using a pipe. The default printer with
aliases would look like :
lp|canon|gp200e:\lp:
:lp=:\sd:
:sd=/var/spool/lpd/canon:\lf:
:lf=/var/log/canonerrs.log:\rm:
:rm=192.168.10.21:\ or :rm=gp200e:\rp:
:rp=print_200-216:\mx:
:mx#0:\sh:
:sh:\if:
:if=/var/spool/lpd/canon/filter:\: and :\
example entry in /etc/printcap
lp|canon|gp200e:\Filtering:lp=:\
:sd=/var/spool/lpd/canon:\
:lf=/var/log/canonerrs.log:\
:rm=192.168.10.21:\
:rp=print_200-216:\
:mx#0:\
:sd:\
:if=/var/spool/lpd/canon/filter:
#!perl
# The above line should really have the whole path to perl
# This script must be executable: chmod 755 filter
while(<STDIN>){chop $_; print "$_\r\n";};
# You might also want to end with a form feed: print "\f";
I tested this on a gp200f and it worked great. You don't need
the form feed at the end for our products.
If you find an error or wish to comment please let me know