CUPS – printer in a stopped state

CUPS introduced an Error Policy which puts the CUPS printer into a stopped state when physical printers experiences an error, such as, paper jam, out of paper, paper tray open, etc. The CUPS printer does not change to an idle or ready state even after the physical problem is resolved, and the reason for this is not to drop print jobs or to send them to a printer that is not responding. The administrator must go to CUPS Web Administration or a command line to change the printer out of the stopped state. To prevent this situation change the CUPS ErrorPolicy to retry-job:

1. Enter this command at a terminal session while logged in as root:

root# /usr/sbin/lpadmin -p -o printer-error-policy=retry-job

2. Per printer – open the /etc/cups/printers.conf and find the printer that you wish to modify, and chang the ErrorPolicy entry from stop-printer to retry-job

<Printer "PrinterName">
...
ErrorPolicy retry-job

3. Globally change – open the /etc/cups/cupsd.conf and look for ErrorPolicy, if you find it, change the entry from stop-printer to retry-job.
If you do not find that entry, add the following at the end of the file:

ErrorPolicy retry-job

Or use the script below with a cron, which will automatically enables printers on a CUPS printing server:

#!/bin/sh
#
# Check if the printers are disabled and enable them.

DISABLED=`lpstat -t | grep disabled | awk ‘{ print $2 }’`

for PRINTER in $DISABLED
do
logger “Printer $PRINTER is stopped”
cupsenable -h 127.0.0.1:631 $PRINTER && logger “Printer $PRINTER has been enabled.”
done

Leave a Reply

Your email address will not be published. Required fields are marked *

*