[cups.general] Restart PrintPro printers (CUPS) via command line

Joe D. Trent jtrent at bighamtakeoutbrothers.com
Mon Feb 9 07:30:11 PST 2009


Michael,

A related question: what causes the printers to be disabled? I was 
rocking along with a couple of pretty much flawless years of operation 
(cups 1.2.12) and after I installed some seemingly minor Fedora updates 
all my printers started dropping out. I have some connected to d-link 
printservers and some connected directly to the network.

In the error_log I get a message saying the host didn't respond after 
300 seconds. But that message was never more than a few seconds after 
the job was queued.

I tried the retry-job option and it worked, at least to keep the 
printers from being disabled. Then it just started holding jobs and I 
have to release them. I've started a program to check every five seconds 
to see if there are any jobs in the queue and release them. We'll see if 
that works ok. But I'm still wondering what causes this. Lots of people 
seem to have this problem, but I haven't seen any real fixes.

Thanks,
Joe


Michael R Sweet wrote:
> Matt wrote:
>> We're having a problem with some printers in PrintPro periodically 
>> stopping for no known reason.
>>
>> I have seen the following to restart the printer:
>>
>> /usr/bin/enable printername
> 
> Yes, this is the right command.
> 
>> /usr/sbin/lpr restart
> 
> You probably mean "lpc restart", which isn't implemented by the CUPS
> version of lpc.
> 
>> Really what I want to do is schedule something to find all stopped 
>> printers and restart them.  I don't want to stop/start printers that 
>> are already online.
> 
> Prior to CUPS 1.2, you can use a cron job to periodically enable all
> printers, e.g.:
> 
>     #!/bin/sh
>     for printer in `lpstat -p | grep printer | awk '{print $2}'`; do
>         /usr/bin/enable $printer
>     done
> 
> In CUPS 1.2 and higher, use the "retry-job" error policy to prevent the
> queue from stopping.  Keep in mind that the jobs can get out of order
> that way; CUPS 1.4 adds a "retry-current-job" error policy to prevent
> that issue.
> 




More information about the cups mailing list