1.107.2 Manage printers and print queues Weight 1

Linux Professional Institute Certification — 102

               Geoff Robertson <ge@ffrey.com>
              Nick Urbanik <nicku@nicku.org>

2005 July

Description of Objective

Candidates should be able to manage print queues and user print jobs. This objective includes monitoring print server and user print queues and troubleshooting general printing problems.

Key files, terms, and utilities include:

/etc/printcap
lpc
lpq
lprm
lp

– General Linux 2 – Manage Printers & Print

Queues [2mm] (Linux Professional Institute Certification)[1mm]

1

1Copyright \begin{matrix}c \\ ◯ \end{matrix} 2002 Geoffrey Robertson. Permission is granted to make and distribute verbatim copies or modified versions of this document provided that this copyright notice and this permission notice are preserved on all copies under the terms of the GNU General Public License as published by the Free Software Foundation—either version 2 of the License or (at your option) any later version.

\underline{2}

   .~.          Slides for a talk by Andrew Eager
   /V\          geoffrey robertson
  // \\         geoffrey@zip.com.au
  @._.@
$Id: gl2.107.2.slides.tex,v 1.2 2003/08/20 14:00:22 geoffr Exp $

Manage printers & print queues 1.107.2

Manage printers & print queues 1.107.3 Print files 1.107.4 Install & configure local & remote printers

Manage printers & print queues

Candidates should be able to manage print queues and user print jobs. This objective includes monitoring print server and user print queues and troubleshooting general printing problems.

Manage printers & print queues lpc Printing control lpq Display Print queue lprm Job removal lpr Job submission /etc/printcap - Configuration file

Printing-HOWTO Printing-Usage-HOWTO

LPC - Printer Control • LPC Is used to control a printer or print job

• Can be run interactively.

• Usage is:

     lpc [command [argument]]

\underline{3}

LPC - Printer Control Example 1 - Non Interactive:

# lpc status
 Printer             Printing Spooling Jobs  Server Subserver
lp@Node4              enabled  enabled     0     none     none

Example 2 - Interactive

# lpc
lpc> status
 Printer             Printing Spooling Jobs  Server Subserver
lp@Node4              enabled  enabled     0     none     none
lpc> quit

LPC Commands

For a complete list of commands, use the command lpc help. Some of the more important commands to know are: abort - Immediately terminate active spool & disable printing disable - Stop spooling for this printer enable - Start spooling for this printer down - Disable spooling & printing up - Enable spooling & printing stop - Stop printing after current job is complete start - Enable spooling & start printing quit - Exit from interactive mode help - Show all commands

LPQ - Display Printer Queue • Every print job is assigned a job-id

• You need the job-id to remove or reorder a job in the queue

• lpq shows the job-id along with information about the job. Usage is:

# lpq [-P printer] [Job-id]

\underline{4}

LPQ - Example Example - Show all jobs on default Queue

# lpq
Printer: lp@Node4 'lp0' (dest HPLjet@node10.aes)
 Queue: 2 printable jobs
 Server: pid 27354 active
 Unspooler: pid 27356 active
 Status: waiting for subserver to exit at 12:22:58.553
 Rank   Owner/ID         Class Job Files   ....
 1       root@Node4+353      A   353 /etc/hosts ....
 2       root@Node4+357      A   357 /etc/ntp.conf ....
Printer: HPLjet@Node10 'lp0' (printing disabled ...

LPRM - Remove job(s) from Queue

• lprm is used to remove jobs from a queue

• jobs can be removed by:

– by job-id (use lpq to find out)

– by user

Usage is:

# lprm [-P printer] [Job-id ...] [user ...]

LPRM - Example Example - Remove all jobs owned by root

# lprm root
Printer lp@Node4:
  checking perms 'root@Node4+353'
  dequeued 'root@Node4+353'
  checking perms 'root@Node4+357'
  dequeued 'root@Node4+357'
Printer HPLjet@Node10:
# lpq

\underline{5}

License Of This Document Copyright (C) 2005 Nick Urbanik <nicku@nicku.org> You can redistribute modified or unmodified copies of this document provided that this

copyright notice and this permission notice are preserved on all copies under the terms of the GNU General Public License as published by the Free Software Foundation–either version 2 of the License or (at your option) any later version.