Section 24.3. Printing (Topic 1.107)


24.3. Printing (Topic 1.107)

24.3.1. Objective 2: Manage Printers and Print Queues

  • Printers are assigned to queues, which are managed by lpd, the print daemon. lpd listens for inbound print requests, forking a copy of itself for each active print queue.

  • lpr submits jobs to print queues.

  • lpq queries and displays queue status.

  • lprm allows jobs to be removed from print queues.

  • lpc allows root to administer queues; it has both interactive and command-line forms.

  • Filters translate data formats into a printer definition language.

  • Spool directories hold spooled job data.

24.3.2. Objective 3: Print Files

  • Files are printed with the lpr command:

     # lpr /etc/lilo.conf # man -t 5 myfile.txt | lpr -Pqueue2 

24.3.3. Objective 4: Install and Configure Local and Remote Printers

24.3.3.1. /etc/printcap
  • New printer definitions are added to /etc/printcap:

     lp|ljet:\         :sd=/var/spool/lpd/lp:\         :mx#0:\         :sh:\         :lp=/dev/lp0:\         :if=/var/spool/lpd/lp/filter:         :lf=/var/spool/lpd/lp/log: 

    The lines in this example are defined as follows:


    lp|ljet:\

    This parameter defines two alternate names for the printer, lp or ljet.


    sd=spool_directory

    This parameter specifies the spool directory, under /var/spool/lpd.


    mx=max_size

    The maximum size of a print job in blocks. Setting this to #0 indicates no limit.


    sh

    Suppress header pages. Placing this attribute in printcap sets it, eliminating the headers.


    lp=printer_device

    The local printer device, such as a parallel port.


    if=input_filter

    The input filter to be used. See "Filters" in Chapter 15 for additional information.


    lf=log_file

    The file where error messages are logged.

24.3.3.2. Filters
  • APSfilter is implemented as executable scripts. Installation configures /etc/printcap automatically. Multiple queues may be defined to give the user access to specific printer capabilities.

  • Magicfilter is a binary program; installation does not automatically create print queues.

24.3.3.3. Remote queues and Samba printers
  • Printing on a remote system or network printer is done through a local queue. /etc/printcap for the local queue looks something like this:

     rlp:\         :sd=/var/spool/lpd/rlp:\         :rm=lphost:\         :rp=rlp:\         :mx#0:\         :sh:\         :if=/usr/local/bin/magicfilter    : 

  • Printing to Windows printers is similar and uses the smbprint filter:

     winpr:\         :sd=/var/spool/lpd/winpr:\         :mx#0:\         :sh:\         :if=/usr/bin/smbprint: 



LPI Linux Certification in a Nutshell
LPI Linux Certification in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596005288
EAN: 2147483647
Year: 2004
Pages: 257

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net