At times I am not able to print, on typing lpq it gives and error message “Printer not ready”.

I don’t know why this happens, but created a simple script which just resets the print and then its ready to print.

This is what the script looks like:

sudo sed -i -e ‘/StateMessage .*lpd failed/d’ -e ‘s/State Stopped/State Idle/’ /etc/cups/printers.conf

service cups restart

Happy printing !