start prnting after a printer is turned on?

SA SA at example.net
Tue Nov 2 04:55:39 PST 2004


Jack,

Thanks for this - it is really very useful!

SA

> This is a similar issue that I have had with networked printers. If a printer is offline or unavailable the queue is set to "paused" by Cups and printing will not be restarted until manual intervention by the user. My solution is an ugly one that I got from another thread on this site. I run a cron job, like the script below, that automatically re-enables ALL Cups queues every minute:
> 
> ------SCRIPT BELOW THIS LINE-----------
> #!/bin/bash
> PRINTERS=$(/usr/bin/lpstat -a | /usr/bin/cut -d" " -f1)
> for PRINTER in $PRINTERS
> do
>    /usr/bin/enable $PRINTER
> done
> exit
> ------SCRIPT ABOVE THIS LINE-----------
> 
> This script just grabs all the printers that are enumerated by the lpstat command and then it (re)enables each one in a for loop. You could also just enable an indvidual printer with a script like
> 
> ------SCRIPT BELOW THIS LINE-----------
> #!/bin/bash
> /usr/bin/enable USBPrinter
> exit
> ------SCRIPT ABOVE THIS LINE-----------
> 
> where "USBPrinter" is the name of the print queue for your LaserJet 1300. But then if the name of the print queue changes, the script will no longer work.
> 
> A far as I understand it, this will not be "solved" in Cups until IPP Notification is added in the 1.2.X series. At that point, you will be able to capture a print failure event somehow and run a script to handle the event on a one-time basis instead of running a cron job every minute to blindly re-enable the printers you want to print without any user intervention.
> 
> Someone please correct me if I am wrong about any of this.
> 
> 
> Jack.
> 
> SA wrote:
> 
>>Is this either such a stupid question that no one has bothered to answer
>>it or is it really possible that no one knows a solution?
>>
>>
>>
>>
>>SA wrote:
>>
>>>Content-Type: text/plain; charset=us-ascii; format=flowed
>>>Content-Transfer-Encoding: 7bit
>>>
>>>start prnting after a printer is turned on?
>>>
>>>
>>>How do I start printing automatically after a printer has been turned on?
>>>
>>>
>>>The problem is that if my printer is turned on after my linux box
>>>printer server has booted then cups doesn't automatically start printing.
>>>CUPS just continues to queue jobs.  I don't want to let users configure
>>>CUPS (ie start the printer manually), is there a way to get CUPS to
>>>start printing once the printer is turned on automatically?
>>>
>>>
>>>I am running FC2 and a laserjet 1300 on a USB port with cups-1.1.20-11.4.
>>>
>>>Also my printer crashes most times if it is switched on at boot time.  It
>>>never did this under lpd and has only done this since installing CUPS.
>>>At boot the computer hangs for around 30s when CUPS starts then prints
>>>the message usb 2-2: control timeout on ep0in and the printer crashes.
>>>
>>>
>>>Any clues as to how to fix any of these problems?
>>>
>>>Thanks,
>>>
>>>
>>>SA
>>>
>>>
>>>My previous post seemd to be deleted - hence this repost.
> 
> 




More information about the cups mailing list