CUPS: starting a stopped USB printer
If the USB cable is accidentally disconnected, the printer enters the "Stopped" state and stays like that even after the cable is plugged back, or "rccups restart". This is not fun at all. One has to use http://localhost:631/ and start the printer manually after adding an administrative account with lppasswd -g sys -a root Too much routine dull administrative work for a simple thing. Ideally, the printer should resume printing when the USB connection is reestablished.
Hello, On Oct 28 10:50 Silviu Marin-Caea wrote (shortened):
If the USB cable is accidentally disconnected, the printer enters the "Stopped" state and stays like that even after the cable is plugged back, or "rccups restart".
This is not fun at all.
From your point of view it may be no fun but it is the normal and correct behaviour, read http://portal.suse.com/sdb/en/2004/05/jsmeix_print-cups-in-a-nutshell.html "The Back-Ends"
One has to use http://localhost:631/ and start the printer manually after adding an administrative account with lppasswd -g sys -a root
Or simply use /usr/bin/enable - read http://portal.suse.com/sdb/en/2004/05/jsmeix_print-cups-in-a-nutshell.html
Too much routine dull administrative work for a simple thing.
Ideally, the printer should resume printing when the USB connection is reestablished.
Why do you unplug the printer while it is printing and/or why don't you plug in the printer when you boot the system and/or before you use it?
From my point of view it seems you expect the printing system should automatically correct any kind of faults.
If you want automated re-enable in your particular case why don't you make a cron job? This way you have full control for which queues you will have an automated re-enable and for which queues you perefer the default behaviour. Why do you complain about "routine dull administrative work for a simple thing" when you yourself don't do the "simple thing" to make an appropriate cron job? Alternatively you could make and use your own USB backend, read http://www.cups.org/spm.html#WRITING_BACKENDS In spite of your "dull" (it is you who used this word) complaints I give you a simple example to get an idea how to make a backend. Here an example for a backend only for /dev/lp0 with everything hardcoded and with a dirty (race condition) test to access the device: ---------------------------------------------------------------- #! /bin/bash # see the "CUPS Software Programmers Manual": # "Writing Filters" and "Writing Backends" # debug info in /var/log/cups/error_log set -x # output "Device Discovery" information on stdout if [ "$#" -eq "0" ] then echo 'direct lp0:/dev/lp0 "Unknown" "lp0 Printer"' exit 0 fi # have the input at fd0 (stdin) in any case if [ -n "$6" ] then exec <"$6" fi # infinite retries to access the device until cat /dev/null >/dev/lp0 do echo 'INFO: cannot access /dev/lp0 - retry in 30 seconds' 1>&2 sleep 30 done echo 'INFO: sending the data to /dev/lp0' 1>&2 # forward the data from stdin to the device if cat - >/dev/lp0 then echo 'INFO:' 1>&2 exit 0 else echo 'ERROR: failed to send the data to /dev/lp0' 1>&2 exit 1 exit 1 fi ---------------------------------------------------------------- You can do whatever you like inside your backend provided the user who runs the backend (normally lp) is allowed to do it. Regards Johannes Meixner -- SUSE LINUX AG, Maxfeldstrasse 5 Mail: jsmeix@suse.de 90409 Nuernberg, Germany WWW: http://www.suse.de/
On Thursday 28 October 2004 5:21 am, Johannes Meixner wrote:
Or simply use /usr/bin/enable - read http://portal.suse.com/sdb/en/2004/05/jsmeix_print-cups-in-a-nutshell.html
I wsaa trying to find that enable command, in UNIX it was just enable. for my setup, all I typed was: /usr/bin/enable and it re-enabled my epson880 !
Too much routine dull administrative work for a simple thing.
Ideally, the printer should resume printing when the USB connection is reestablished.
Why do you unplug the printer while it is printing and/or why don't you plug in the printer when you boot the system and/or before you use it?
I don't normally leave my printer on all the time, I thought it wasn't necessary, and under windows it wasn't. I see under Linux, it disables the printer if you turn it off/ have it off when you boot. No big deal, now I know how to enable it.
If you want automated re-enable in your particular case why don't you make a cron job?
I might try that later, don't know that it is necessary now.
Alternatively you could make and use your own USB backend, read http://www.cups.org/spm.html#WRITING_BACKENDS
Here an example for a backend only for /dev/lp0 with everything hardcoded and with a dirty (race condition) test to access the device:
I don't know that this will work for me, SUSE failed to recognoze my printer, called it UNKNOWN device. SUSE 9.2 live CD installed it the first time at bootup, so I think my problems will be solved when my 9.2 CD comes in the mail :) thanks for the cups info ! I'm new to this stuff, used to use lpadmin though, so this isn't that bad. -- Paul Cartwright Registered Linux user # 367800
On Thursday 28 October 2004 3:50 am, Silviu Marin-Caea wrote:
This is not fun at all.
One has to use http://localhost:631/ and start the printer manually after adding an administrative account with lppasswd -g sys -a root
when I try to go to this site, it asks for a login and password for CUPS at localhost. I tried to use lppasswd as the user, and root, both failed. Do I need a user called CUPS, or what am I doing wrong? -- Paul Cartwright Registered Linux user # 367800
On Thu, 2004-10-28 at 12:39, Paul Cartwright wrote:
On Thursday 28 October 2004 3:50 am, Silviu Marin-Caea wrote:
This is not fun at all.
One has to use http://localhost:631/ and start the printer manually after adding an administrative account with lppasswd -g sys -a root
when I try to go to this site, it asks for a login and password for CUPS at localhost. I tried to use lppasswd as the user, and root, both failed. Do I need a user called CUPS, or what am I doing wrong?
You use lppasswd to add users to CUPS admin, lppasswd is NOT a user it is a command. You can add any user name you like but you do need to add at least one. -- Ken Schneider UNIX since 1989 SuSE since 1998 * Only reply to the list please*
On Thursday 28 October 2004 1:02 pm, Ken Schneider wrote:
You use lppasswd to add users to CUPS admin, lppasswd is NOT a user it is a command. You can add any user name you like but you do need to add at least one.
Thanks Ken, I appreciate the help. THis CUPS stuff is new to me. I've been doing UNIX since AT&T UNIX SYS V on an old 3B20, lpadmin was easy. I really like the /usr/bin/enable command better :) -- Paul Cartwright Registered Linux user # 367800
participants (4)
-
Johannes Meixner
-
Ken Schneider
-
Paul Cartwright
-
Silviu Marin-Caea