SlideShare a Scribd company logo
Managing Printers
Chapter 14
Chapter Objectives
• Understand printing terminology and concepts.
• Understand print server requirements and configuration.
• Understand print client requirements and configuration.
• Understand how to configure homogeneous printing.
• Understand how to configure heterogeneous printing.
Printing
• Printers
– Managing printing can be quickly summarized in the words of
Calvin (of Calvin and Hobbes):
EWWWWWW,
YUCK,
GROSS!
Printing
• Printing Overview (in a perfect world)
– User creates file, wants to print it.
– User calls system utility (lp, lpr, print) to print out the file.
– The utility sends the print job to a print spooler.
– The print spooler sends the job to the printer.
• Things rarely work this easily!
Printing
• Printers
– Local Vs Remote vs Network printers
• A local printer is one which is connected to “this” system.
– Most local printers are connected to a serial port
(RS/232, USB, or Firewire) or a parallel port.
– The local system needs to know the capabilities of the
printer, and which port the printer is connected to.
– If this system is a print spooler it also has to know what
other systems/users are allowed to send jobs to the
printer.
• A remote printer is a printer connected to “some other” system.
– The local system needs to know what system the
printer is on, how to send the print job to the other
system, and the name of the remote printer.
Printing
• Printers
– A network printer is a printer connected to the network,
but not necessarily associated with any system.
• Network printers include their own spooler, so
all systems on the network could print directly
to the printer.
–This can cause interesting problems.
–Usually have to load vendor drivers on every
system.
–New manufacturers often get this part wrong!
Printing
• Printer Setup (BSD)
– All printing processes are controlled by the lpd daemon, and
the lpr program.
• Lpr accepts input to be printed and places it in a spool directory.
– Lpr selects where to store the print job, based on the
name of the printer the user wants to send the job to.
The print spool area is in /var/spool
– Lpr creates two files in the spool directory for each job.
These files are named cfXXX and dfXXX where xxx is
the print job number.
– The control file (cfXXX) contains reference and
handling information for this print job.
Printing
• Printer Setup (BSD)
– The data file (dfXXX) contains the information to
be printed.
– Once lpr places files in the spool directory, it
notifies lpd that it needs to wake up and print the
job.
– Lpd “finds” the entry in the spool directory and
looks up the printer in the /etc/printcap database.
» The /etc/printcap file contains an entry for each printer
the system has access to.
» The printcap file specifies the printer capabilities, which
machine is the print spooler for the printer, the
names/locations of any filters to be used for this printer,
and line discipline information for this printer.
Printing
• Printer Setup (BSD)
– If printcap says the printer is local, lpd checks to
see if a daemon is running for that printer (or starts
a daemon if none is present).
– Once lpd knows the printer capabilities, and that
this machine is the spooler, lpd creates a series of
pipes between the spool file and the printer device
driver.
» If a filter program is specified for this printer, lpd places
connections to this filter between the print spool area and
the printer.
– The (filtered) data is sent to the printer by the
device driver.
Printing
• Printer Setup (BSD)
–If printcap says the printer is a network printer,
or a remote printer,
» lpd opens a connection to the remote
machine’s lpd, and transfers the data and
control files to the remote machine.
» lpd then deletes the local copies of these files.
Printing
lj254-grayscale:
:sh:
:ml=0:
:mx=0:
:sd=/var/spool/lpd/lj254-grayscale:
:af=/var/spool/lpd/lj254-grayscale/lj254-grayscale.acct:
:lp=|/usr/share/printconf/util/jetdirectprint:
:lpd_bounce=true:
:if=/usr/share/printconf/util/mf_wrapper:
lj254-color:
:sh:
:ml=0:
:mx=0:
:sd=/var/spool/lpd/lj254-color:
:af=/var/spool/lpd/lj254-color/lj254-color.acct:
:lp=|/usr/share/printconf/util/jetdirectprint:
:lpd_bounce=true:
:if=/usr/share/printconf/util/mf_wrapper:
Printing
• Printer and Print Job Management (BSD)
– The lpq command allows the users to view a list of
entries in the print queue. lpq -P name views the
entries for printer referred to as name.
– The lprm command allows a user to remove (their
own) jobs from the print queue.
– The lpc command allows the administrator to manage
the lpr/lpd environment.
• NOTE: lpc has the distinction of winning the “flakiest
program of the year” award five times in 15 years! Lpc
has not been improved (thereby getting it off the honors
list), instead other programs have been released which
are even flakier!
Printing
• Printer and Print Job Management (BSD)
• lpc allows the administrator to:
– enable or disable queuing for a printer.
– enable (start) or disable (stop) printing on a printer.
The abort command is a harsh version of stop
(current job is not completed).
– Declare the printer down or up (these commands
affect both spooling and printing).
– Remove all jobs from a printers queue (clean).
– Move a job to the top of the printers queue (topq).
– Manipulate lpd (restart).
– Get printer status information (status).
Printing
• System V Printing Overview
– User wants to print file and invokes the lp utility.
– lp takes the input and places in the appropriate spool directory.
– lpsched determines when and where the file should be printed.
– lpsched launches a filter to format the output and send it to the
printer.
– So far it looks just like lpr, right?
• The similarities end here!
Printing
• Printer Setup (System V)
• All of the print commands are different between BSD
and System V! To name a few:
– To print a file, use lp -d printer instead of lpr -P printer
– To remove a print job, use cancel instead of lprm
– To obtain print job status, use lpstat instead of lpq
• In order to remain consistently inconsistent, Sun
created lpr, lpc, and lpq programs under Solaris.
These programs are actually wrapper programs which
call the appropriate System V commands and pass
the data off to the lp system.
Printing
• Printer Setup (System V)
• System V printer software defines destinations and
classes of printers.
– A destination is (usually) a particular printer.
» A destination could also be a plain file that you want to
append text to.
» Because lp uses exclusive locks on the printer “device” ,
this capability allows several users to append text to a
file without concurrent access problems.
–A class of printers is a group of destinations.
» If you had two printers in a room, you could set them up
as a class, and lp would print jobs to both printers (the
first free printer gets the next job).
Printing
• System V Printing
– lp is the user-level print command.
– lp (sometimes) copies (and sometimes links) the data to the spool
directory files (/var/spool/lp/request/dest).
– Spool files are labeled xxxn where xxx varies depending on the
OS. n is the print job number.
– lpsched takes the files in the spool directories and sends them to
the appropriate device.
Printing
• Printer and Print Job Management (System V)
– System V UNIX uses the lpadmin command to setup and
administer printers.
– lpadmin is used to add/remove, start/stop, enable/disable printers
much like lpc did in the BSD model.
• Most System V systems want lpsched stopped before lpadmin
commands will work.
• As usual, Solaris had to be different. Solaris wants lpsched
running before lpadmin commands will work.
Printing
• Printer Setup (System V)
• lpadmin comes complete with a bag full of options:
-d dest (make this the default printer)
-x dest (remove printer dest)
-p printer (tells lpadmin which printer to work with)
-v device (append output for printer to file)
-i interface (interface program for printer)
-c class (add printer to class)
-r class (remove class)
-h (printer is hardwired)
-l (printer is login terminal)
-e dest (copy interface for printer to dest)
-m model (copy model for printer to dest)
Printing
• Printer and Print Job Management (System V)
• Once you add a printer with lpadmin, you have to tell the system
to accept requests, and enable printing for that printer.
• Solaris also requires you to set the type of input that can be sent
to a printer (any, simple, postscript, ...).
– This information is used to allow or deny printing based
on the value of the magic number for the data file.
– Programs like Mentor that define their own file types
cause problems with this model.
– You have to write a filter program to convert the “odd”
files into a known/allowed file type in order to print
them!
Printing
#!/bin/csh -f
lpsystem -t bsd -y "OIT print server" print.helios.nd.edu
lpsystem -t s5 -y "CSE print server” babbage.cse.nd.edu
lpadmin -p lp -s print.helios.nd.edu!cse326
lpadmin -p lw384 -s print.helios.nd.edu!cse384
lpadmin -p lj323 -s print.helios.nd.edu!cse323
lpadmin -p eng_lab6 -s print.helios.nd.edu
lpadmin -p eng_lab7 -s print.helios.nd.edu
lpadmin -p eng_color1 -s print.helios.nd.edu
foreach printer (lp eng_lab6 eng_lab7 eng_color1 lj323 lw384 )
lpadmin -p $printer -T unknown -I simple,postscript
enable $printer
accept $printer
end
lpadmin -d lp
Printing
• Printer and Print Job Management (System V)
– System V printing software is a suite of programs to accomplish
what BSD does with 3 programs:
• cancel - remove a print job
• accept/reject - tell system to accept/reject spooling jobs for
printer.
• enable/disable - tell the system to allow/reject printing on this
printer. Job is still spooled, just not printed.
• lpmove - move job to another printer.
• lpstat - get status of print job(s)
lpstat comes with a bag full of options:
-a [list] Reports which print destinations are accepting requests.
-c [list] Report status of all classes and their members.
-d Report status of the system default destination.
-f [list] [-l] Verify [list] the forms recognized by LP print service.
-o [list] Report status of output requests.
-p [list] [-D] [-l] Report status of printers [description] [capabilities].
-P Report paper types.
-r Report the status of the LP request scheduler.
-R Report the position of each job in the print queue.
-s Report a status summary.
-S [list] [-l] Verify the character sets / print wheels.
-t Report all status information.
-u [login-ID-list] Report status of output requests for users.
-v [list] Report printer names and devices.
Printing
• Printing Problems and Solutions
– The two basic print problems are:
• No Output:
– Check the obvious:
» Is the printer on?
» Does the printer have paper, ribbon, toner?
» Is the printer paper jammed?
» Will other jobs print?
– Check the lp user database.
– Determine if the print spooler can talk to the printer.
– Check the printer log files for clues.
Printing
• Printing Problems and Solutions
– Incorrect Output:
• Check the printcap file (or lpadmin) to see if the printer
type is correct.
• Make sure the line discipline matches the printer
settings.
• Look at the filter files and see that they do what you
think they are doing.
• Check the data file for odd character sequences.
Printing
• Printing Problems and Solutions
– Many times printing problems are due to software failures. These
failures fall into two general categories:
• System software failure.
– lpd/lpsched has crashed/burned.
» Use the appropriate commands to stop the lp system,
then restart the lp system and see if the problem
disappears.
» If stop/restart does not work, try removing the first entry
in the queue to see if lpd/lpsched work. If so, the
problem is in the data file.
Printing
• Printing Problems and Solutions
– Data file problems.
• Look for odd character sequences in the file.
• Try printing the file to another printer (same model if
possible).
• Check filter program operation.
• Check job types allowed on the printer.
Printing
• Windows
– Windows also knows about local and remote printers.
• Local printers are almost always connected to a parallel port.
• Local printers are added with the Printer Control Panel (Add
Printer Wizard).
• You will probably need the OS media to install print drivers.
• Remote printers are handled similarly to the UNIX remote
printers, but they require more setup:
– Use the Add Printer Wizard
– Add a printer port (defines remote spooler type)
– Add the printer like it was a local printer.
– If print server is a UNIX host, FIX the setup!
Printing
• Windows
– Windows/DOS wants to send printer control codes to the
printer. These codes are part of the language the printer
uses to speak to the PC.
• Unix does not like these control codes!
– On NT/Win2k systems (Win 95/98 have no TCP print
driver):
• Go to the Document Defaults for the printer.
• Select the Advanced options.
• Select the Postscript Options.
• Set the system so that it does NOT send control codes.
• Set the system so that it does NOT send control-D after
each print job.
Summary
• Configuring and managing printers should be easy.
– Unfortunately, printer setup and management is not as easy as it
should be.
– The lack of standards makes this task a problem for system
administrators.
– Homogeneous printing is the simplest case.
– Heterogeneous printing is the most problematic.
• System administrators should understand how to:
– Configure print services under Windows, BSD and System V.
– Troubleshoot printing problems.
– Configure filters and advanced printing options.

More Related Content

PPT
Ch16 system administration
PPT
Input output in linux
PDF
Board support package_on_linux
Ch16 system administration
Input output in linux
Board support package_on_linux

What's hot (19)

PPT
Chapter 13 - I/O Systems
PPTX
Writing Character driver (loadable module) in linux
PPTX
DEVICE FILE AND INPUT OUTPUT SUBSYSTEMS MANAGEMENT
PDF
Basics of Linux Commands, Git and Github
PPT
Linux io
PPT
101 1.3 runlevels , shutdown, and reboot
PPT
Linuxdd[1]
PPT
101 1.1 hardware settings
PPT
Chapter 6
PPTX
Microx - A Unix like kernel for Embedded Systems written from scratch.
PDF
LINUX System Call Quick Reference
PDF
File000124
PDF
Processes in unix
PDF
Part 04 Creating a System Call in Linux
PPT
Linux Booting Steps
PDF
Linux admin course
PDF
File000128
Chapter 13 - I/O Systems
Writing Character driver (loadable module) in linux
DEVICE FILE AND INPUT OUTPUT SUBSYSTEMS MANAGEMENT
Basics of Linux Commands, Git and Github
Linux io
101 1.3 runlevels , shutdown, and reboot
Linuxdd[1]
101 1.1 hardware settings
Chapter 6
Microx - A Unix like kernel for Embedded Systems written from scratch.
LINUX System Call Quick Reference
File000124
Processes in unix
Part 04 Creating a System Call in Linux
Linux Booting Steps
Linux admin course
File000128
Ad

Viewers also liked (20)

PPT
Ch22 system administration
PPT
Ch13 system administration
PPT
Chapter12 Managing And Implementing Backups And Disaster Recovery
PPT
Chapter10 -- netware-based networking
PPT
Chapter13 -- ensuring integrity and availability
PPT
Chapter11 -- networking with tcpip and the internet
PPT
Ch08 system administration
PPT
Ch04 system administration
PPT
Ch18 system administration
PPT
Ch24 system administration
PPT
Ch20 system administration
PPT
Ch06 system administration
PPT
Chapter15 -- implementing and managing networks
PPT
Ch10 system administration
PPT
Beat Anger
PPT
Ch21 system administration
PPT
Ch23 system administration
PPT
Chapter05 -- networking hardware
Ch22 system administration
Ch13 system administration
Chapter12 Managing And Implementing Backups And Disaster Recovery
Chapter10 -- netware-based networking
Chapter13 -- ensuring integrity and availability
Chapter11 -- networking with tcpip and the internet
Ch08 system administration
Ch04 system administration
Ch18 system administration
Ch24 system administration
Ch20 system administration
Ch06 system administration
Chapter15 -- implementing and managing networks
Ch10 system administration
Beat Anger
Ch21 system administration
Ch23 system administration
Chapter05 -- networking hardware
Ad

Similar to Ch14 system administration (20)

PPT
operating system
PPT
Linux
DOCX
Printing in linux with cups
PPTX
Printing with cups (linux)
PPTX
PPT
PPT
CUPS: Common UNIX Printing System
PDF
OS-UNIT-1-INTRODUCTION.pptx.pdf
PDF
Ericas-Linux-Plus-Study-Guide
PPT
Divya
PPT
Divya
DOCX
Project of deamon process
PDF
Linux Cheat Sheet.pdf
PPTX
Daemons
ODP
ODP
PDF
An Introduction To Linux
PPTX
Linux week 2
PDF
OS_Introduction_1.pdf
operating system
Linux
Printing in linux with cups
Printing with cups (linux)
CUPS: Common UNIX Printing System
OS-UNIT-1-INTRODUCTION.pptx.pdf
Ericas-Linux-Plus-Study-Guide
Divya
Divya
Project of deamon process
Linux Cheat Sheet.pdf
Daemons
An Introduction To Linux
Linux week 2
OS_Introduction_1.pdf

More from Raja Waseem Akhtar (20)

PPS
The prophet's wives
PPS
God is Great
PPS
Namaz ka tareeqa
PPS
Aayat ul qursi
PPT
Indiansoldiers
PPS
2ªwwii how did it fought
PPT
Fun with EMC2
PPS
Jerusalm at night.pps
PPS
From the sky
PPS
Discover the discovery
PPT
Solaris servers sec
PPT
The OSI - seven layers
PPT
Chapter16 - the internet and its tools
PPT
Chapter14 -- networking security
PPT
Chapter12 -- troubleshooting networking problems
PPT
Chapter09 -- networking with unix and linux
PPT
Chapter08 -- network operating systems and windows server 2003-based networking
PPT
Chapter07 -- wa ns and remote connectivity
PPT
Chapter06 -- topologies and access methods
PPT
Chapter04 -- network protocols
The prophet's wives
God is Great
Namaz ka tareeqa
Aayat ul qursi
Indiansoldiers
2ªwwii how did it fought
Fun with EMC2
Jerusalm at night.pps
From the sky
Discover the discovery
Solaris servers sec
The OSI - seven layers
Chapter16 - the internet and its tools
Chapter14 -- networking security
Chapter12 -- troubleshooting networking problems
Chapter09 -- networking with unix and linux
Chapter08 -- network operating systems and windows server 2003-based networking
Chapter07 -- wa ns and remote connectivity
Chapter06 -- topologies and access methods
Chapter04 -- network protocols

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Spectroscopy.pptx food analysis technology
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Cloud computing and distributed systems.
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Encapsulation_ Review paper, used for researhc scholars
Spectroscopy.pptx food analysis technology
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
The AUB Centre for AI in Media Proposal.docx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Cloud computing and distributed systems.
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
The Rise and Fall of 3GPP – Time for a Sabbatical?
Big Data Technologies - Introduction.pptx
Programs and apps: productivity, graphics, security and other tools
Dropbox Q2 2025 Financial Results & Investor Presentation
Advanced methodologies resolving dimensionality complications for autism neur...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Unlocking AI with Model Context Protocol (MCP)
Per capita expenditure prediction using model stacking based on satellite ima...
Reach Out and Touch Someone: Haptics and Empathic Computing
sap open course for s4hana steps from ECC to s4
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy

Ch14 system administration

  • 2. Chapter Objectives • Understand printing terminology and concepts. • Understand print server requirements and configuration. • Understand print client requirements and configuration. • Understand how to configure homogeneous printing. • Understand how to configure heterogeneous printing.
  • 3. Printing • Printers – Managing printing can be quickly summarized in the words of Calvin (of Calvin and Hobbes): EWWWWWW, YUCK, GROSS!
  • 4. Printing • Printing Overview (in a perfect world) – User creates file, wants to print it. – User calls system utility (lp, lpr, print) to print out the file. – The utility sends the print job to a print spooler. – The print spooler sends the job to the printer. • Things rarely work this easily!
  • 5. Printing • Printers – Local Vs Remote vs Network printers • A local printer is one which is connected to “this” system. – Most local printers are connected to a serial port (RS/232, USB, or Firewire) or a parallel port. – The local system needs to know the capabilities of the printer, and which port the printer is connected to. – If this system is a print spooler it also has to know what other systems/users are allowed to send jobs to the printer. • A remote printer is a printer connected to “some other” system. – The local system needs to know what system the printer is on, how to send the print job to the other system, and the name of the remote printer.
  • 6. Printing • Printers – A network printer is a printer connected to the network, but not necessarily associated with any system. • Network printers include their own spooler, so all systems on the network could print directly to the printer. –This can cause interesting problems. –Usually have to load vendor drivers on every system. –New manufacturers often get this part wrong!
  • 7. Printing • Printer Setup (BSD) – All printing processes are controlled by the lpd daemon, and the lpr program. • Lpr accepts input to be printed and places it in a spool directory. – Lpr selects where to store the print job, based on the name of the printer the user wants to send the job to. The print spool area is in /var/spool – Lpr creates two files in the spool directory for each job. These files are named cfXXX and dfXXX where xxx is the print job number. – The control file (cfXXX) contains reference and handling information for this print job.
  • 8. Printing • Printer Setup (BSD) – The data file (dfXXX) contains the information to be printed. – Once lpr places files in the spool directory, it notifies lpd that it needs to wake up and print the job. – Lpd “finds” the entry in the spool directory and looks up the printer in the /etc/printcap database. » The /etc/printcap file contains an entry for each printer the system has access to. » The printcap file specifies the printer capabilities, which machine is the print spooler for the printer, the names/locations of any filters to be used for this printer, and line discipline information for this printer.
  • 9. Printing • Printer Setup (BSD) – If printcap says the printer is local, lpd checks to see if a daemon is running for that printer (or starts a daemon if none is present). – Once lpd knows the printer capabilities, and that this machine is the spooler, lpd creates a series of pipes between the spool file and the printer device driver. » If a filter program is specified for this printer, lpd places connections to this filter between the print spool area and the printer. – The (filtered) data is sent to the printer by the device driver.
  • 10. Printing • Printer Setup (BSD) –If printcap says the printer is a network printer, or a remote printer, » lpd opens a connection to the remote machine’s lpd, and transfers the data and control files to the remote machine. » lpd then deletes the local copies of these files.
  • 12. Printing • Printer and Print Job Management (BSD) – The lpq command allows the users to view a list of entries in the print queue. lpq -P name views the entries for printer referred to as name. – The lprm command allows a user to remove (their own) jobs from the print queue. – The lpc command allows the administrator to manage the lpr/lpd environment. • NOTE: lpc has the distinction of winning the “flakiest program of the year” award five times in 15 years! Lpc has not been improved (thereby getting it off the honors list), instead other programs have been released which are even flakier!
  • 13. Printing • Printer and Print Job Management (BSD) • lpc allows the administrator to: – enable or disable queuing for a printer. – enable (start) or disable (stop) printing on a printer. The abort command is a harsh version of stop (current job is not completed). – Declare the printer down or up (these commands affect both spooling and printing). – Remove all jobs from a printers queue (clean). – Move a job to the top of the printers queue (topq). – Manipulate lpd (restart). – Get printer status information (status).
  • 14. Printing • System V Printing Overview – User wants to print file and invokes the lp utility. – lp takes the input and places in the appropriate spool directory. – lpsched determines when and where the file should be printed. – lpsched launches a filter to format the output and send it to the printer. – So far it looks just like lpr, right? • The similarities end here!
  • 15. Printing • Printer Setup (System V) • All of the print commands are different between BSD and System V! To name a few: – To print a file, use lp -d printer instead of lpr -P printer – To remove a print job, use cancel instead of lprm – To obtain print job status, use lpstat instead of lpq • In order to remain consistently inconsistent, Sun created lpr, lpc, and lpq programs under Solaris. These programs are actually wrapper programs which call the appropriate System V commands and pass the data off to the lp system.
  • 16. Printing • Printer Setup (System V) • System V printer software defines destinations and classes of printers. – A destination is (usually) a particular printer. » A destination could also be a plain file that you want to append text to. » Because lp uses exclusive locks on the printer “device” , this capability allows several users to append text to a file without concurrent access problems. –A class of printers is a group of destinations. » If you had two printers in a room, you could set them up as a class, and lp would print jobs to both printers (the first free printer gets the next job).
  • 17. Printing • System V Printing – lp is the user-level print command. – lp (sometimes) copies (and sometimes links) the data to the spool directory files (/var/spool/lp/request/dest). – Spool files are labeled xxxn where xxx varies depending on the OS. n is the print job number. – lpsched takes the files in the spool directories and sends them to the appropriate device.
  • 18. Printing • Printer and Print Job Management (System V) – System V UNIX uses the lpadmin command to setup and administer printers. – lpadmin is used to add/remove, start/stop, enable/disable printers much like lpc did in the BSD model. • Most System V systems want lpsched stopped before lpadmin commands will work. • As usual, Solaris had to be different. Solaris wants lpsched running before lpadmin commands will work.
  • 19. Printing • Printer Setup (System V) • lpadmin comes complete with a bag full of options: -d dest (make this the default printer) -x dest (remove printer dest) -p printer (tells lpadmin which printer to work with) -v device (append output for printer to file) -i interface (interface program for printer) -c class (add printer to class) -r class (remove class) -h (printer is hardwired) -l (printer is login terminal) -e dest (copy interface for printer to dest) -m model (copy model for printer to dest)
  • 20. Printing • Printer and Print Job Management (System V) • Once you add a printer with lpadmin, you have to tell the system to accept requests, and enable printing for that printer. • Solaris also requires you to set the type of input that can be sent to a printer (any, simple, postscript, ...). – This information is used to allow or deny printing based on the value of the magic number for the data file. – Programs like Mentor that define their own file types cause problems with this model. – You have to write a filter program to convert the “odd” files into a known/allowed file type in order to print them!
  • 21. Printing #!/bin/csh -f lpsystem -t bsd -y "OIT print server" print.helios.nd.edu lpsystem -t s5 -y "CSE print server” babbage.cse.nd.edu lpadmin -p lp -s print.helios.nd.edu!cse326 lpadmin -p lw384 -s print.helios.nd.edu!cse384 lpadmin -p lj323 -s print.helios.nd.edu!cse323 lpadmin -p eng_lab6 -s print.helios.nd.edu lpadmin -p eng_lab7 -s print.helios.nd.edu lpadmin -p eng_color1 -s print.helios.nd.edu foreach printer (lp eng_lab6 eng_lab7 eng_color1 lj323 lw384 ) lpadmin -p $printer -T unknown -I simple,postscript enable $printer accept $printer end lpadmin -d lp
  • 22. Printing • Printer and Print Job Management (System V) – System V printing software is a suite of programs to accomplish what BSD does with 3 programs: • cancel - remove a print job • accept/reject - tell system to accept/reject spooling jobs for printer. • enable/disable - tell the system to allow/reject printing on this printer. Job is still spooled, just not printed. • lpmove - move job to another printer. • lpstat - get status of print job(s)
  • 23. lpstat comes with a bag full of options: -a [list] Reports which print destinations are accepting requests. -c [list] Report status of all classes and their members. -d Report status of the system default destination. -f [list] [-l] Verify [list] the forms recognized by LP print service. -o [list] Report status of output requests. -p [list] [-D] [-l] Report status of printers [description] [capabilities]. -P Report paper types. -r Report the status of the LP request scheduler. -R Report the position of each job in the print queue. -s Report a status summary. -S [list] [-l] Verify the character sets / print wheels. -t Report all status information. -u [login-ID-list] Report status of output requests for users. -v [list] Report printer names and devices.
  • 24. Printing • Printing Problems and Solutions – The two basic print problems are: • No Output: – Check the obvious: » Is the printer on? » Does the printer have paper, ribbon, toner? » Is the printer paper jammed? » Will other jobs print? – Check the lp user database. – Determine if the print spooler can talk to the printer. – Check the printer log files for clues.
  • 25. Printing • Printing Problems and Solutions – Incorrect Output: • Check the printcap file (or lpadmin) to see if the printer type is correct. • Make sure the line discipline matches the printer settings. • Look at the filter files and see that they do what you think they are doing. • Check the data file for odd character sequences.
  • 26. Printing • Printing Problems and Solutions – Many times printing problems are due to software failures. These failures fall into two general categories: • System software failure. – lpd/lpsched has crashed/burned. » Use the appropriate commands to stop the lp system, then restart the lp system and see if the problem disappears. » If stop/restart does not work, try removing the first entry in the queue to see if lpd/lpsched work. If so, the problem is in the data file.
  • 27. Printing • Printing Problems and Solutions – Data file problems. • Look for odd character sequences in the file. • Try printing the file to another printer (same model if possible). • Check filter program operation. • Check job types allowed on the printer.
  • 28. Printing • Windows – Windows also knows about local and remote printers. • Local printers are almost always connected to a parallel port. • Local printers are added with the Printer Control Panel (Add Printer Wizard). • You will probably need the OS media to install print drivers. • Remote printers are handled similarly to the UNIX remote printers, but they require more setup: – Use the Add Printer Wizard – Add a printer port (defines remote spooler type) – Add the printer like it was a local printer. – If print server is a UNIX host, FIX the setup!
  • 29. Printing • Windows – Windows/DOS wants to send printer control codes to the printer. These codes are part of the language the printer uses to speak to the PC. • Unix does not like these control codes! – On NT/Win2k systems (Win 95/98 have no TCP print driver): • Go to the Document Defaults for the printer. • Select the Advanced options. • Select the Postscript Options. • Set the system so that it does NOT send control codes. • Set the system so that it does NOT send control-D after each print job.
  • 30. Summary • Configuring and managing printers should be easy. – Unfortunately, printer setup and management is not as easy as it should be. – The lack of standards makes this task a problem for system administrators. – Homogeneous printing is the simplest case. – Heterogeneous printing is the most problematic. • System administrators should understand how to: – Configure print services under Windows, BSD and System V. – Troubleshoot printing problems. – Configure filters and advanced printing options.