4.15. Print Job Classes, User Requested Job Priority, and Form Support

The LPRng software allows users to assign a class name to print jobs using the lpr -Cname option. This causes the lpr command to put the line Cname in the control file. By default, the (upper cased) first letter of the class name is used to assign a user requested priority to the job, with A being the default lowest priority and Z being the highest.

The ignore_requested_user_priority printcap option can be used to ignore the user requested priority and jobs will be printed in the normal first-in first-out order.

LPRng also makes use of the class information to do form support and restrict printing to a specific set of classes. By default the job class information is ignored, but the lpc class command can be used to specify one or more classes (actually glob patterns) to be printed. This facility can be used to do support printing of jobs that require a specific form setup. Here is a simple example of how to use this facility.

Edit the printcap file so it has contents indicated below, use checkpc -f to check the printcap, and then use lpc reread to restart the lpd server.

    lp:force_localhost
    lp:server
      :sd=/var/spool/lpd/%P
      :lp=lp2@localhost
    lp2:force_localhost
    lp2:server
      :sd=/var/spool/lpd/%P
      :lp=/tmp/lp2
Execute the following commands to print the /tmp/hi file and observe the results:
    h4: {249} % lpc class lp red
    Printer: lp@h4
    classes printed 'red'
    lp@h4.private: class updated
    h4: {250} % lpq
    Printer: lp@h4  (classes red)
     Queue: no printable jobs in queue
    h4: {251} % lpr /tmp/hi
    h4: {252} % lpq
    Printer: lp@h4  (classes red)
     Queue: no printable jobs in queue
     Holding: 1 held jobs in queue
     Server: no server active
     Rank   Owner/ID           Class Job Files        Size Time
    holdclass papowell@h4+82     A    82 /tmp/hi         3 09:29:52
    h4: {253} % lpr -Cred /tmp/hi
    h4: {254} % lpq
    Printer: lp@h4  (classes red)
     Queue: no printable jobs in queue
     Holding: 1 held jobs in queue
     Server: no server active
     Status: job 'papowell@h4+89' removed at 09:30:13.569
     Rank   Owner/ID           Class Job Files        Size Time
    holdclass papowell@h4+82     A    82 /tmp/hi         3 09:29:52


As seen in the example, we set the queue class to red, and then sent a (default) class A job to the printer. It was not printed, and is listed with holdclass status. We sent another job which was immediately printed.

We can change the print queue class at any time, and then new class will then control what jobs are printed. To disable the class selection, use the lpc class queue off command.

    h4: {255} % lpc class lp off
    Printer: lp@h4
    all classes printed
    lp@h4.private: class updated