Printable
Computing & Network Services   |   Information Systems   |   Instructional Technology Services   |   User Support Services (helpdesk)



 - LPR Printing :: Tips and Tricks



LPR Printing Home

Request a New Printer/Print Queue

Tips for managing LPR printers

Printers & Contacts - Searchable

LPR Print Queue Management w/Unix Tools

LPR Print Queue Management w/Unix Tools

Note: the home for this document is now http://printers.pdx.edu/ where you'll find a link to this info along with a bunch of other printing-related stuff. Please update your bookmarks/favorites/links.

Abstract:

The following is a brief description of procedures and tips for dealing with LPR print services. PSU uses the lprng print spooler system along with the ifhp filter system for processing print jobs before they are sent to the server. If you have anything you need to add, or you have any questions or complaints, please contact the Help Desk - help@pdx.edu.

In order to be able to manipulate print jobs other than your own you must be a member of the inkers group. If you think you should be in this group, contact the Unix Team at 5-9151.

Useful commands:

  • lpr - Send a print job to a printer
    • most useful with the "-P queuename" option. Just follow "-P" with a queuename.

      lpr -P nh-96 myfile.txt

      prints a file called "myfile.txt" to the to Neuberger Hall 96 printer.

  • lpq - Shows queue information
    • the most effective form of the command is lpq -P queuename -ll (the -ll controls the level of detail and can be from 1 to 3 lowercase l's or a -L for the most detail available)

      lpq -P nh-96

      shows:

        Printer: nh-96-hp5si-2@printhost.oit.pdx.edu (dest nh-96-hp5si-2@131.252.228.100)
         HP LaserJet 5 SI - nh-96-hp5si-2
         Queue: 5 printable jobs
         Server: pid 10748 active
         Unspooler: pid 10765 active
         Status: sending data file dfA991NH096P30 to nh-96-hp5si-2@131.252.228.100
                  at 15:55:47.303
         Rank   Owner/ID                  Class Job Files                 Size Time
        active NH096P30@NH096P30+991        A   991 Microsoft Excel      2230665 15:55:45
        2      NH096P27@NH096P27+8          A     8 Microsoft Word - BI  51624 11:30:57
        3      NH096P53@NH096P53+758        A   758 Microsoft Word - His 75401 11:35:59
        4      NH096P22@NH096P22+264        A   264 Microsoft Word - BA3 45592 11:46:17
        5      NH096P22@NH096P22+998        A   998 myfile.txt           45592 11:46:27

  • lprm - Removes jobs from the queue
    • lprm queuename jobid, where jobid is the job number, the username of the person who sent the job (to remove all jobs from that user) or the name of the client host (to remove all jobs sent from that client)

      lprm -P nh-96 758

      Removes job "758" from the Neuberger Hall 96 printer listed above.

  • lpc - Line Printer Control - allows in depth control of jobs and queues
    • lpc can be run interactively by just typing lpc with no arguments. Once inside the program, typing help gives a list of all available commands. All of the commands listed can also be used from the unix prompt without entering lpc by typing lpc command
    • Some of the most useful lpc commands are:
      • lpc hold queuename jobid - holds the job in the queue
      • lpc release queuname jobid - releases the job from the queue
      • lpc holdall queuename - changes all jobs sent to the queue to hold status. Note that jobs sitting in the queue before this command is given are not held. lpc noholdall queuename turns this off
      • lpc status queuename - shows the status of the queue (whether it's redirected, if queuing is enabled, etc)
      • lpc kill queuename - aborts a stalled job in the queue, restarts the queue and resends the job. Very useful.
      • lpc redirect orig-queuename new-queuename - does what you'd think it would
      • lpc redirect orig-queuename off - removes any redirects on the queue

The Gory Details:

  • A user sends a job from an application on their desktop, from inside the BANNER application, or from the command line of one of the unix hosts.
    • In the case of a win32/mac desktop,an LPR printer driver must be configured to point to a printer alias/queue name (for example: tek1) on our print server (printhost.oit.pdx.edu).
    • On unix machines, the print command is lpr -P queuename filename.
    • As you may have noticed from the above examples, print queues can be known by several different names. However, all unix queues should have at least one name of the form building-room-printermodel. For example the sh-120h-lexw810 print queue is attached to the Lexmark Optra 810 in Shattuck Hall Room 120H. In addition, the sh-120h-lexw810 also has an alias of tek1.
  • The job is accepted by printhost.oit.pdx.edu and depending on the queue information found in /etc/printcap is either sent through the ifhp filter system and then sent to the printer or sent directly to the printer.
  • For most printers, the printer communicates the status of the job back to printhost in fairly good detail.
  • Note that a single physical printer may have mutiple queues pointing to it and that each queue usually has several aliases.

User Tools:

  • Look above at the useful commands section. You can use these tools when logged into to ODIN. This is the best way to manipulate the printers.
  • We have a java tool that we give to our users called grendel. You can find it at ftp://ftp.oit.pdx.edu/pub/grendel

Troubleshooting:

  • This is a brief rundown of the sequence of tests, details about the commands follow.
  • Q: Someone just called me and says "I can't get the print jobs that I sent to 'tek1'." What do I do?
  • A: The sequence I usually follow is:
    1. Check the queue
      • If the queue can't connect to the device, ping the printer's ip address.
        • If the device is not pingable, check the printer's network configuration (default gateway, ip address, etc). If the printer's set up properly, check the printcap information to make sure it matches. If not, contact the unix team so that we can make the neccessary adjustments.
        • If you can ping the device, portscan it using the nmap utility. Ports 515 or 9100 must be open in order for the printer to accept jobs from printhost. If they're not, a firmware upgrade usually takes care of the problem.
      • If you see a job with the status (stalled), use the lpc kill command.
    2. If the queue looks ok, send a test job to the printer and watch it move through the queue with the -t5 option to lpq. Have the user report success or failure.
      • If the jobs move through the queue just fine, and ifhp gives the status JSUCC as its exit code, the problem is probably local to the printer device. Get in touch with the departmental contact for the printer, or if you are the departmental contact, check paper, toner, etc. The hpwebjet utility is also useful to see what error the printer is displaying in its panel.
    3. For every printer, check the firmware revision using the hpwebjet admin tool (details below). Out of date firmware probably causes 80% of our printer problems.

Troubleshooting Details:

  • Get IP from queuename
    • The command lpc printcap queuename will output the entire printcap entry for the queue, including the remote printer's IP. Try lpc printcap queuename | grep 131.252 for just the IP.
  • NOTE - Make sure the printer will not be powered off during the firmware upgrade! Bad things will happen.
  • Higher end non-HP printers usually have a built-in web server that you can access by pointing your browser directly to the device's ip address. Some of them allow you to upgrade printer firmware through the web server, but most aren't so nice. You'll have to visit the website for the particular printer's manufacturer and follow their instructions.
  • Mysterious Printing
    • If jobs start printing without anyone sending jobs to the printer, the culprit may be a cleanup job that is run every day at 10AM on printhost. This job scans all print queues on campus looking for errorred out jobs and tries to resend them to the printer. It will attempt to do so for three days, after which the job will be removed from the queue.
  • Useful files:
    • /etc/printcap - contains all configuration voodoo including ips, whether or not jobs are sent through the ifhp system, etc.
    • /var/spool/lpd/queuename on printhost (the directory where jobs are spooled)



  • This page maintained by: help@pdx.edu


    © Portland State University 1994-2008