retitle 631025 cups: change default ErrorPolicy for network printers
tags 631025 upstream
quit


Am Dienstag, den 29.05.2012, 11:36 +0200 schrieb Paul Menzel:
> Am Donnerstag, den 17.05.2012, 15:33 +0200 schrieb Paul Menzel:
> 
> > Am Sonntag, den 19.06.2011, 20:38 +0200 schrieb Paul Menzel:
> > 
> > […]
> > 
> > > I believe after every CUPS upgrade my printer is deactivated and I have
> > > to activate it again (using the GNOME printer dialog, the checkbox
> > > before »Activated« (German »Aktivieren«) is not set). I am not a 100 %
> > > sure because I do not always print something after every upgrade but it
> > > happens since over a year and I expect the upgrades are at fault.
> > > 
> > > Is that a known problem? Please tell me what other information you need
> > > for solving this issue.
> > 
> > users on my system still experience this problem. It is very annoying
> > because normal users are not allowed to start and stop printers and
> > therefore cannot fix that problem by themselves.

looking more into this problem this has nothing to do with the upgrades
per se. Sometimes there are network problems because the printer is
unreachable due to an unplugged network cable. With log level debug
there is the following in `/var/log/cups/error_log`.

        $ more /var/log/cups/error_log
        […]
        D [15/Jun/2012:21:29:33 +0200] [Job 1212] <job data> 
        D [15/Jun/2012:21:29:33 +0200] [Job 1212] 
        D [15/Jun/2012:21:29:37 +0200] [Job 1212] 
        D [15/Jun/2012:21:29:37 +0200] [Job 1212] Closing renderer
        D [15/Jun/2012:21:29:38 +0200] [Job 1212] PAGE: 1 1
        D [15/Jun/2012:21:29:38 +0200] Discarding unused job-progress event...
        D [15/Jun/2012:21:29:38 +0200] [Job 1212] STATE: +connecting-to-device
        D [15/Jun/2012:21:29:38 +0200] Discarding unused printer-state-changed 
event...
        D [15/Jun/2012:21:29:38 +0200] [Job 1212] renderer exited with status 0
        D [15/Jun/2012:21:29:41 +0200] [Job 1212] prnt/backend/hp.c 745: ERROR: 
open device failed stat=12: hp:/net/Photosmart_2600_series?ip=10.10.10.10

So the HP backend fails because of the unplugged network cable.

        D [15/Jun/2012:21:29:41 +0200] [Job 1212] kid4 received signal 13
        D [15/Jun/2012:21:29:41 +0200] [Job 1212] kid3 finished
        D [15/Jun/2012:21:29:41 +0200] [Job 1212] kid3 exited with status 0
        D [15/Jun/2012:21:29:41 +0200] [Job 1212] 
        D [15/Jun/2012:21:29:41 +0200] [Job 1212] Closing foomatic-rip.
        D [15/Jun/2012:21:29:41 +0200] PID 16762 
(/usr/lib/cups/filter/foomatic-rip) exited with no errors.
        D [15/Jun/2012:21:29:41 +0200] PID 16763 (/usr/lib/cups/backend/hp) 
stopped with status 1.
        I [15/Jun/2012:21:29:41 +0200] [Job 1212] Backend returned status 1 
(failed)
        D [15/Jun/2012:21:29:41 +0200] Discarding unused job-state-changed 
event...
        I [15/Jun/2012:21:29:41 +0200] [Job 1212] Printer stopped due to 
backend errors; please consult the error_log file for details.
        D [15/Jun/2012:21:29:41 +0200] cupsdMarkDirty(----J-)
        D [15/Jun/2012:21:29:41 +0200] cupsdSetBusyState: newbusy="Printing 
jobs and dirty files", busy="Printing jobs and dirty files"
        D [15/Jun/2012:21:29:41 +0200] cupsdSetBusyState: newbusy="Printing 
jobs and dirty files", busy="Printing jobs and dirty files"
        D [15/Jun/2012:21:29:41 +0200] Discarding unused printer-stopped 
event...
        D [15/Jun/2012:21:29:41 +0200] cupsdMarkDirty(P-----)
        D [15/Jun/2012:21:29:41 +0200] cupsdSetBusyState: newbusy="Printing 
jobs and dirty files", busy="Printing jobs and dirty files"
        D [15/Jun/2012:21:29:41 +0200] 
cupsdRegisterPrinter(p=0xb914f958(Photosmart_2600))
        D [15/Jun/2012:21:29:41 +0200] cupsdMarkDirty(P-----)
        D [15/Jun/2012:21:29:41 +0200] cupsdSetBusyState: newbusy="Printing 
jobs and dirty files", busy="Printing jobs and dirty files"
        I [15/Jun/2012:21:29:59 +0200] Saving printers.conf...

Here probably it is written to `/etc/cups/printers.conf` that this
printer is stopped.

        I [15/Jun/2012:21:29:59 +0200] Saving job.cache...
        D [15/Jun/2012:21:29:59 +0200] cupsdSetBusyState: newbusy="Not busy", 
busy="Printing jobs and dirty files"
        […]

> […]
> 
> > I also looked through `/var/log/cups/` and could not find any messages
> > logging that the printer was stopped.
> 
> Thanks to Till in #openprinting on freenode.net I now know that the
> state is saved in `printers.conf`.
> 
>         $ ls -l /etc/cups/printers.conf*
>         -rw------- 1 root lp 1546 Mai 28 01:23 /etc/cups/printers.conf
>         -rw------- 1 root lp 1546 Mai 26 12:53 /etc/cups/printers.conf.O
>         $ sudo diff -u /etc/cups/printers.conf*
> 
> According to `man printers.conf` this file is automatically created by
> cupsd every time a printer is added or removed. In this case
> `printers.conf` was created when I turned on the printer and
> `printers.conf.0` when I used `gnome-control-center` to activate the
> printer again.
> 
> I will monitor these files and hopefully get some clues what triggers
> this problem.

After the backend fails the only way to use this printer again is to
resume the printer using for example the Web interface (localhost:631)
or `gnome-control-center`. Next time seeing this I should also try if

    /usr/sbin/cupsenable printername

works on the system [1].

So responsible for this behavior seems to be the following configuration
in `/etc/cups/printers.conf`.

    ErrorPolicy stop-printer

Other CUPS users also have that problem [1].a

The documentation of `printers.conf` [2] lists the following options I
paste.

        The following values are supported:
        
     1. abort-job - Abort the job and proceed with the next job in the
        queue
     2. retry-current-job - Retry the current job immediately
     3. retry-job - Retry the job after waiting for N seconds; the
        cupsd.conf JobRetryInterval directive controls the value of N
     4. stop-printer - Stop the printer and keep the job for future
        printing; this is the default value

Two notes regarding 3.

α) `man cupsd.conf` does not say what default value is used for
`JobRetryInterval`.
β) What happens when the backend comes back before the value of
`JobRetryInterval` is over?

The optimal solution for my use case would be an option, »Retry the job
when the printer becomes available again« which then is used by default
for network printers.

Also this seems to be related to the backend? (Note: I have no idea how
CUPS internals work.) The HP backend should be notified when the printer
is turned on (I assume it will send some kind of broadcast signal) and
pass on to CUPS that printer is available.


Thanks,

Paul


[1] http://serverfault.com/questions/73078/linux-cups-auto-re-add-printer
[2] http://www.cups.org/documentation.php/doc-1.4/ref-printers-conf.html

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to