Setting printer status from STOPPED to IDLE

Kurt Pfeifle kpfeifle at danka.de
Mon Dec 18 09:17:49 PST 2006


> Bawenang wrote:
> > Hi, I've read in the development forum:
> >
> > QUOTE from http://www.cups.org/newsgroups.php?s933+gcups.development+v941+T1:
> > "The standard CUPS backends only use this exit code for absolutely fatal conditions such as bad URIs and other errors that require the administrator/user to manually fix the problem."
> >
> > So if my application runs into this error and the admin has fixed the problem manually, how do I set the status to IDLE again from STOPPED in my application? My plan is I'll just make a button that can be clicked by the admin to clear the jobs queue and set the status to IDLE. I know that to clear the queue I'll just call cupsCancelJob(). But how to set the printer status? I believe there's a function called SetPrinterState() in printers.h. Do I have to call that function? If I do, what are the parameters? I can't find the explanation anywhere.
> >
> > Sorry if the questions are rather stupid. I'm still a beginner in
> > programming with CUPS.
> >
> > Thanks alot in advance.
>
> In the web interface, hit the "start printer" button, or, on the
> command line, type
> 	enable your_printer_s_name

A simple "enable" without an absolute path usually will not work on
Linux (because "enable" is also a builtin Bash function). Try instead

  /usr/bin/enable your_printer_name

Recently, CUPS started to use "cupsenable" instead of the previous
"enable" (dunno which version exactly) because of the conflict with
the Bash builtin.




More information about the cups mailing list