Transcript COP 4343
COP 4343
Unix System Administration
Unit 9: printing
– lpr
– CUPS
1
Printing in Unix
• Traditional
– Berkeley Line Printer Daemon
– AT&T Line Printer System
• Improvements:
– typical Linux implementation
– LPRng
• Emerging standard
– Internet Printing Protocol: IPP/1.1
– Common Unix Printing System: CUPS
2
Traditional Linux printing
• PRINTER environment variable
• command line printing: lpr
ex: lpr filename
• print job maintenance
– show print queue: lpq
– remove job from queue: lprm
3
lpd daemon
• configuration
– /etc/printcap
• local or remote printers
– print filters
• queue control per printer
– lpc
• status, start, stop
4
Common Unix Printing System
• CUPS manages printers in a network
– maintains printer definitions
– allows printing to network printers
• maintains lpr commands and
/etc/printcap file for backward
compatibility
5
CUPS device support
lpinfo -v
network socket
network http
network ipp
network lpd
network smb
serial serial:/dev/ttyS2?baud=115200
direct parallel:/dev/lp1
direct usb:/dev/usb/lp0
direct scsi
direct hal
6
CUPS setup
• cups service
– yum install cups
– enable in run-level: chkconfig cups on
– start service: service cups start
• configuration
– /etc/cups/cupsd.conf
• specify which IP:port to listen on
listen on 127.0.0.1:631
• allow access to Location / and /admin
allow from 127.0.0.1
– security: allow tcp port 631 in firewall
7
Common Unix Printing System
• managing CUPS printers
– command line interface:
lpadmin
– old style semi-graphical:
• printconf
– web interface on port 631
http://localhost:631/admin
• printer definitions
– ppd files
8
CUPS printer setup
• printer class
– for sets of similar printers
– jobs accepted to class will print on one
printer in class
• printer setup
– local: device
– network: protocol + host + name
• ex: “lpd://ferret.cs.fiu.edu/venom”
9
CUPS printer setup
• supported printers
– HP, Epson, Okidata, Postscript, ...
• printer options
– output resolution, double-sided, banner, ...
10
CUPS printing
• client
– PRINTER environment variable
– interactive from program
•
•
•
•
lpr or lp
lpq
lprm
lpstat
11