Automatically detecting a printer which is not always on

Zack Weinberg zackw at panix.com
Mon Nov 21 15:51:57 PST 2005


This seems like it ought to be a FAQ but I can't find an answer either there or in the documentation.

I have just one printer.  It's connected to the computer via USB.  I don't use the printer very often, so most of the time I leave it turned off.  I want CUPS to accept print jobs all the time.  When the printer is on, it should start printing them; when the printer is off, it should hold the jobs until the printer is turned on, then print them.  Or, in terms of the command-line administrative interface: the queue should always exist and always be in "accept" mode; the moral equivalent of "enable"/"disable" should get automatically run when the printer is turned on/off, respectively.  Also, I should not have to remind CUPS what kind of printer it is each time I turn it on (this may have been fixed by now, but it used to fail to auto-detect the correct .ppd, and lose a manually installed .ppd when the printer was turned off).

The computer runs Linux (Debian) with a 2.6 kernel and udev/hotplug; /dev/usb/lp0 gets auto-created when I turn the printer on and removed when I turn it off; I have HAL installed and running, and lshal --monitor reports events when the printer is turned on or off.
The documented automatic queue creation stuff is not what I want, because (a) it appears only to trigger when cupsd is started, and (b) it doesn't allow me to queue print jobs when the printer is off.  It is not possible to do what I want with udev RUN rules, because a RUN rule executed on device removal does not know what device has been removed, nor can it be matched to the removal of a specific device (only to, say, any USB device).

How do I do this?  Answers by email, please; I may not remember to look back at the forums.

zw




More information about the cups mailing list