[cups.general] Re: QUEUE paused: Unable to send print file toprinter: Connection reset by peer

Johannes Meixner jsmeix at suse.de
Tue Oct 4 08:14:08 PDT 2005


Hello,

On Oct 4 09:45 Vanush (Misha) Paturyan wrote (shortened):
> printers went into "disabled" mode 3rd time in 2 days

In your special case the scocket backend seems to be too cautious
when an error happened.

See for example the mail
http://www.easysw.com/cups/newsgroups.php?s5622+gcups.general+v5627
and the next two mails for an explanation why the default is
to be cautious.

A often used workaround is a cron job which re-enables all queues.

Alternatively you can use Till Kamppeter's wrapper for any backend:
http://www.linuxprinting.org/download/printing/beh

Alternatively you can use a selfmade "dumb" backend instead of
the original socket backend like
------------------------------------------------------------------
#! /bin/bash
# see the "CUPS Software Programmers Manual":
# "Writing Filters" and "Writing Backends"
# and see the man page "man backend".

# debug info in /var/log/cups/error_log
set -x

# output "Device Discovery" information on stdout
if [ "$#" -eq "0" ]
then
  echo 'network DumbSocket://192.168.1.2:9100 "Unknown" "Dumb Socket"'
  exit 0
fi

# have the input at fd0 (stdin) in any case
if [ -n "$6" ]
then
  exec <"$6"
fi

# infinite retries to access the remote port
until netcat -z 192.168.1.2 9100 >/dev/lp0
do
  echo 'INFO: cannot access 192.168.1.2:9100 - retry in 30 seconds' 1>&2
  sleep 30
done
echo 'INFO: sending the data to 192.168.1.2:9100' 1>&2

# forward the data from stdin to the remote port
if netcat -w 1 192.168.1.2 9100
then
  echo 'INFO:' 1>&2
  exit 0
else
  echo 'ERROR: failed to send the data to 192.168.1.2:9100' 1>&2
  exit 0
fi
------------------------------------------------------------------
Note the last "exit 0" even in case of a real error.
I.e. you would silently loose print jobs this way.
Replace the hardcoded "192.168.1.2" with the correct IP
and "9100" with the correct port of your printer
or enhance it a bit so that you can specify IP and port
in the DeviceURI string.
Save it as /usr/lib/cups/backend/DumbSocket
Set read and execute permissions accordingly.
Restart the cupsd.
Verify that the new backend is shown in "lpinfo -v".
Change the DeviceURI of the queue using
lpadmin -p <queue> -v DumbSocket://192.168.1.2:9100


Kind Regards
Johannes Meixner
-- 
SUSE LINUX Products GmbH, Maxfeldstrasse 5      Mail: jsmeix at suse.de
90409 Nuernberg, Germany                    WWW: http://www.suse.de/





More information about the cups mailing list