LinuxHowtoCupsStopped
Při použití protokolu lpd v CUPSU se občas stane že se tiskárna přepne do stavu Stopped a v logu se objeví
Remote host did not respond with command status byte after 300 seconds!
Started backend /usr/lib/cups/backend/lpd (PID 12672) for job 3128.
PID 12067 stopped with status 1!
Podle googlu se to stáva když tiskárna delší dobu neodpovídá (problém se sítí, nebo jenom chvilkovej výpadek).
Proto jsem udělal script, kterej kontroluje status tiskárny a když zjistí že je Stopped tak ji nastartuje.
V podstatě jde jenom o tohle:
#!/bin/bash printer="Nashuatec" chroot /data/samba lpq.cups -P $printer | grep -q "is not ready" && \ chroot /data/samba /usr/bin/enable $printer
Přidat to do cronu, tak jedou za 5 minut.
Upraveno Danem:
V printers.conf je direktiva ErrorPolicy?, ktera pokud neni zadana, je defaultne nastavena na stop_printer.
The ErrorPolicy? directive defines the policy that is used when a backend is unable to send a print job to the printer.
Mozne volby jsou:
- 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
- stop-printer - Stop the printer and keep the job for future printing; this is the default value
Teoreticky by melo pomoct nastaveni napr.:
<Printer name> ... ErrorPolicy abort-job </Printer>