– General Linux 2 – Manage Printers & Print Queues (Linux Professional Institute Certification) a .˜. /V\ // \\ @._.@ Slides for a talk by Andrew Eager geoffrey robertson geoffrey@zip.com.au $Id: gl2.107.2.slides.tex,v 1.2 2003/08/20 14:00:22 geoffr Exp $ c 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. a Copyright 1 Manage printers & print queues 1.107.2 Manage printers & print queues 1.107.3 Print files 1.107.4 Install & configure local & remote printers 2 Manage printers & print queues 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. 3 Manage printers & print queues Key files, terms, and utilities lpc Printing control lpq Display Print queue lprm Job removal lpr Job submission /etc/printcap - Configuration file 4 Resources of interest Printing-HOWTO Printing-Usage-HOWTO 5 LPC - Printer Control • LPC Is used to control a printer or print job • Can be run interactively. • Usage is: lpc [command [argument]] 6 LPC - Printer Control Example 1 - Non Interactive: # lpc status Printer lp@Node4 Printing Spooling Jobs enabled enabled 0 Server Subserver none none Example 2 - Interactive # lpc lpc> status Printer lp@Node4 lpc> quit Printing Spooling Jobs enabled enabled 0 Server Subserver none none 7 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 8 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] 9 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 .... root@Node4+353 A 353 /etc/hosts .... 1 2 root@Node4+357 A 357 /etc/ntp.conf .... Printer: HPLjet@Node10 ’lp0’ (printing disabled ... 10 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 ...] 11 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 12