Linux (CUPS) Spooler Troubleshooting

Step 1:Check Error logs

Command:    tail -f /var/log/cups/error_log 

I [08/Mar/2017:16:58:03 +0300] [Job ???] Request file type is text/plain.
 I [08/Mar/2017:16:58:03 +0300] [Job 7] Adding start banner page "none".
 I [08/Mar/2017:16:58:03 +0300] [Job 7] Adding end banner page "none".
 I [08/Mar/2017:16:58:03 +0300] [Job 7] File of type text/plain queued by "emdadm".
 I [08/Mar/2017:16:58:03 +0300] [Job 7] Queued on     
 "TEST_LABEL_PRINTER" by "emdadm".

Linux (CUPS) Spooler Commands

Step 2:To view the status of all print queues:

Command:    lpc status

Example:

serddad1:~ # lpc status
 TEST_LABEL_PRINTER:
 printer is on device 'socket' speed -1
 queuing is enabled
 printing is enabled
 1 entries
 daemon present

PROD_LABEL_PRINTER:
 printer is on device 'socket' speed -1
 queuing is enabled
 printing is enabled
 1 entries
 daemon present

Step 3:To check the status of a single print queue and view a list of pending jobs:

Command:  lpc status printer_name,  lpstat -P printer_Name,

lpstat -pprinter_name

Example:

serddad1:~ # lpc status TEST_LABEL_PRINTER
 TEST_LABEL_PRINTER:
 printer is on device 'socket' speed -1
 queuing is enabled
 printing is enabled
 1 entries
 daemon present
 serddad1:~ # lpstat -P TEST_LABEL_PRINTER
 TEST_LABEL_PRINTER-1 root 17408 Tue Feb 28 14:38:09 2017
 serddad1:~ # lpstat -pTEST_LABEL_PRINTER
 printer TEST_LABEL_PRINTER is idle. enabled since Thu Mar 9 14:30:20 2017

Step 4:To remove a single print job:

Command:  cancel printer_name-id(check output of lpstat -P TEST_LABEL_PRINTER)  ,

Example:

serddad1:~ # cancel TEST_LABEL_PRINTER-1

Step 5:To remove all print jobs in a queue:

Command: cancel -a  printer_name

Example:

serddad1:~ # cancel -a TEST_LABEL_PRINTER

Step 6:To enable  a queue:

Command:cupsenable  printer_name

Example:

serddad1:~ # cupsenable TEST_LABEL_PRINTER

Step 7:To disable  a queue:

Command:cupsdisable  printer_name

Example:

serddad1:~ # cupsdisable TEST_LABEL_PRINTER

Step 8:To enable all queues:

Command:

lpstat -p | grep disabled | awk '{print $2}' | xargs cupsenable

Example:

serddad1:~ #lpstat -p | grep disabled | awk '{print $2}' | xargs cupsenable

Step 9:To print a test job:

Command:

echo test_page | lpr -P printer_name

Example:

serddad1:~ #echo test_page | lpr -P  TEST_LABEL_PRINTER

Step 10:To restart/refresh the cups service:

Command:

service cups restart
Advertisements