[cups-devel] [UNKN] STR #4782: Raw printing multiple files no longer works (STR 1933 reappeared)

Johannes Meixner noreply at cups.org
Thu Mar 10 06:47:03 PST 2016


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Raw printing multiple files no longer works
at least from CUPS 1.7.5 up to CUPS 2.1.3
but it had worked at least in CUPS 1.3.9.

How to reproduce in general:

Set up a raw queue "rawq".

Submit more than one file to the queue as one print job:
lp -d rawq /etc/issue /etc/fstab

The backend will only send the first file to its destination.

I tested CUPS 1.7.5 (on SLES12)
and CUPS 2.1.3 (on openSUSE Leap 42.1) where it does not work
and verified that it works with CUPS 1.3.9 (on SLES11).

The issue was reported and fixed as STR#1933
http://www.cups.org/str.php?L1933

Using a dummy passthrough filter as workaround helps as described at
http://cups.org/pipermail/cups-devel/2007-February/005575.html

Details
(with CUPS 2.1.3 on openSUSE Leap 42.1):

For better debugging so that I can easily see what the backend sends
to its destination I use a selfmade backend that sends into a file:
# cat -n /usr/lib/cups/backend/tofile
  1  #! /bin/bash
  2  # Have debug info in /var/log/cups/error_log:
  3  set -x
  4  # Output "device discovery" information on stdout:
  5  if test "$#" = "0"
  6  then echo 'direct tofile:/tmp/tofile.out "Unknown" "/tmp/tofile.out"'
  7       exit 0
  8  fi
  9  # Have the input at fd0 (stdin) in any case:
 10  test -n "$6" && exec <"$6"
 11  # Infinite retries to access the file:
 12  until cat /dev/null >/tmp/tofile.out
 13  do echo 'INFO: cannot access /tmp/tofile.out - retry in 30 seconds'
1>&2
 14     sleep 30
 15  done
 16  echo 'INFO: sending data to /tmp/tofile.out' 1>&2
 17  # Forward the data from stdin to the file:
 18  if cat - >/tmp/tofile.out
 19  then echo 'INFO:' 1>&2
 20       exit 0
 21  else echo 'ERROR: failed to send data to /tmp/tofile.out' 1>&2
 22       exit 1
 23  fi

Set up a raw queue with that backend:
# lpadmin -p rawq -v tofile:/tmp/tofile.out -E

Submit two files to the queue:
# lp -d rawq /etc/issue /etc/os-release
request id is rawq-8375 (2 file(s))

See what the backend has output:
# cat /tmp/tofile.out
Welcome to openSUSE Leap 42.1 - Kernel \r (\l).


Inspect CUPS error_log (excerpts):
# grep -o 'Job 8375.*' /var/log/cups/error_log
...
Job 8375] argv[6]="/var/spool/cups/d08375-001"
...
Job 8375] Started backend /usr/lib/cups/backend/tofile (PID 10848)
...
Job 8375] sending data to /tmp/tofile.out
...
Job 8375] + exit 0
...
Job 8375] argv[6]="/var/spool/cups/d08375-002"
...
Job 8375] Job completed.
Job 8375] Removing document files.
Job 8375] Unloading...

The backend does "exit 0" before the second file.

Adding a dummy passthrough filter:

# cat -n /usr/lib/cups/filter/passthrough
 1  #! /bin/bash
 2  # debug info in /var/log/cups/error_log
 3  set -x
 4  # have the input at fd0 (stdin) in any case
 5  [ -n "$6" ] && exec <"$6"
 6  # pass through
 7  cat -

# lpadmin -p rawq -v tofile:/tmp/tofile.out -i
/usr/lib/cups/filter/passthrough -E
lpadmin: Unable to open PPD "/usr/lib/cups/filter/passthrough": Missing
asterisk in column 1 on line 1.

That lpadmin message can be ignored.
The System V interface script is set nevertheless:
# ls /etc/cups/interfaces/
rawq

Again submit the two files to the queue:
# lp -d rawq /etc/issue /etc/os-release
request id is rawq-8376 (2 file(s))

See what the backend has output:
# cat /tmp/tofile.out
Welcome to openSUSE Leap 42.1 - Kernel \r (\l).

NAME="openSUSE Leap"
VERSION="42.1"
VERSION_ID="42.1"
PRETTY_NAME="openSUSE Leap 42.1 (x86_64)"
ID=opensuse
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:opensuse:42.1"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://opensuse.org/"
ID_LIKE="suse"


Inspect CUPS error_log (excerpts):
# grep -o 'Job 8376.*' /var/log/cups/error_log
...
Job 8376] argv[6]="/var/spool/cups/d08376-001"
...
Job 8376] Started filter /etc/cups/interfaces/rawq (PID 10888)
Job 8376] Started backend /usr/lib/cups/backend/tofile (PID 10889)
...
Job 8376] argv[6]="/var/spool/cups/d08376-002"
...
Job 8376] Started filter /etc/cups/interfaces/rawq (PID 10893)
...
Job 8376] sending data to /tmp/tofile.out
...
Job 8376] + exit 0
...
Job 8376] Job completed.
Job 8376] Removing document files.
Job 8376] Unloading...

This time both files were sent by the backend.

Link: https://www.cups.org/str.php?L4782
Version: 2.1.3
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJW4YjnAAoJENujp6sI12IjVg0P/jHxaPp5KX7ABknMiYNuZIeR
6d3a+zAYit3700vgLzh+NmMpaHiOUelC4811MCrd1Jrg71u+TzLeya0owB/j+PfN
IcAbB3rNhmoKh4+a/2lI6tqZVmKvAk9eGJbaiFpGvAzoz5vTe+pUDKGNSE87txSM
8mdYEliYwOtBzf2xdywoelaFko+KGWNdAnclhMmz66Ywo0C2QeERbPRU/6KyWSil
Txumpi6og2hM04TV9Zw9HDYo2hhJiTm6XlhALBXZvWvjcaRynLgKV/kNgs9zpCmz
YjB38FpBblKtKd13X7i0XTCuQQKTvSP7d3QOxxLZAvX0Tc/vbzWMTCiMOR8HKnbf
VbtmtA/95NLXUz2Ohzeok4IIp/UfziZMfC3bqsNfPdsVSxsVhbk9GVPdGcCW/pHH
tHtl8MIvtH6KyPRBBg76lJT5wQ6TpaUpYldtCO6BSgz4dq8D0pTy8fQHsMf0jMYH
4Tji9BMhqhSp25Nwhw6oT1ec/lHJ9xjL4Q52eGAG6LsgwVwU/AcIjNh77b0aaxNI
a5RC4PWiwi2GOid59GRrVOIyDNfMcrNtGxJHanXbgO+SE6dETvQ+MczfmucIjIw/
2Bb7tFQNWzA98EfPkv1U/KAUiiKbs/n/DoA+rfb/AIIhtJq20rous67N49ufoHdC
F9bli7t6NIaOx0dxiM2O
=v62w
-----END PGP SIGNATURE-----




More information about the cups-devel mailing list