After doing some research, it occured that the printer was marked as 'paused' (although it was printing tons of other documents). The cups server logs weren't very helpful, but it became clear, that the 'paused' status was set during a temporal printer unavailability period (busy / lack of paper / offline).
A simple solution would be checking the printer status and switching it to 'ready' in case the printer was paused. So I added the following instruction to the printing script:
1 if [ ! "$(lpstat | grep Lexmark_X363dn | grep -o enabled)" ]
2 then
3 cupsenable Lexmark_X363dn || \
4 echo "Error, printer unavailable" && exit
5 fi
The condition in line 1 is fulfilled if no printer named Lexmark_X363dn is available, or a printer exists but it is not enabled. If so we try to enable the printer or show an error message if the operation was not successful.
Well after running this script the operation was indeed not successful, cupsenable required setting the SUID bit:
~ chmod +s /usr/sbin/cupsenable
This solved the printing issues for now, but I bet it's just a matter of time before something else stops working... Macs...
~KR
No comments:
Post a Comment