Centos – Change CUPS default printer error policy

centoscupsprintingredhat

I run CUPS printing on a number of multiuser Linux application servers. The systems are RHEL or CentOS version 4, 5 or 6. Starting the EL5, the CUPS print server defaults to an error policy that basically disables the printer when there's an error or interruption (USB cable disconnect, network error, paper jam, etc.). This is the ErrorPolicy directive in printer's stanza in the /etc/cups/printers.conf file.

<Printer backupZ4>
Info backupZ4
DeviceURI socket://backupZ4:9100
State Idle
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy stop-printer
</Printer>

I normally change this field to ErrorPolicy retry-job manually in the config file or when I create the printer via the command line:

lpadmin -p backupZ4 -v socket://backupZ4:9100 -o printer-error-policy=retry-job -E 

When other users or vendors manage the print system, they often forget this change, which results in printers being hard disabled following a paper jam or other blips that need to be corrected with a cupsenable.

I'd like to know how to make retry-job the default ErrorPolicy in CUPS versus stop-printer.

Best Answer

There's a Feature Request that was Closed with Resolution to CUPS 1.3 for exactly this behavior. Link to the CUPS bug tracker: http://www.cups.org/str.php?L1871

I found no documentation to support this behavior in CUPS online documentation, but the documentation in the CUPS 1.5.2 source tarball I downloaded indicates that a global 'ErrorPolicy' declaration would work from the cupsd.conf config file.

Excerpt from the cupsd.conf documentation in Ubuntu CUPS 1.5.2:

CUPS 1.3/Mac OS X 10.5

ErrorPolicy

  Examples

     * ErrorPolicy abort-job
     * ErrorPolicy retry-job
     * ErrorPolicy stop-printer

  Description

   The ErrorPolicy directive defines the default policy that is used when a
   backend is unable to send a print job to the printer.

   The following values are supported:

     * abort-job - Abort the job and proceed with the next job in the queue
     * retry-job - Retry the job after waiting for N seconds; the cupsd.conf
       JobRetryInterval directive controls the value of N
     * retry-this-job - Retry the current job immediately and indefinitely.
     * stop-printer - Stop the printer and keep the job for future printing;
       this is the default value

(Note: Documentation Copyright of Apple Inc. and Reformatted to be readable.)