AnsweredAssumed Answered

CUPS on Vybrid PCM-052: filter exits with "permission denied"

Question asked by mpfgregory on Jun 30, 2015
Latest reply on Jul 16, 2015 by mpfgregory

I'm using a Phytec PCM-052 development kit with Timesys embedded Linux 3.0.13 and I'm trying to get CUPS 1.5.3 working. I've come pretty far. I can print postscript on our network printer, and I can manually pipe files through the filter chain to get a .pclx file that I can print on a USB printer. However, when I use the same filter chain from within the cupsd daemon, the filters exit with the satus "permission denied":

PID 799 (rastertopclx) stopped with status 113 (Permission denied)

 

How to reproduce:

- build the Timesys toolchain with cups, ghostscript, libusb and kernel usb printing support enabled

- the build stops with errors because of multiply defined symbols. Comment out "typedef signed long long int64_t"; in /ghostscript-9.05/base/stdint_.h and "struct timeval" { in /ghostscript-9.05/base/time_.h to fix the build !

- install the bootloader, kernel and rootfs on an SD card and start the PCM-052

- plug a USB printer into USB0

# echo hello > bla.txt

# cat bla.txt > /dev/usb/lp0

- the printer prints "hello", now let's use CUPS

# lpadmin -p printer_name -E -v parallel:/dev/usb/lp0

- usb:/dev/usb/lp0 URI doesn't work, I don't know why it works with parallel

# export LPDEST=printer_name

# chmod 0700 /usr/lib/cups/backend/parallel

- the backends come with 755 permissions after a fresh install, this doesn't work for some reason. Lowering the permissions to 0700 fixes it

# lpr bla.txt

- the printer prints "hello", now let's use the cups filters to print postscript

# lpadmin -x printer_name

# lpadmin -p printer_name -E -v parallel:/dev/usb/lp0 -P /usr/share/cups/model/pxlmono.ppd

- a standard PPD file that comes with the installation, for our printer we have a PPD provided by the manufacturer

# vi /etc/cups/cupsd.conf

- set LogLevel to debug2

# reboot

# export LPDEST=printer_name

# lpr bla.txt

- nothing is printed

# cat /var/log/cups/error_log | tail -n 200

- somewhere in the output you'll find the error messages from the filters: PID 799 (rastertopclx) stopped with status 113 (Permission denied), the same for the other filters in the chain.

 

If I manually call the filter chain and convert bla.txt to bla.ps to bla.raster to bla.pclx, I can "lpr bla.pclx" to print a "hello" in the font defined by the PPD file. The filters work fine, but not from within cupsd.

 

From what I've learned from the CUPS documentation (Filter and Backend Programming - CUPS.org ) the filters run as user "lp". I first thought they try to open some files, like the PPD or cupsd.conf, and don't have the permissions to do so. But replacing the filters with an executable that simply returns 0 gives the same error message in /var/log/cups/error_log. I've tried changing permissions of all CUPS related files and directories to 700, 755, 555, but I got the same result. Changing permissions to 0777 produces an "inscure filter permissions" error in /var/log/cups/error_log. I've also tried changing user and group of all CUPS related files and directories to "lp", same result.

 

Does anybody have CUPS from the Timesys distribution running?

Outcomes